From 0222884dfea8ea7a79ae435f112ec7266842a53a Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Thu, 18 Apr 2024 18:50:40 -0400 Subject: [PATCH] Update useIsLargeScreen.ts --- hooks/useIsLargeScreen.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hooks/useIsLargeScreen.ts b/hooks/useIsLargeScreen.ts index a4e8ffbb3..b3183a2f1 100644 --- a/hooks/useIsLargeScreen.ts +++ b/hooks/useIsLargeScreen.ts @@ -1,7 +1,6 @@ import { useState, useEffect, useMemo } from 'react'; import { Dimensions } from 'react-native'; import { isTablet } from 'react-native-device-info'; -import { isDesktop } from '../blue_modules/environment'; // Custom hook to determine if the screen is large export const useIsLargeScreen = () => { @@ -28,12 +27,12 @@ export const useIsLargeScreen = () => { // Determine if the window width is at least half of the screen width const isLargeScreen = useMemo(() => { - // we dont want to return true on phones. only on tablets and desktops - const isTabletOrDesktop = isTablet() || isDesktop; + // we dont want to return true on phones. only on tablets for now + const isRunningOnTablet = isTablet(); const halfScreenWidth = windowWidth >= screenWidth / 2; - const condition = isTabletOrDesktop && halfScreenWidth; + const condition = isRunningOnTablet && halfScreenWidth; console.log( - `Window width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet or desktop: ${isTabletOrDesktop}, Is large screen: ${condition}`, + `Window width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet or desktop: ${isRunningOnTablet}, Is large screen: ${condition}`, ); return condition; }, [windowWidth, screenWidth]);