@ -7,7 +7,6 @@ import { Redirect, withRouter } from 'react-router-dom';
import PropTypes from 'prop-types' ;
import PropTypes from 'prop-types' ;
import NotificationsContainer from './containers/notifications_container' ;
import NotificationsContainer from './containers/notifications_container' ;
import LoadingBarContainer from './containers/loading_bar_container' ;
import LoadingBarContainer from './containers/loading_bar_container' ;
import TabsBar from './components/tabs_bar' ;
import ModalContainer from './containers/modal_container' ;
import ModalContainer from './containers/modal_container' ;
import { isMobile } from '../../is_mobile' ;
import { isMobile } from '../../is_mobile' ;
import { debounce } from 'lodash' ;
import { debounce } from 'lodash' ;
@ -63,6 +62,7 @@ const mapStateToProps = state => ({
hasComposingText : state . getIn ( [ 'compose' , 'text' ] ) . trim ( ) . length !== 0 ,
hasComposingText : state . getIn ( [ 'compose' , 'text' ] ) . trim ( ) . length !== 0 ,
hasMediaAttachments : state . getIn ( [ 'compose' , 'media_attachments' ] ) . size > 0 ,
hasMediaAttachments : state . getIn ( [ 'compose' , 'media_attachments' ] ) . size > 0 ,
dropdownMenuIsOpen : state . getIn ( [ 'dropdown_menu' , 'openId' ] ) !== null ,
dropdownMenuIsOpen : state . getIn ( [ 'dropdown_menu' , 'openId' ] ) !== null ,
forceSingleColumn : state . getIn ( [ 'settings' , 'forceSingleColumn' ] , false ) ,
} ) ;
} ) ;
const keyMap = {
const keyMap = {
@ -101,6 +101,7 @@ class SwitchingColumnsArea extends React.PureComponent {
children : PropTypes . node ,
children : PropTypes . node ,
location : PropTypes . object ,
location : PropTypes . object ,
onLayoutChange : PropTypes . func . isRequired ,
onLayoutChange : PropTypes . func . isRequired ,
forceSingleColumn : PropTypes . bool ,
} ;
} ;
state = {
state = {
@ -139,12 +140,13 @@ class SwitchingColumnsArea extends React.PureComponent {
}
}
render ( ) {
render ( ) {
const { children } = this . props ;
const { children , forceSingleColumn } = this . props ;
const { mobile } = this . state ;
const { mobile } = this . state ;
const redirect = mobile ? < Redirect from = '/' to = '/timelines/home' exact / > : < Redirect from = '/' to = '/getting-started' exact / > ;
const singleColumn = forceSingleColumn || mobile ;
const redirect = singleColumn ? < Redirect from = '/' to = '/timelines/home' exact / > : < Redirect from = '/' to = '/getting-started' exact / > ;
return (
return (
< ColumnsAreaContainer ref = { this . setRef } singleColumn = { mobile } >
< ColumnsAreaContainer ref = { this . setRef } singleColumn = { singleColumn } >
< WrappedSwitch >
< WrappedSwitch >
{ redirect }
{ redirect }
< WrappedRoute path = '/getting-started' component = { GettingStarted } content = { children } / >
< WrappedRoute path = '/getting-started' component = { GettingStarted } content = { children } / >
@ -205,6 +207,7 @@ class UI extends React.PureComponent {
location : PropTypes . object ,
location : PropTypes . object ,
intl : PropTypes . object . isRequired ,
intl : PropTypes . object . isRequired ,
dropdownMenuIsOpen : PropTypes . bool ,
dropdownMenuIsOpen : PropTypes . bool ,
forceSingleColumn : PropTypes . bool ,
} ;
} ;
state = {
state = {
@ -453,7 +456,7 @@ class UI extends React.PureComponent {
render ( ) {
render ( ) {
const { draggingOver } = this . state ;
const { draggingOver } = this . state ;
const { children , isComposing , location , dropdownMenuIsOpen } = this . props ;
const { children , isComposing , location , dropdownMenuIsOpen , forceSingleColumn } = this . props ;
const handlers = {
const handlers = {
help : this . handleHotkeyToggleHelp ,
help : this . handleHotkeyToggleHelp ,
@ -479,9 +482,7 @@ class UI extends React.PureComponent {
return (
return (
< HotKeys keyMap = { keyMap } handlers = { handlers } ref = { this . setHotkeysRef } attach = { window } focused >
< HotKeys keyMap = { keyMap } handlers = { handlers } ref = { this . setHotkeysRef } attach = { window } focused >
< div className = { classNames ( 'ui' , { 'is-composing' : isComposing } ) } ref = { this . setRef } style = { { pointerEvents : dropdownMenuIsOpen ? 'none' : null } } >
< div className = { classNames ( 'ui' , { 'is-composing' : isComposing } ) } ref = { this . setRef } style = { { pointerEvents : dropdownMenuIsOpen ? 'none' : null } } >
< TabsBar / >
< SwitchingColumnsArea location = { location } onLayoutChange = { this . handleLayoutChange } forceSingleColumn = { forceSingleColumn } >
< SwitchingColumnsArea location = { location } onLayoutChange = { this . handleLayoutChange } >
{ children }
{ children }
< / S w i t c h i n g C o l u m n s A r e a >
< / S w i t c h i n g C o l u m n s A r e a >