diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-08-31 13:54:25 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-08-31 18:33:46 +0200 |
commit | 37a00d4c1dd3aa1b66f60d296fa71fa3201a32da (patch) | |
tree | f2322425fbee51095cc8873c749b22dbc2f4d643 | |
parent | 76a3f373e3bfa94df13272aed9b92a50ed912928 (diff) |
[Glitch] Add search item to tab bar for mobile devices
Port c9cbb8de703e321c0d152813a2e22471ffe5eef7 to glitch-soc
3 files changed, 6 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index 1679e9a4b..eb051ba42 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -86,6 +86,7 @@ class Drawer extends React.Component { searchHidden, searchValue, submitted, + isSearchPage, } = this.props; const computedClass = classNames('drawer', `mbstobon-${elefriend}`); @@ -110,7 +111,7 @@ class Drawer extends React.Component { /> <div className='contents'> <DrawerAccount account={account} /> - <Composer /> + {!isSearchPage && <Composer />} {multiColumn && <button className='mastodon' onClick={onClickElefriend} />} <DrawerResults results={results} @@ -126,6 +127,7 @@ class Drawer extends React.Component { // Props. Drawer.propTypes = { intl: PropTypes.object.isRequired, + isSearchPage: PropTypes.bool, multiColumn: PropTypes.bool, // State props. diff --git a/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js b/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js index 93a74faae..3bc757643 100644 --- a/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js +++ b/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js @@ -8,6 +8,7 @@ import { isUserTouching } from 'flavours/glitch/util/is_mobile'; export const links = [ <NavLink className='tabs-bar__link primary' to='/timelines/home' data-preview-title-id='column.home' data-preview-icon='home' ><i className='fa fa-fw fa-home' /><FormattedMessage id='tabs_bar.home' defaultMessage='Home' /></NavLink>, <NavLink className='tabs-bar__link primary' to='/notifications' data-preview-title-id='column.notifications' data-preview-icon='bell' ><i className='fa fa-fw fa-bell' /><FormattedMessage id='tabs_bar.notifications' defaultMessage='Notifications' /></NavLink>, + <NavLink className='tabs-bar__link primary' to='/search' data-preview-title-id='tabs_bar.search' data-preview-icon='bell' ><i className='fa fa-fw fa-search' /><FormattedMessage id='tabs_bar.search' defaultMessage='Search' /></NavLink>, <NavLink className='tabs-bar__link secondary' to='/timelines/public/local' data-preview-title-id='column.community' data-preview-icon='users' ><i className='fa fa-fw fa-users' /><FormattedMessage id='tabs_bar.local_timeline' defaultMessage='Local' /></NavLink>, <NavLink className='tabs-bar__link secondary' exact to='/timelines/public' data-preview-title-id='column.public' data-preview-icon='globe' ><i className='fa fa-fw fa-globe' /><FormattedMessage id='tabs_bar.federated_timeline' defaultMessage='Federated' /></NavLink>, diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index d58e11b55..1cff94321 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -437,6 +437,8 @@ export default class UI extends React.Component { <WrappedRoute path='/bookmarks' component={BookmarkedStatuses} content={children} /> <WrappedRoute path='/pinned' component={PinnedStatuses} content={children} /> + <WrappedRoute path='/search' component={Drawer} content={children} componentParams={{ isSearchPage: true }} /> + <WrappedRoute path='/statuses/new' component={Drawer} content={children} /> <WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} /> <WrappedRoute path='/statuses/:statusId/reblogs' component={Reblogs} content={children} /> |