36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
// Metro module 11210 (f11211).
|
|
import { NAV_BAR_HEIGHT_MULTILINE } from "../../../design/components/Navigator/native/NavigatorConstants.native";
|
|
import useSafeAreaInsets_native, { getSafeAreaInsets } from "../../safe_area/useSafeAreaInsets.native";
|
|
import useWindowDimensions_native, { getWindowDimensions } from "../../screen/useWindowDimensions.native";
|
|
import useCustomKeyboardHeight, { getCustomKeyboardHeight } from "../../keyboard/native/useCustomKeyboardHeight";
|
|
export default function useKeyboardActionSheetHeight() {
|
|
const safeAreaInsets_native = useSafeAreaInsets_native();
|
|
const windowDimensions_native = useWindowDimensions_native({
|
|
ignoreKeyboard: true
|
|
});
|
|
const customKeyboardHeight = useCustomKeyboardHeight();
|
|
let maximum = windowDimensions_native.height - NAV_BAR_HEIGHT_MULTILINE - safeAreaInsets_native.top;
|
|
if (customKeyboardHeight >= maximum) {
|
|
maximum = customKeyboardHeight;
|
|
}
|
|
return {
|
|
minimum: customKeyboardHeight,
|
|
maximum
|
|
};
|
|
};
|
|
export function getKeyboardActionSheetHeight() {
|
|
const safeAreaInsets = getSafeAreaInsets();
|
|
const windowDimensions = getWindowDimensions({
|
|
ignoreKeyboard: true
|
|
});
|
|
const customKeyboardHeight = getCustomKeyboardHeight();
|
|
let maximum = windowDimensions.height - NAV_BAR_HEIGHT_MULTILINE - safeAreaInsets.top;
|
|
if (customKeyboardHeight >= maximum) {
|
|
maximum = customKeyboardHeight;
|
|
}
|
|
return {
|
|
minimum: customKeyboardHeight,
|
|
maximum
|
|
};
|
|
}
|