forked from newthuhole/hole_thu_frontend
add pwa promotion bar
This commit is contained in:
@@ -94,4 +94,15 @@ export class SafeTextarea extends Component {
|
||||
<textarea ref={this.area_ref} onChange={this.on_change_bound} value={this.state.text} />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function PromotionBar(props) {
|
||||
const is_ios=/iPhone|iPad|iPod/i.test(window.navigator.userAgent);
|
||||
// noinspection JSConstructorReturnsPrimitive
|
||||
return is_ios ? (
|
||||
<div className="box promotion-bar">
|
||||
<span className="icon icon-about" />
|
||||
在 Safari 中将本网站 <b>添加到主屏幕</b> 更好用哦
|
||||
</div>
|
||||
) : null;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, {Component, PureComponent} from 'react';
|
||||
import {LoginForm, PostForm} from './UserAction';
|
||||
import {TokenCtx} from './UserAction';
|
||||
import {PromotionBar} from './Common';
|
||||
|
||||
import './Title.css';
|
||||
|
||||
@@ -114,6 +115,7 @@ class ControlBar extends PureComponent {
|
||||
this.props.show_sidebar(
|
||||
'P大树洞(非官方)网页版',
|
||||
<div>
|
||||
<PromotionBar />
|
||||
<LoginForm />
|
||||
{HELP_TEXT}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user