From: Emelia Smith Date: Sun, 8 Apr 2018 16:25:08 +0000 (+0200) Subject: Hide search from Compose on mobile devices (#7077) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=0893b1669548858daee79ab1260fb98646a0b3fa;p=mastodon.git 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) --- diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index da5bf7cff..67f0e7981 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -24,9 +24,9 @@ const messages = defineMessages({ logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, }); -const mapStateToProps = state => ({ +const mapStateToProps = (state, ownProps) => ({ 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) @@ -90,7 +90,7 @@ export default class Compose extends React.PureComponent {
{header} - + {(multiColumn || isSearchPage) && }