Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const [{ background, flex }] = useStyles()
const { dispatch } = useNavigation()
useReadEffect(params.convId, 1000)
const conv = useConversation(params?.convId)
const { t } = useTranslation()
const ctx = useMsgrContext()
const insets = useSafeAreaInsets()
const lastInte = useLastConvInteraction(params?.convId || '')
const lastUpdate = conv?.lastUpdate || lastInte?.sentDate || conv?.createdDate || null
const [stickyDate, setStickyDate] = useState(lastUpdate || null)
const [showStickyDate, setShowStickyDate] = useState(false)
const [isSwipe, setSwipe] = useState(true)
useFocusEffect(
React.useCallback(() => {
AndroidKeyboardAdjust?.setAdjustResize()
return () => AndroidKeyboardAdjust?.setAdjustPan()
}, []),
)
return (
{({ activeEmojiKeyboardCid, setActiveEmojiKeyboardCid, setActivePopoverCid }) => {
const onRemoveEmojiBoard = () => {
setActivePopoverCid(activeEmojiKeyboardCid)
setActiveEmojiKeyboardCid(null)
}
return (
export default function NativeStackScreen({ navigation }: Props) {
navigation.setOptions({
headerShown: false,
});
useFocusEffect(
React.useCallback(() => {
const drawer = navigation.dangerouslyGetParent() as DrawerNavigationProp<
ParamListBase
>;
navigation.setOptions({ gestureEnabled: false });
drawer.setOptions({ gestureEnabled: false });
return () => {
navigation.setOptions({ gestureEnabled: true });
drawer.setOptions({ gestureEnabled: true });
};
}, [navigation])
);
return (
const { t } = useTranslation()
const conv = useConversation(params?.convId)
const contact = useContact(conv?.contactPublicKey)
const ctx = useMsgrContext()
const isIncoming = contact?.state === beapi.messenger.Contact.State.IncomingRequest
const isFooterDisable = isIncoming
const placeholder = isFooterDisable
? t('chat.one-to-one.incoming-input-placeholder')
: t('chat.one-to-one.input-placeholder')
const [stickyDate, setStickyDate] = useState(conv?.lastUpdate || null)
const [showStickyDate, setShowStickyDate] = useState(false)
const [isSwipe, setSwipe] = useState(true)
useFocusEffect(
React.useCallback(() => {
AndroidKeyboardAdjust?.setAdjustResize()
return () => AndroidKeyboardAdjust?.setAdjustPan()
}, []),
)
return (
{({ activeEmojiKeyboardCid, setActiveEmojiKeyboardCid, setActivePopoverCid }) => {
const onRemoveEmojiBoard = () => {
setActivePopoverCid(activeEmojiKeyboardCid)
setActiveEmojiKeyboardCid(null)
}
return (