import { setWebviewBack } from '../../../../plugins/navbar';
import { PluginBase } from '../../PluginBase';

export class SetNavbarUrlSchemaDemo extends PluginBase {
  public getPluginShortDesc(): JSX.Element {
    return (
      <div>标题栏URL参数协议场景模拟测试。</div>
    );
  }
  public getPluginFullDesc(): JSX.Element {
    return (
      <div>保证URL参数规则能正常WORK，注意必须是参数key，值为空时不执行对应的逻辑<br />
        1.ntv_bar_float:表示标题栏浮动不占据页面空间 <br />
        2.ntv_login: 表示进入当前页面之前判断是否登录，未登录，先登录再跳转进入页面 <br />
        3.ntv_bar_hidden: 表示进入当前页面不需要显示标题栏 <br />
        4.ntv_webview_new: 表示点击链接打开新窗口 <br />
      </div>
    );
  }
  private webviewBack = () => {
    setWebviewBack();
  }
  public render() {
    return (
      <div className="plugin-page">
        <h2 className="left">{this.props.pluginName}</h2>
        <div className="short-desc">{this.getPluginShortDesc()}</div>
        <div className="full-desc">{this.getPluginFullDesc()}</div>
        <div className="body">
          <div className="play-body-item">
            <button onClick={this.webviewBack}>点击上一级</button>
          </div>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
          <p>其他内容</p>
        </div>
      </div>
    );
  }
}
