ptelad / react-native-iphone-x-helper

A library to help you design your react-native app for notched iPhones
MIT License
942 stars 138 forks source link

It needs to fit iPhone14pro #47

Open JonsonHI opened 2 years ago

JonsonHI commented 2 years ago

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

MariusCatanoiu commented 2 years ago

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 commented 2 years ago

https://github.com/ptelad/react-native-iphone-x-helper/pull/45