This commit is contained in:
thuhole
2020-07-21 17:35:15 +08:00
parent 7636e45c00
commit 98881eca9a
17 changed files with 4541 additions and 3621 deletions

View File

@@ -1,4 +1,4 @@
import React, { Component, PureComponent } from 'react';
import React, { PureComponent } from 'react';
// import {AppSwitcher} from './infrastructure/widgets';
import { InfoSidebar, PostForm } from './UserAction';
import { TokenCtx } from './UserAction';
@@ -67,7 +67,11 @@ class ControlBar extends PureComponent {
return;
}
const mode = this.state.search_text.startsWith('#') ? 'single' : 'search';
const mode = this.state.search_text.startsWith('#')
? 'single'
: this.props.mode !== 'attention'
? 'search'
: 'attention';
this.set_mode(mode, this.state.search_text || '');
}
}
@@ -112,7 +116,9 @@ class ControlBar extends PureComponent {
<input
className="control-search"
value={this.state.search_text}
placeholder="搜索 或 #树洞号"
placeholder={`${
this.props.mode === 'attention' ? '在关注列表中' : ''
}搜索 或 #PID`}
onChange={this.on_change_bound}
onKeyPress={this.on_keypress_bound}
/>