Use <Modal> for Composer (#3588)
* use <Modal> to display composer * trigger `onPressCancel` on modal cancel * remove android top padding * use light statusbar on ios * use KeyboardStickyView from r-n-keyboard-controller * make extra bottom padding ios-only * make cancelRef optional * scope legacy modals * don't change bg color on ios * use fullScreen instead of formSheet * adjust padding on keyboardaccessory to account for new buttons * Revert "use KeyboardStickyView from r-n-keyboard-controller" This reverts commit426c812904. * fix insets * tweaks and merge * revert89f51c72* nit * import keyboard provider --------- Co-authored-by: Hailey <me@haileyok.com> Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {KeyboardStickyView} from 'react-native-keyboard-controller'
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
|
||||
export function KeyboardAccessory({children}: {children: React.ReactNode}) {
|
||||
const t = useTheme()
|
||||
const {bottom} = useSafeAreaInsets()
|
||||
|
||||
const style = [
|
||||
a.flex_row,
|
||||
a.py_xs,
|
||||
a.pl_sm,
|
||||
a.pr_xl,
|
||||
a.align_center,
|
||||
a.border_t,
|
||||
t.atoms.border_contrast_medium,
|
||||
t.atoms.bg,
|
||||
]
|
||||
|
||||
// todo: when iPad support is added, it should also not use the KeyboardStickyView
|
||||
if (isWeb) {
|
||||
return <View style={style}>{children}</View>
|
||||
}
|
||||
|
||||
return (
|
||||
<KeyboardStickyView offset={{closed: -bottom}} style={style}>
|
||||
{children}
|
||||
</KeyboardStickyView>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user