80 lines
2.9 KiB
TypeScript
80 lines
2.9 KiB
TypeScript
// Metro module 11731 (f11732).
|
|
import * as Module19 from "react";
|
|
import { useMemo, useRef, useCallback } from "react";
|
|
import { StyleSheet } from "react-native";
|
|
import { useChatInputContainerHeight } from "../../../chat_input/native/useChatBottomManagerUIStore";
|
|
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../../_bundle/Module712";
|
|
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
|
|
import useSafeAreaInsetsKeyboardAware_native from "../../../safe_area/useSafeAreaInsetsKeyboardAware.native";
|
|
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
|
|
import useChatPlaceholderAnimatedStyles from "./useChatPlaceholderAnimatedStyles";
|
|
import getChatPlaceholderRowHeight from "./getChatPlaceholderRowHeight";
|
|
import ChatPlaceholderRow from "./ChatPlaceholderRow";
|
|
import ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
|
|
const useStyles = createStyles({
|
|
placeholder: {
|
|
...StyleSheet.absoluteFillObject,
|
|
paddingBottom: Module712.space.PX_24,
|
|
flexDirection: "column-reverse",
|
|
overflow: "hidden"
|
|
}
|
|
});
|
|
const r42 = Module19.memo(function ChatPlaceholder(props) {
|
|
let callback;
|
|
let ref;
|
|
const screenIndex = props.screenIndex;
|
|
callback = void 0;
|
|
const styles = useStyles();
|
|
const chatInputContainerHeight = useChatInputContainerHeight(screenIndex);
|
|
const height = useWindowDimensions_native().height;
|
|
const safeAreaInsets_native = useSafeAreaInsets_native();
|
|
const insets = useSafeAreaInsetsKeyboardAware_native({
|
|
isKeyboardAwareOnAndroid: false,
|
|
includeKeyboardHeight: true
|
|
}).insets;
|
|
const r28 = insets.bottom - safeAreaInsets_native.bottom;
|
|
const r13 = safeAreaInsets_native.top + insets.bottom;
|
|
let c19101_2 = r28;
|
|
let c19101_3 = r13;
|
|
const memo = useMemo(() => ({
|
|
marginBottom: chatInputContainerHeight + c19101_2
|
|
}), [chatInputContainerHeight, r28]);
|
|
ref = void 0;
|
|
ref = useRef([]);
|
|
callback = useCallback((a0) => {
|
|
let r10 = ref.current[a0];
|
|
if (r10 == null) {
|
|
const r16 = Math.floor(3 * Math.random()) + 1;
|
|
ref.current[a0] = r16;
|
|
r10 = r16;
|
|
}
|
|
return r10;
|
|
}, []);
|
|
return <ReanimatedRexport.View style={[styles.placeholder, memo, useChatPlaceholderAnimatedStyles({
|
|
visible: true,
|
|
animated: true
|
|
})]} pointerEvents="none">
|
|
{useMemo(() => {
|
|
const r4 = [];
|
|
let key = 0;
|
|
let r6 = 0;
|
|
while (true) {
|
|
const lines = callback(key);
|
|
r6 = r6 + getChatPlaceholderRowHeight(lines);
|
|
const props = {
|
|
lines
|
|
};
|
|
const r1 = key + 1;
|
|
r4.push(<ChatPlaceholderRow key={key} {...props} />);
|
|
const r26 = height - chatInputContainerHeight - c19101_3;
|
|
key = r1;
|
|
if (!(r6 < r26)) {
|
|
return r4;
|
|
}
|
|
}
|
|
}, [height, r13, chatInputContainerHeight, callback])}
|
|
</ReanimatedRexport.View>;
|
|
});
|
|
export default r42;
|