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