mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-23 21:15:05 +01:00
Hide search from Compose on mobile devices (#7077)
* Hide search from Compose on mobile devices We're presently seeing large numbers of users accidentally tooting what they're trying to search for. This PR hides the search form from the Compose view, now that we have a dedicated "search" tab on mobile. * Don't "showSearch" on mobile if we're not currently searching (isSearchPage)
This commit is contained in:
parent
c9cbb8de70
commit
0893b16695
@ -24,9 +24,9 @@ const messages = defineMessages({
|
|||||||
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
|
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = (state, ownProps) => ({
|
||||||
columns: state.getIn(['settings', 'columns']),
|
columns: state.getIn(['settings', 'columns']),
|
||||||
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : ownProps.isSearchPage,
|
||||||
});
|
});
|
||||||
|
|
||||||
@connect(mapStateToProps)
|
@connect(mapStateToProps)
|
||||||
@ -90,7 +90,7 @@ export default class Compose extends React.PureComponent {
|
|||||||
<div className='drawer'>
|
<div className='drawer'>
|
||||||
{header}
|
{header}
|
||||||
|
|
||||||
<SearchContainer />
|
{(multiColumn || isSearchPage) && <SearchContainer /> }
|
||||||
|
|
||||||
<div className='drawer__pager'>
|
<div className='drawer__pager'>
|
||||||
<div className='drawer__inner' onFocus={this.onFocus}>
|
<div className='drawer__inner' onFocus={this.onFocus}>
|
||||||
|
Loading…
Reference in New Issue
Block a user