mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
@@ -7,6 +7,10 @@ export interface ModalConfig {
|
||||
* return a function to handle close/unmount callback
|
||||
*/
|
||||
onOpen?: () => OnClose;
|
||||
/**
|
||||
* For mobile
|
||||
*/
|
||||
dynamicKeyboardHeight?: string | number;
|
||||
}
|
||||
export const ModalConfigContext = createContext<ModalConfig>({});
|
||||
|
||||
|
||||
@@ -131,7 +131,8 @@ function createContainer() {
|
||||
|
||||
export const ModalInner = forwardRef<HTMLDivElement, ModalProps>(
|
||||
(props, ref) => {
|
||||
const { onOpen: modalConfigOnOpen } = useContext(ModalConfigContext);
|
||||
const { onOpen: modalConfigOnOpen, dynamicKeyboardHeight } =
|
||||
useContext(ModalConfigContext);
|
||||
const {
|
||||
modal,
|
||||
portalOptions,
|
||||
@@ -243,7 +244,7 @@ export const ModalInner = forwardRef<HTMLDivElement, ModalProps>(
|
||||
>
|
||||
<SafeArea
|
||||
bottom={BUILD_CONFIG.isMobileEdition}
|
||||
bottomOffset={12}
|
||||
bottomOffset={dynamicKeyboardHeight ?? 12}
|
||||
data-full-screen={fullScreen}
|
||||
data-modal={modal}
|
||||
className={clsx(
|
||||
|
||||
Reference in New Issue
Block a user