Bluesky app fork with some witchin' additions 馃挮
witchsky.app
bluesky
fork
client
1import {View} from 'react-native'
2import {KeyboardStickyView} from 'react-native-keyboard-controller'
3import {useSafeAreaInsets} from 'react-native-safe-area-context'
4
5import {atoms as a, useTheme} from '#/alf'
6import {IS_WEB} from '#/env'
7
8export function KeyboardAccessory({children}: {children: React.ReactNode}) {
9 const t = useTheme()
10 const {bottom} = useSafeAreaInsets()
11
12 const style = [
13 a.flex_row,
14 a.py_xs,
15 a.pl_sm,
16 a.pr_xl,
17 a.align_center,
18 a.border_t,
19 t.atoms.border_contrast_medium,
20 t.atoms.bg,
21 ]
22
23 // todo: when iPad support is added, it should also not use the KeyboardStickyView
24 if (IS_WEB) {
25 return <View style={style}>{children}</View>
26 }
27
28 return (
29 <KeyboardStickyView offset={{closed: -bottom}} style={style}>
30 {children}
31 </KeyboardStickyView>
32 )
33}