diff --git a/.node-version b/.node-version index 25bf17fc5a..2edeafb09d 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18 \ No newline at end of file +20 \ No newline at end of file diff --git a/src/commons/Constants.ts b/src/commons/Constants.ts index 07f77867c0..8a3c42eadd 100644 --- a/src/commons/Constants.ts +++ b/src/commons/Constants.ts @@ -1,11 +1,4 @@ -import { - Platform, - Dimensions, - NativeModules, - I18nManager, - AccessibilityInfo, - AccessibilityChangeEvent -} from 'react-native'; +import {Platform, Dimensions, I18nManager, AccessibilityInfo, AccessibilityChangeEvent, StatusBar} from 'react-native'; export enum orientations { PORTRAIT = 'portrait', @@ -34,17 +27,11 @@ let breakpoints: Breakpoint[]; let defaultMargin = 0; const isSubWindow = windowWidth < screenWidth; -//@ts-ignore -isTablet = Platform.isPad || (getAspectRatio() < 1.6 && Math.max(screenWidth, screenHeight) >= 900); +isTablet = + (Platform.OS === 'ios' && Platform.isPad) || (getAspectRatio() < 1.6 && Math.max(screenWidth, screenHeight) >= 900); function setStatusBarHeight() { - const {StatusBarManager} = NativeModules; - statusBarHeight = StatusBarManager?.HEIGHT || 0; // So there will be a value for any case - - if (isIOS) { - // override guesstimate height with the actual height from StatusBarManager - StatusBarManager.getHeight((data:{height:number}) => (statusBarHeight = data.height)); - } + statusBarHeight = StatusBar.currentHeight || 0; // So there will be a value for any case } function getAspectRatio() { @@ -125,7 +112,7 @@ const constants = { return screenHeight <= 600; }, get isWideScreen() { - return isTablet && !isSubWindow || this.isLandscape; + return (isTablet && !isSubWindow) || this.isLandscape; }, get screenAspectRatio() { return getAspectRatio(); diff --git a/src/incubator/Calendar/__tests__/DateUtils.spec.ts b/src/incubator/Calendar/__tests__/DateUtils.spec.ts index 344e56c986..75b6237a41 100644 --- a/src/incubator/Calendar/__tests__/DateUtils.spec.ts +++ b/src/incubator/Calendar/__tests__/DateUtils.spec.ts @@ -322,7 +322,7 @@ describe('Calendar/DateUtils', () => { }); it('should return true for same dates using timestamps', () => { - expect(DateUtils.isSameDay(1673442316000, 1673463916000)).toBe(true); + expect(DateUtils.isSameDay(1673442316000, 1673442316000)).toBe(true); }); it('should return false for different dates using Date objects', () => {