diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-05-23 01:35:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-23 01:35:22 +0200 |
commit | 9ddeb30f90f9402eb567c88354d4956fcfdf0361 (patch) | |
tree | 9703937600f74b2b859b180baa496b32ac1be3d4 /app/javascript/mastodon/features/ui/components/columns_area.js | |
parent | ca6c93a2f51ce0c9b81d909faa94a5cdb5c25c63 (diff) |
Add `forceSingleColumn` prop to `<UI />` (#10807)
* Move TabsBar rendering logic from CSS to the ColumnsArea component * Add forceSingleColumn mode * Add unread notifications counter to tabs bar * Add toggle to control `forceSingleColumn` * Increase paddings in mobile layout responsively at large sizes
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/columns_area.js')
-rw-r--r-- | app/javascript/mastodon/features/ui/components/columns_area.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js index 63feeac45..47cea3e3a 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.js +++ b/app/javascript/mastodon/features/ui/components/columns_area.js @@ -5,7 +5,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ReactSwipeableViews from 'react-swipeable-views'; -import { links, getIndex, getLink } from './tabs_bar'; +import TabsBar, { links, getIndex, getLink } from './tabs_bar'; import { Link } from 'react-router-dom'; import BundleContainer from '../containers/bundle_container'; @@ -139,7 +139,7 @@ class ColumnsArea extends ImmutablePureComponent { <ColumnLoading title={title} icon={icon} />; return ( - <div className='columns-area' key={index}> + <div className='columns-area columns-area--mobile' key={index}> {view} </div> ); @@ -164,13 +164,17 @@ class ColumnsArea extends ImmutablePureComponent { 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)}><Icon id='pencil' /></Link>; return columnIndex !== -1 ? [ + <TabsBar key='tabs' />, + <ReactSwipeableViews key='content' index={columnIndex} onChangeIndex={this.handleSwipe} onTransitionEnd={this.handleAnimationEnd} animateTransitions={shouldAnimate} springConfig={{ duration: '400ms', delay: '0s', easeFunction: 'ease' }} style={{ height: '100%' }}> {links.map(this.renderView)} </ReactSwipeableViews>, floatingActionButton, ] : [ - <div className='columns-area'>{children}</div>, + <TabsBar key='tabs' />, + + <div key='content' className='columns-area columns-area--mobile'>{children}</div>, floatingActionButton, ]; |