From 8a2c8755b1ee4c361ed38658a2e0556bf4af3cf5 Mon Sep 17 00:00:00 2001 From: Kesha Antonov Date: Tue, 28 Nov 2023 13:34:18 +0300 Subject: [PATCH] fix: set correct dimensions --- src/constants.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 688af63a..c191e40d 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -26,7 +26,12 @@ enum CONTEXT_MENU_STATE { END, } -const { height: WINDOW_HEIGHT, width: WINDOW_WIDTH } = Dimensions.get('screen'); +let { width: WINDOW_WIDTH, height: WINDOW_HEIGHT } = Dimensions.get('screen'); +if (WINDOW_WIDTH > WINDOW_HEIGHT) { + const temp = WINDOW_WIDTH; + WINDOW_WIDTH = WINDOW_HEIGHT; + WINDOW_HEIGHT = temp; +} const MENU_CONTAINER_WIDTH = 100; const MENU_WIDTH = (WINDOW_WIDTH * 60) / 100;