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'
|
2022-09-18 23:54:50 +02:00
|
|
|
import { View } from 'react-native'
|
2020-12-11 00:29:22 +01:00
|
|
|
|
2021-04-09 21:43:12 +02:00
|
|
|
export interface Props {
|
|
|
|
accessibleRefAttachments: RefObject<View>
|
|
|
|
}
|
|
|
|
|
2022-09-18 23:54:50 +02:00
|
|
|
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
|
|
|
|
2020-12-11 00:29:22 +01:00
|
|
|
return (
|
|
|
|
<>
|
2021-04-09 21:43:12 +02:00
|
|
|
{composeState.attachments.uploads.length ? (
|
2022-09-18 23:54:50 +02:00
|
|
|
<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}
|
2020-12-11 00:29:22 +01:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ComposeRootFooter
|