@ -44,8 +44,9 @@ import {
Mutes ,
Mutes ,
PinnedStatuses ,
PinnedStatuses ,
Lists ,
Lists ,
Search ,
} from './util/async-components' ;
} from './util/async-components' ;
import { me } from '../../initial_state' ;
import { me , forceSingleColumn } from '../../initial_state' ;
import { previewState as previewMediaState } from './components/media_modal' ;
import { previewState as previewMediaState } from './components/media_modal' ;
import { previewState as previewVideoState } from './components/video_modal' ;
import { previewState as previewVideoState } from './components/video_modal' ;
@ -62,7 +63,6 @@ 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,7 +101,6 @@ 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 = {
@ -140,7 +139,7 @@ class SwitchingColumnsArea extends React.PureComponent {
}
}
render ( ) {
render ( ) {
const { children , forceSingleColumn } = this . props ;
const { children } = this . props ;
const { mobile } = this . state ;
const { mobile } = this . state ;
const singleColumn = forceSingleColumn || mobile ;
const singleColumn = forceSingleColumn || mobile ;
const redirect = singleColumn ? < Redirect from = '/' to = '/timelines/home' exact / > : < Redirect from = '/' to = '/getting-started' exact / > ;
const redirect = singleColumn ? < Redirect from = '/' to = '/timelines/home' exact / > : < Redirect from = '/' to = '/getting-started' exact / > ;
@ -162,7 +161,7 @@ class SwitchingColumnsArea extends React.PureComponent {
< WrappedRoute path = '/favourites' component = { FavouritedStatuses } content = { children } componentParams = { { shouldUpdateScroll : this . shouldUpdateScroll } } / >
< WrappedRoute path = '/favourites' component = { FavouritedStatuses } content = { children } componentParams = { { shouldUpdateScroll : this . shouldUpdateScroll } } / >
< WrappedRoute path = '/pinned' component = { PinnedStatuses } content = { children } componentParams = { { shouldUpdateScroll : this . shouldUpdateScroll } } / >
< WrappedRoute path = '/pinned' component = { PinnedStatuses } content = { children } componentParams = { { shouldUpdateScroll : this . shouldUpdateScroll } } / >
< WrappedRoute path = '/search' component = { Compose } content = { children } compo nentParams = { { isSearchPage : true } } / >
< WrappedRoute path = '/search' component = { Search } cont ent = { children } / >
< WrappedRoute path = '/statuses/new' component = { Compose } content = { children } / >
< WrappedRoute path = '/statuses/new' component = { Compose } content = { children } / >
< WrappedRoute path = '/statuses/:statusId' exact component = { Status } content = { children } componentParams = { { shouldUpdateScroll : this . shouldUpdateScroll } } / >
< WrappedRoute path = '/statuses/:statusId' exact component = { Status } content = { children } componentParams = { { shouldUpdateScroll : this . shouldUpdateScroll } } / >
@ -207,7 +206,6 @@ 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 = {
@ -456,7 +454,7 @@ class UI extends React.PureComponent {
render ( ) {
render ( ) {
const { draggingOver } = this . state ;
const { draggingOver } = this . state ;
const { children , isComposing , location , dropdownMenuIsOpen , forceSingleColumn } = this . props ;
const { children , isComposing , location , dropdownMenuIsOpen } = this . props ;
const handlers = {
const handlers = {
help : this . handleHotkeyToggleHelp ,
help : this . handleHotkeyToggleHelp ,
@ -482,7 +480,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 } } >
< 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 >