From 53407396d296ccce09827ab43c15117918f566ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pasteau?= <4895034+ClementPasteau@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:39:21 +0100 Subject: [PATCH] Fix height when switching to mobile design --- .../src/UI/Responsive/ResponsiveWindowMeasurer.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/newIDE/app/src/UI/Responsive/ResponsiveWindowMeasurer.js b/newIDE/app/src/UI/Responsive/ResponsiveWindowMeasurer.js index c29d599f7d5e..7d5294078ae2 100644 --- a/newIDE/app/src/UI/Responsive/ResponsiveWindowMeasurer.js +++ b/newIDE/app/src/UI/Responsive/ResponsiveWindowMeasurer.js @@ -9,9 +9,10 @@ import useOnResize from '../../Utils/UseOnResize'; // Xlarge corresponds to large desktop screens. export type WindowSizeType = 'small' | 'medium' | 'large' | 'xlarge'; const sizeThresholds = { - small: 600, - medium: 1150, - large: 1500, + smallHeight: 500, + smallWidth: 600, + mediumWidth: 1150, + largeWidth: 1500, }; type Props = {| @@ -53,22 +54,22 @@ export const useResponsiveWindowSize = (): { const isLandscape = window.innerWidth > window.innerHeight; - return window.innerWidth < sizeThresholds.small || - window.innerHeight < sizeThresholds.small // Mobile devices can be in landscape mode, so check both width and height. + return window.innerWidth < sizeThresholds.smallWidth || + window.innerHeight < sizeThresholds.smallHeight // Mobile devices can be in landscape mode, so check both width and height. ? { windowSize: 'small', isMobile: true, isMediumScreen: false, isLandscape, } - : window.innerWidth < sizeThresholds.medium + : window.innerWidth < sizeThresholds.mediumWidth ? { windowSize: 'medium', isMobile: false, isMediumScreen: true, isLandscape, } - : window.innerWidth < sizeThresholds.large + : window.innerWidth < sizeThresholds.largeWidth ? { windowSize: 'large', isMobile: false,