tooot/src/screens/Compose/Root/Footer.tsx

37 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-01-30 01:29:15 +01:00
import ComposeAttachments from '@screens/Compose/Root/Footer/Attachments'
import ComposeEmojis from '@screens/Compose/Root/Footer/Emojis'
import ComposePoll from '@screens/Compose/Root/Footer/Poll'
import ComposeReply from '@screens/Compose/Root/Footer/Reply'
import ComposeContext from '@screens/Compose/utils/createContext'
2021-04-09 21:43:12 +02:00
import React, { RefObject, useContext } from 'react'
import { SectionList, View } from 'react-native'
2021-04-09 21:43:12 +02:00
export interface Props {
accessibleRefAttachments: RefObject<View>
accessibleRefEmojis: RefObject<SectionList>
}
const ComposeRootFooter: React.FC<Props> = ({
accessibleRefAttachments,
accessibleRefEmojis
}) => {
2020-12-18 23:58:53 +01:00
const { composeState } = useContext(ComposeContext)
2020-12-26 00:40:27 +01:00
return (
<>
2021-04-09 21:43:12 +02:00
{composeState.emoji.active ? (
<ComposeEmojis accessibleRefEmojis={accessibleRefEmojis} />
) : null}
{composeState.attachments.uploads.length ? (
<ComposeAttachments
accessibleRefAttachments={accessibleRefAttachments}
/>
) : null}
2020-12-30 00:56:25 +01:00
{composeState.poll.active ? <ComposePoll /> : null}
{composeState.replyToStatus ? <ComposeReply /> : null}
</>
)
}
export default ComposeRootFooter