add life info box
This commit is contained in:
92
src/Title.js
92
src/Title.js
@@ -1,65 +1,12 @@
|
||||
import React, {Component, PureComponent} from 'react';
|
||||
import {AppSwitcher} from './infrastructure/widgets';
|
||||
import {LoginForm, PostForm} from './UserAction';
|
||||
import {InfoSidebar, PostForm} from './UserAction';
|
||||
import {TokenCtx} from './UserAction';
|
||||
import {PromotionBar} from './Common';
|
||||
import {ConfigUI} from './Config';
|
||||
|
||||
import './Title.css';
|
||||
import {BalanceShower} from './BalanceShower';
|
||||
import {cache} from './cache';
|
||||
|
||||
const flag_re=/^\/\/setflag ([a-zA-Z0-9_]+)=(.*)$/;
|
||||
|
||||
const HELP_TEXT=(
|
||||
<div className="box help-desc-box">
|
||||
<p>
|
||||
PKUHelper 网页版树洞 by @xmcp,
|
||||
基于
|
||||
<a href="https://www.gnu.org/licenses/gpl-3.0.zh-cn.html" target="_blank">GPLv3</a>
|
||||
协议在 <a href="https://github.com/pkuhelper-web/webhole" target="_blank">GitHub</a> 开源
|
||||
</p>
|
||||
<p>
|
||||
PKUHelper 网页版的诞生离不开
|
||||
<a href="https://reactjs.org/" target="_blank" rel="noopener">React</a>
|
||||
、
|
||||
<a href="https://icomoon.io/#icons" target="_blank" rel="noopener">IcoMoon</a>
|
||||
等开源项目
|
||||
</p>
|
||||
<p>
|
||||
<a onClick={()=>{
|
||||
if('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.getRegistrations()
|
||||
.then((registrations)=>{
|
||||
for(let registration of registrations) {
|
||||
console.log('unregister',registration);
|
||||
registration.unregister();
|
||||
}
|
||||
});
|
||||
}
|
||||
cache().clear();
|
||||
setTimeout(()=>{
|
||||
window.location.reload(true);
|
||||
},200);
|
||||
}}>强制检查更新</a>
|
||||
({process.env.REACT_APP_BUILD_INFO||'---'} {process.env.NODE_ENV} 会自动在后台检查更新并在下次访问时更新)
|
||||
</p>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
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
|
||||
<a href="https://www.gnu.org/licenses/gpl-3.0.zh-cn.html" target="_blank">GNU General Public License</a>
|
||||
for more details.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
class ControlBar extends PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -148,27 +95,7 @@ class ControlBar extends PureComponent {
|
||||
<a className="no-underline control-btn" onClick={()=>{
|
||||
this.props.show_sidebar(
|
||||
'P大树洞',
|
||||
<div>
|
||||
<PromotionBar />
|
||||
<LoginForm show_sidebar={this.props.show_sidebar} />
|
||||
<div className="box list-menu">
|
||||
<a onClick={()=>{this.props.show_sidebar(
|
||||
'设置',
|
||||
<ConfigUI />
|
||||
)}}>
|
||||
<span className="icon icon-settings" /><label>网页版树洞设置</label>
|
||||
</a>
|
||||
|
||||
<a href="http://pkuhelper.pku.edu.cn/treehole_rules.html" target="_blank">
|
||||
<span className="icon icon-textfile" /><label>树洞规范</label>
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/pkuhelper-web/webhole/issues" target="_blank">
|
||||
<span className="icon icon-github" /><label>意见反馈</label>
|
||||
</a>
|
||||
</div>
|
||||
{HELP_TEXT}
|
||||
</div>
|
||||
<InfoSidebar show_sidebar={this.props.show_sidebar} />
|
||||
)
|
||||
}}>
|
||||
<span className={'icon icon-'+(token ? 'about' : 'login')} />
|
||||
@@ -199,13 +126,16 @@ export function Title(props) {
|
||||
<div className="title-bar">
|
||||
<AppSwitcher appid="hole" />
|
||||
<div className="aux-margin">
|
||||
<BalanceShower>
|
||||
<div className="title">
|
||||
<p className="centered-line">
|
||||
<div className="title">
|
||||
<p className="centered-line">
|
||||
<span onClick={()=>props.show_sidebar(
|
||||
'P大树洞',
|
||||
<InfoSidebar show_sidebar={props.show_sidebar} />
|
||||
)}>
|
||||
P大树洞
|
||||
</p>
|
||||
</div>
|
||||
</BalanceShower>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<ControlBar show_sidebar={props.show_sidebar} set_mode={props.set_mode} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user