From fe951a00cc4b7bbf1cee454f652bc15d0cd41388 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 12 Jun 2019 17:18:45 +0200 Subject: Use forceSingleColumn only in automatic layout mode --- app/javascript/flavours/glitch/features/ui/index.js | 4 ++-- app/javascript/flavours/glitch/util/is_mobile.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 9e06e4e56..396da97c7 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -48,7 +48,7 @@ import { GettingStartedMisc, } from 'flavours/glitch/util/async-components'; 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'; // Dummy import, to make sure that ends up in the application bundle. @@ -432,7 +432,7 @@ export default class UI extends React.Component { render () { const { width, draggingOver } = this.state; const { children, layout, isWide, navbarUnder, dropdownMenuIsOpen } = this.props; - const singleColumn = forceSingleColumn || isMobile(width, layout); + const singleColumn = isMobile(width, layout); const redirect = singleColumn ? : ; const columnsClass = layout => { diff --git a/app/javascript/flavours/glitch/util/is_mobile.js b/app/javascript/flavours/glitch/util/is_mobile.js index 80e8e0a8a..db3c8bd80 100644 --- a/app/javascript/flavours/glitch/util/is_mobile.js +++ b/app/javascript/flavours/glitch/util/is_mobile.js @@ -1,4 +1,5 @@ import detectPassiveEvents from 'detect-passive-events'; +import { forceSingleColumn } from 'flavours/glitch/util/initial_state'; const LAYOUT_BREAKPOINT = 630; @@ -9,7 +10,7 @@ export function isMobile(width, columns) { case 'single': return true; default: - return width <= LAYOUT_BREAKPOINT; + return forceSingleColumn || width <= LAYOUT_BREAKPOINT; } }; -- cgit