67 lines
3.2 KiB
TypeScript
67 lines
3.2 KiB
TypeScript
// Metro module 9352 (f9353).
|
|
import { useMemo } from "react";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
|
|
import { useReanimatedKeyboardAnimation } from "../../../_bundle/Module1595";
|
|
import { useKeyboardTypeSharedValue } from "./useKeyboardType";
|
|
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
|
|
import ReanimatedRexport, { useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
|
|
import * as _KeyboardTypes from "./KeyboardTypes";
|
|
import * as _ConstantsIOS from "../../../ConstantsIOS";
|
|
import { PortalHost } from "../../../_bundle/Module4060";
|
|
const useStyles = createStyles({
|
|
keyboardStickyFooter: {
|
|
position: "absolute",
|
|
bottom: 0,
|
|
left: 0,
|
|
right: 0,
|
|
zIndex: 1,
|
|
flex: 1,
|
|
backgroundColor: Module712.colors.MOBILE_KEYBOARD_PANEL_BACKGROUND
|
|
}
|
|
});
|
|
const __initData = {
|
|
code: "function PortalKeyboardFooterIOSIosTsx1(){const{interpolate,progress,bottom,followSystemKeyboard,keyboardType,KeyboardTypes,animatedSheetIndex,height,EXPRESSION_FOOTER_HEIGHT}=this.__closure;const offset=interpolate(progress.get(),[0,1],[0,bottom]);const shouldFollowKeyboard=followSystemKeyboard||keyboardType.get()===KeyboardTypes.EXPRESSION;if(shouldFollowKeyboard&&animatedSheetIndex.get()>=0){return{transform:[{translateY:height.get()+offset}]};}return{transform:[{translateY:interpolate(animatedSheetIndex.get(),[-1,0],[EXPRESSION_FOOTER_HEIGHT+bottom,0],'clamp')}]};}"
|
|
};
|
|
export default function PortalKeyboardFooterIOS(props) {
|
|
let animatedStyle;
|
|
const { animatedSheetIndex, portalHostName = "expression-footer", followSystemKeyboard = false } = props;
|
|
let c17171_1 = followSystemKeyboard;
|
|
animatedStyle = void 0;
|
|
const styles = useStyles();
|
|
const bottom = useSafeAreaInsets_native().bottom;
|
|
const reanimatedKeyboardAnimation = useReanimatedKeyboardAnimation();
|
|
const { height, progress } = reanimatedKeyboardAnimation;
|
|
const keyboardTypeSharedValue = useKeyboardTypeSharedValue();
|
|
const S = function S() {
|
|
const r22 = _ReanimatedRexport.interpolate(progress.get(), [0, 1], [0, bottom]);
|
|
return !(!c17171_1 && keyboardTypeSharedValue.get() !== _KeyboardTypes.KeyboardTypes.EXPRESSION) && animatedSheetIndex.get() >= 0 ? {
|
|
transform: [{
|
|
translateY: height.get() + r22
|
|
}]
|
|
} : {
|
|
transform: [{
|
|
translateY: _ReanimatedRexport.interpolate(animatedSheetIndex.get(), [-1, 0], [_ConstantsIOS.EXPRESSION_FOOTER_HEIGHT + bottom, 0], "clamp")
|
|
}]
|
|
};
|
|
};
|
|
S.__closure = {
|
|
interpolate: _ReanimatedRexport.interpolate,
|
|
progress,
|
|
bottom,
|
|
followSystemKeyboard,
|
|
keyboardType: keyboardTypeSharedValue,
|
|
KeyboardTypes: _KeyboardTypes.KeyboardTypes,
|
|
animatedSheetIndex,
|
|
height,
|
|
EXPRESSION_FOOTER_HEIGHT: _ConstantsIOS.EXPRESSION_FOOTER_HEIGHT
|
|
};
|
|
S.__workletHash = 9444646970651;
|
|
S.__initData = __initData;
|
|
animatedStyle = useAnimatedStyle(S);
|
|
return <ReanimatedRexport.View style={useMemo(() => [styles.keyboardStickyFooter, animatedStyle], [animatedStyle, styles])}>
|
|
<PortalHost name={portalHostName} />
|
|
</ReanimatedRexport.View>;
|
|
};
|