-
- {this.info.likenum} 赞
- {this.info.reply} 回复
- #{this.info.pid}
-
-
-
{this.info.text}
- {this.info.type==='image' ?

: null}
- {this.info.type==='audio' ?
: null}
+
{this.props.callback(
+ '帖子详情',
+
+
+ {this.state.replies.map((reply)=>)}
+ )}}>
+
{this.state.reply_loading &&
}
{this.state.replies.map((reply)=>
)}
@@ -78,7 +91,7 @@ function FlowChunk(props) {
return (
- {props.list.map((info)=>)}
+ {props.list.map((info)=>)}
);
}
@@ -89,9 +102,10 @@ export class Flow extends Component {
this.state={
mode: props.mode,
loaded_pages: 0,
- chunks: []
+ chunks: [],
+ loading: false,
};
- this.load_page(1);
+ setTimeout(this.load_page.bind(this,1), 0);
}
load_page(page) {
@@ -100,7 +114,8 @@ export class Flow extends Component {
if(page===this.state.loaded_pages+1) {
console.log('fetching page',page);
this.setState((prev,props)=>({
- loaded_pages: prev.loaded_pages+1
+ loaded_pages: prev.loaded_pages+1,
+ loading: true,
}));
fetch('http://www.pkuhelper.com:10301/pkuhelper/../services/pkuhole/api.php?action=getlist&p='+page)
.then((res)=>res.json())
@@ -111,7 +126,8 @@ export class Flow extends Component {
chunks: prev.chunks.concat([{
title: 'Page '+page,
data: json.data,
- }])
+ }]),
+ loading: false,
}));
})
.catch((err)=>{
@@ -121,12 +137,31 @@ export class Flow extends Component {
}
}
+ on_scroll(event) {
+ if(event.target===document) {
+ //console.log(event);
+ const avail=document.body.scrollHeight-window.scrollY-window.innerHeight;
+ if(avail
{this.state.chunks.map((chunk)=>(
))}
+
);
}
diff --git a/src/Sidebar.css b/src/Sidebar.css
new file mode 100644
index 0000000..f5bfb4d
--- /dev/null
+++ b/src/Sidebar.css
@@ -0,0 +1,40 @@
+.sidebar-shadow {
+ opacity: 0;
+ background-color: black;
+ pointer-events: none;
+ transition: opacity 200ms ease-out;
+ position: fixed;
+ left: 0;
+ top: 0;
+ height: 100%;
+ width: 100%;
+ z-index: 2;
+}
+.sidebar-on .sidebar-shadow {
+ opacity: .3;
+ pointer-events: initial;
+}
+
+.sidebar {
+ transition: left 200ms ease-out;
+ position: fixed;
+ left: 100%;
+ top: 0;
+ height: 100%;
+ width: calc(100% - 700px);
+ padding: 1em;
+ background-color: #fff;
+ z-index: 3;
+ overflow-y: auto;
+}
+.sidebar-on .sidebar {
+ left: 700px;
+}
+
+.sidebar-flow-item {
+ display: block;
+}
+.sidebar-flow-item .box {
+ margin: 1em;
+ width: calc(100% - 2em);
+}
\ No newline at end of file
diff --git a/src/Sidebar.js b/src/Sidebar.js
new file mode 100644
index 0000000..3a5e0bf
--- /dev/null
+++ b/src/Sidebar.js
@@ -0,0 +1,18 @@
+import React, {Component} from 'react';
+import './Sidebar.css';
+
+export function Sidebar(props) {
+ return (
+
+ );
+}
\ No newline at end of file
diff --git a/src/Title.js b/src/Title.js
index 3653168..e6c11c2 100644
--- a/src/Title.js
+++ b/src/Title.js
@@ -1,22 +1,31 @@
import React, {Component} from 'react';
import './Title.css';
-const tos=`P大树洞网页版
-
-使用本网站时,您需要了解并同意:
-
-- 所有数据来自 PKU Helper,本站不对其内容负责
-- 不接受关于修改 UI 的建议
-- 英梨梨是我的,你们都不要抢`;
-
export function Title(props) {
return (
)
}
\ No newline at end of file
diff --git a/src/index.css b/src/index.css
index 413b3a7..be5a041 100644
--- a/src/index.css
+++ b/src/index.css
@@ -5,6 +5,10 @@ body {
background-color: #eee;
}
+body::-webkit-scrollbar {
+ display: none;
+}
+
* {
box-sizing: border-box;
}