Skip to content

Commit 83f33f2

Browse files
authored
Add isWideScreen and fix types location (#1827)
1 parent c8b03e1 commit 83f33f2

File tree

4 files changed

+5
-39
lines changed

4 files changed

+5
-39
lines changed

generatedTypes/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export {default as Avatar, AvatarProps} from './src/components/avatar';
2929
export {default as Badge, BadgeProps} from './src/components/badge';
3030
export {default as Card, CardProps, CardSectionProps, CardSelectionOptions} from './src/components/card';
3131
export {default as ConnectionStatusBar, ConnectionStatusBarProps} from './src/components/connectionStatusBar';
32-
export {default as Constants} from './src/helpers/Constants';
32+
export {default as Constants} from './src/commons/Constants';
3333
export {default as GradientSlider, GradientSliderProps} from './src/components/slider/GradientSlider';
3434
export {default as View, ViewProps} from './src/components/view';
3535
export {default as Text, TextProps} from './src/components/text';

generatedTypes/src/commons/Constants.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ declare const constants: {
2020
readonly isShortScreen: boolean;
2121
readonly screenAspectRatio: number;
2222
isTablet: boolean;
23+
readonly isWideScreen: boolean;
2324
getSafeAreaInsets: () => {
2425
left: number;
2526
right: number;

generatedTypes/src/helpers/Constants.d.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/commons/Constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ const constants = {
110110
set isTablet(value: boolean) {
111111
isTablet = value;
112112
},
113+
get isWideScreen() {
114+
return isTablet || this.isLandscape;
115+
},
113116
getSafeAreaInsets: () => {
114117
const orientation = getOrientation(screenHeight, screenWidth);
115118
return orientation === orientations.LANDSCAPE

0 commit comments

Comments
 (0)