mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use dimensions hook

Eric Bailey 5c552be2 d7a644e7

+4 -3
+4 -3
src/components/Tooltip/index.tsx
··· 7 7 useRef, 8 8 useState, 9 9 } from 'react' 10 - import {Dimensions, View} from 'react-native' 10 + import {useWindowDimensions, View} from 'react-native' 11 11 import Animated, {Easing, ZoomIn} from 'react-native-reanimated' 12 12 import {useSafeAreaInsets} from 'react-native-safe-area-context' 13 13 ··· 185 185 }) { 186 186 const t = useTheme() 187 187 const insets = useSafeAreaInsets() 188 + const dimensions = useWindowDimensions() 188 189 const [bubbleMeasurements, setBubbleMeasurements] = useState< 189 190 | { 190 191 width: number ··· 203 204 tipLeft: 0, 204 205 } 205 206 206 - const {width: ww, height: wh} = Dimensions.get('window') 207 + const {width: ww, height: wh} = dimensions 207 208 const maxTop = insets.top 208 209 const maxBottom = wh - insets.bottom 209 210 const {width: cw, height: ch} = bubbleMeasurements ··· 273 274 tipTop, 274 275 tipLeft, 275 276 } 276 - }, [position, targetMeasurements, bubbleMeasurements, insets]) 277 + }, [position, targetMeasurements, bubbleMeasurements, insets, dimensions]) 277 278 278 279 const requestCloseWrapped = useCallback(() => { 279 280 setBubbleMeasurements(undefined)