Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
717 B · 31 lines
TSX
at commit cbc7cd08
1234567891011121314151617181920212223242526272829303132import React from 'react'import {useKeyboardHandler} from 'react-native-keyboard-controller'import Animated, { useAnimatedStyle, useSharedValue,} from 'react-native-reanimated'
export function KeyboardControllerPadding({maxHeight}: {maxHeight?: number}) { const keyboardHeight = useSharedValue(0)
useKeyboardHandler( { onMove: e => { 'worklet'
if (maxHeight && e.height > maxHeight) { keyboardHeight.value = maxHeight } else { keyboardHeight.value = e.height } }, }, [maxHeight], )
const animatedStyle = useAnimatedStyle(() => ({ height: keyboardHeight.value, }))
return <Animated.View style={animatedStyle} />}