2021-02-07 00:39:11 +01:00
|
|
|
import { HeaderCenter, HeaderLeft } from '@components/Header'
|
2021-08-21 01:45:43 +02:00
|
|
|
import { createNativeStackNavigator } from '@react-navigation/native-stack'
|
2021-02-07 00:39:11 +01:00
|
|
|
import { StackScreenProps } from '@react-navigation/stack'
|
|
|
|
import React, { useCallback } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import { Platform } from 'react-native'
|
|
|
|
import ComposeDraftsListRoot from './DraftsList/Root'
|
|
|
|
|
|
|
|
const Stack = createNativeStackNavigator()
|
|
|
|
|
|
|
|
export type ScreenComposeEditAttachmentProp = StackScreenProps<
|
|
|
|
Nav.ScreenComposeStackParamList,
|
|
|
|
'Screen-Compose-DraftsList'
|
|
|
|
>
|
|
|
|
|
|
|
|
const ComposeDraftsList: React.FC<ScreenComposeEditAttachmentProp> = ({
|
|
|
|
route: {
|
|
|
|
params: { timestamp }
|
|
|
|
},
|
|
|
|
navigation
|
|
|
|
}) => {
|
2021-03-28 23:31:10 +02:00
|
|
|
const { t } = useTranslation('screenCompose')
|
2021-02-07 00:39:11 +01:00
|
|
|
|
|
|
|
const children = useCallback(
|
|
|
|
() => <ComposeDraftsListRoot timestamp={timestamp} />,
|
|
|
|
[]
|
|
|
|
)
|
|
|
|
const headerLeft = useCallback(
|
|
|
|
() => (
|
|
|
|
<HeaderLeft
|
|
|
|
type='icon'
|
|
|
|
content='ChevronDown'
|
|
|
|
onPress={() => navigation.goBack()}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
[]
|
|
|
|
)
|
|
|
|
|
|
|
|
return (
|
2021-08-21 01:45:43 +02:00
|
|
|
<Stack.Navigator>
|
2021-02-07 00:39:11 +01:00
|
|
|
<Stack.Screen
|
|
|
|
name='Screen-Compose-EditAttachment-Root'
|
|
|
|
children={children}
|
|
|
|
options={{
|
|
|
|
headerLeft,
|
|
|
|
headerTitle: t('content.draftsList.header.title'),
|
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
|
|
|
<HeaderCenter content={t('content.draftsList.header.title')} />
|
|
|
|
)
|
|
|
|
}),
|
2021-08-21 01:45:43 +02:00
|
|
|
headerShadowVisible: false
|
2021-02-07 00:39:11 +01:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Stack.Navigator>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ComposeDraftsList
|