Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

It needs to fit iPhone14pro #47

Open
JonsonHI opened this issue Sep 20, 2022 · 2 comments
Open

It needs to fit iPhone14pro #47

JonsonHI opened this issue Sep 20, 2022 · 2 comments

Comments

@JonsonHI
Copy link

/index.js
|| (dimen.height === 852 || dimen.width === 852)
|| (dimen.height === 932 || dimen.width === 932)

@MariusCatanoiu
Copy link

MariusCatanoiu commented Sep 23, 2022

Complementary to this, I would add a condition for Dynamic Island height.
So, this should be the needs.

/index.js
|| (dimen.height === 852 || dimen.width === 852)
|| (dimen.height === 932 || dimen.width === 932)
export function getStatusBarHeight(safe) {
	const deviceModel = DeviceInfo.getModel();
	const isIphone14Pro = ['iPhone 14 Pro','iPhone 14 Pro Max'].includes(deviceModel);
    return Platform.select({
        ios: ifIphoneX(safe || isIphone14Pro ? 44 : 30, 20),
        android: StatusBar.currentHeight,
        default: 0
    });
}

of course, we need react-native-device-info and patch-package

@RZulfikri
Copy link

#45

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants