@@ -7,7 +7,6 @@ import { Redirect, withRouter } from 'react-router-dom';
77import PropTypes from 'prop-types' ;
88import NotificationsContainer from './containers/notifications_container' ;
99import LoadingBarContainer from './containers/loading_bar_container' ;
10- import TabsBar from './components/tabs_bar' ;
1110import ModalContainer from './containers/modal_container' ;
1211import { isMobile } from '../../is_mobile' ;
1312import { debounce } from 'lodash' ;
@@ -63,6 +62,7 @@ const mapStateToProps = state => ({
6362 hasComposingText : state . getIn ( [ 'compose' , 'text' ] ) . trim ( ) . length !== 0 ,
6463 hasMediaAttachments : state . getIn ( [ 'compose' , 'media_attachments' ] ) . size > 0 ,
6564 dropdownMenuIsOpen : state . getIn ( [ 'dropdown_menu' , 'openId' ] ) !== null ,
65+ forceSingleColumn : state . getIn ( [ 'settings' , 'forceSingleColumn' ] , false ) ,
6666} ) ;
6767
6868const keyMap = {
@@ -101,6 +101,7 @@ class SwitchingColumnsArea extends React.PureComponent {
101101 children : PropTypes . node ,
102102 location : PropTypes . object ,
103103 onLayoutChange : PropTypes . func . isRequired ,
104+ forceSingleColumn : PropTypes . bool ,
104105 } ;
105106
106107 state = {
@@ -139,12 +140,13 @@ class SwitchingColumnsArea extends React.PureComponent {
139140 }
140141
141142 render ( ) {
142- const { children } = this . props ;
143+ const { children, forceSingleColumn } = this . props ;
143144 const { mobile } = this . state ;
144- const redirect = mobile ? < Redirect from = '/' to = '/timelines/home' exact /> : < Redirect from = '/' to = '/getting-started' exact /> ;
145+ const singleColumn = forceSingleColumn || mobile ;
146+ const redirect = singleColumn ? < Redirect from = '/' to = '/timelines/home' exact /> : < Redirect from = '/' to = '/getting-started' exact /> ;
145147
146148 return (
147- < ColumnsAreaContainer ref = { this . setRef } singleColumn = { mobile } >
149+ < ColumnsAreaContainer ref = { this . setRef } singleColumn = { singleColumn } >
148150 < WrappedSwitch >
149151 { redirect }
150152 < WrappedRoute path = '/getting-started' component = { GettingStarted } content = { children } />
@@ -205,6 +207,7 @@ class UI extends React.PureComponent {
205207 location : PropTypes . object ,
206208 intl : PropTypes . object . isRequired ,
207209 dropdownMenuIsOpen : PropTypes . bool ,
210+ forceSingleColumn : PropTypes . bool ,
208211 } ;
209212
210213 state = {
@@ -453,7 +456,7 @@ class UI extends React.PureComponent {
453456
454457 render ( ) {
455458 const { draggingOver } = this . state ;
456- const { children, isComposing, location, dropdownMenuIsOpen } = this . props ;
459+ const { children, isComposing, location, dropdownMenuIsOpen, forceSingleColumn } = this . props ;
457460
458461 const handlers = {
459462 help : this . handleHotkeyToggleHelp ,
@@ -479,9 +482,7 @@ class UI extends React.PureComponent {
479482 return (
480483 < HotKeys keyMap = { keyMap } handlers = { handlers } ref = { this . setHotkeysRef } attach = { window } focused >
481484 < div className = { classNames ( 'ui' , { 'is-composing' : isComposing } ) } ref = { this . setRef } style = { { pointerEvents : dropdownMenuIsOpen ? 'none' : null } } >
482- < TabsBar />
483-
484- < SwitchingColumnsArea location = { location } onLayoutChange = { this . handleLayoutChange } >
485+ < SwitchingColumnsArea location = { location } onLayoutChange = { this . handleLayoutChange } forceSingleColumn = { forceSingleColumn } >
485486 { children }
486487 </ SwitchingColumnsArea >
487488
0 commit comments