diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-09-11 16:11:26 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-09-11 16:29:46 +0200 |
commit | 65f625cf237feb55a21495606d5e2c258bbe50cc (patch) | |
tree | 827ce1a970939c853a97d53956e307b7a3fad8fe /app/javascript/flavours/glitch/features/ui/components | |
parent | e36f6f48e5091699c74b969e994ce6a15af66068 (diff) |
[Glitch] Hide floating action button on thread views
Port f66a7860291e6b2fef1844b580c22296dbad9202 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/columns_area.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js index f87c078ec..71cb7e8c9 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -30,6 +30,8 @@ const componentMap = { 'LIST': ListTimeline, }; +const shouldHideFAB = path => path.match(/^\/statuses\//); + const messages = defineMessages({ publish: { id: 'compose_form.publish', defaultMessage: 'Toot' }, }); @@ -158,7 +160,7 @@ export default class ColumnsArea extends ImmutablePureComponent { this.pendingIndex = null; if (singleColumn) { - const floatingActionButton = this.context.router.history.location.pathname === '/statuses/new' ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}><i className='fa fa-pencil' /></Link>; + const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}><i className='fa fa-pencil' /></Link>; return columnIndex !== -1 ? [ <ReactSwipeableViews key='content' index={columnIndex} onChangeIndex={this.handleSwipe} onTransitionEnd={this.handleAnimationEnd} animateTransitions={shouldAnimate} springConfig={{ duration: '400ms', delay: '0s', easeFunction: 'ease' }} style={{ height: '100%' }}> |