Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
23 changes: 5 additions & 18 deletions src/commons/Constants.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/incubator/Calendar/__tests__/DateUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down