switch to useSafeAreaInsets().top (#85)

StatusBar.currentHeight seems just broken on some devices
This commit is contained in:
austinried
2022-04-04 12:48:10 +09:00
committed by GitHub
parent 9923a8cbcf
commit accb969e73
9 changed files with 49 additions and 51 deletions
+3 -1
View File
@@ -3,11 +3,13 @@ import colors from '@app/styles/colors'
import dimensions from '@app/styles/dimensions'
import React from 'react'
import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
const ImageGradientScrollView: React.FC<ScrollViewProps & ImageGradientBackgroundProps> = props => {
const layout = useWindowDimensions()
const paddingTop = useSafeAreaInsets().top
const minHeight = layout.height - (dimensions.top() + dimensions.bottom())
const minHeight = layout.height - (dimensions.header + paddingTop + dimensions.bottom())
return (
<ScrollView