Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle notch #154

Merged
merged 17 commits into from
Jul 26, 2022
Merged

feat: handle notch #154

merged 17 commits into from
Jul 26, 2022

Conversation

mjaskowska
Copy link
Contributor

@mjaskowska mjaskowska commented Jul 7, 2022

closes #140

@mjaskowska mjaskowska marked this pull request as draft July 7, 2022 12:01
@mjaskowska mjaskowska marked this pull request as ready for review July 12, 2022 10:07
Comment on lines 21 to 28
useEffect(() => {
if (Platform.OS !== 'ios') return setBarHeight(StatusBar.currentHeight ?? 0)
// handling edge case when app is opened in landscape mode and barHeight = 0
StatusBarManager.getHeight(({ height }: { height: number }) =>
setBarHeight(isPortaitMode && height !== 0 ? height : 50)
)
}, [StatusBarManager, isPortaitMode])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about extracting this logic to sth like useStatusBarHeightDetector

@danielmark0116 danielmark0116 merged commit 234f89f into master Jul 26, 2022
@danielmark0116 danielmark0116 deleted the feat/handle-notch branch July 26, 2022 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop react-native-device-info for react-native-safe-area-context[FEATURE]
2 participants