mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-13 14:45:12 +01:00
Use forceSingleColumn only in automatic layout mode
This commit is contained in:
parent
47307e6c13
commit
b191861e15
@ -48,7 +48,7 @@ import {
|
|||||||
GettingStartedMisc,
|
GettingStartedMisc,
|
||||||
} from 'flavours/glitch/util/async-components';
|
} from 'flavours/glitch/util/async-components';
|
||||||
import { HotKeys } from 'react-hotkeys';
|
import { HotKeys } from 'react-hotkeys';
|
||||||
import { me, forceSingleColumn } from 'flavours/glitch/util/initial_state';
|
import { me } from 'flavours/glitch/util/initial_state';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
// Dummy import, to make sure that <Status /> ends up in the application bundle.
|
// Dummy import, to make sure that <Status /> ends up in the application bundle.
|
||||||
@ -432,7 +432,7 @@ export default class UI extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
const { width, draggingOver } = this.state;
|
const { width, draggingOver } = this.state;
|
||||||
const { children, layout, isWide, navbarUnder, dropdownMenuIsOpen } = this.props;
|
const { children, layout, isWide, navbarUnder, dropdownMenuIsOpen } = this.props;
|
||||||
const singleColumn = forceSingleColumn || isMobile(width, layout);
|
const singleColumn = isMobile(width, layout);
|
||||||
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 />;
|
||||||
|
|
||||||
const columnsClass = layout => {
|
const columnsClass = layout => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import detectPassiveEvents from 'detect-passive-events';
|
import detectPassiveEvents from 'detect-passive-events';
|
||||||
|
import { forceSingleColumn } from 'flavours/glitch/util/initial_state';
|
||||||
|
|
||||||
const LAYOUT_BREAKPOINT = 630;
|
const LAYOUT_BREAKPOINT = 630;
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ export function isMobile(width, columns) {
|
|||||||
case 'single':
|
case 'single':
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return width <= LAYOUT_BREAKPOINT;
|
return forceSingleColumn || width <= LAYOUT_BREAKPOINT;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user