mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
switch to useSafeAreaInsets().top (#85)
StatusBar.currentHeight seems just broken on some devices
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user