mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at samuel/fancy-queue 49 lines 1.4 kB view raw
1import React from 'react' 2import {Modal, View} from 'react-native' 3 4import {useDialogStateControlContext} from '#/state/dialogs' 5import {useComposerState} from '#/state/shell/composer' 6import {atoms as a, useTheme} from '#/alf' 7import {ComposePost, useComposerCancelRef} from '../com/composer/Composer' 8 9export function Composer({}: {winHeight: number}) { 10 const {setFullyExpandedCount} = useDialogStateControlContext() 11 const t = useTheme() 12 const state = useComposerState() 13 const ref = useComposerCancelRef() 14 15 const open = !!state 16 const prevOpen = React.useRef(open) 17 18 React.useEffect(() => { 19 if (open && !prevOpen.current) { 20 setFullyExpandedCount(c => c + 1) 21 } else if (!open && prevOpen.current) { 22 setFullyExpandedCount(c => c - 1) 23 } 24 prevOpen.current = open 25 }, [open, setFullyExpandedCount]) 26 27 return ( 28 <Modal 29 aria-modal 30 accessibilityViewIsModal 31 visible={open} 32 presentationStyle="pageSheet" 33 animationType="slide" 34 onRequestClose={() => ref.current?.onPressCancel()}> 35 <View style={[t.atoms.bg, a.flex_1]}> 36 <ComposePost 37 cancelRef={ref} 38 replyTo={state?.replyTo} 39 onPost={state?.onPost} 40 quote={state?.quote} 41 mention={state?.mention} 42 text={state?.text} 43 imageUris={state?.imageUris} 44 videoUri={state?.videoUri} 45 /> 46 </View> 47 </Modal> 48 ) 49}