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

27 lines
893 B
TypeScript
Raw Normal View History

2021-01-30 01:29:15 +01:00
import ComposeAttachments from '@screens/Compose/Root/Footer/Attachments'
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 { View } from 'react-native'
2021-04-09 21:43:12 +02:00
export interface Props {
accessibleRefAttachments: RefObject<View>
}
const ComposeRootFooter: React.FC<Props> = ({ accessibleRefAttachments }) => {
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.attachments.uploads.length ? (
<ComposeAttachments accessibleRefAttachments={accessibleRefAttachments} />
2021-04-09 21:43:12 +02:00
) : null}
2020-12-30 00:56:25 +01:00
{composeState.poll.active ? <ComposePoll /> : null}
{composeState.replyToStatus ? <ComposeReply /> : null}
</>
)
}
export default ComposeRootFooter