import React, {Component} from 'react';
import './Title.css';
const HELP_TEXT=(
使用提示:
- 为保证使用体验,请使用 Chrome 浏览器 stable 分支最新版
- 在列表中点击帖子可以显示全部回复
- 搜索框输入 #472865 等可以查看指定 ID 的树洞
使用本网站时,您需要了解并同意:
- 所有数据来自 PKU Helper,本站不对其内容负责
- 不接受关于修改 UI 的建议
- 英梨梨是我的,你们都不要抢
By @xmcp
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
);
class ControlBar extends Component {
constructor(props) {
super(props);
this.state={
search_text: '',
};
this.set_search_text=props.set_search_text;
}
componentDidMount() {
if(window.location.hash) {
const text=window.location.hash.substr(1);
this.setState({
search_text: text,
});
this.set_search_text(text);
}
}
on_change(event) {
this.setState({
search_text: event.target.value,
});
}
on_keypress(event) {
if(event.key==='Enter')
this.set_search_text(this.state.search_text);
}
do_refresh() {
window.scrollTo(0,0);
this.setState({
search_text: '',
});
this.set_search_text(null);
}
render() {
return (