tooot/src/screens/Compose/DraftsList.tsx

51 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-12-18 23:44:08 +01:00
import { HeaderLeft } from '@components/Header'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
2021-08-29 15:25:38 +02:00
import { ScreenComposeStackScreenProps } from '@utils/navigation/navigators'
2021-02-07 00:39:11 +01:00
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import ComposeDraftsListRoot from './DraftsList/Root'
const Stack = createNativeStackNavigator()
2021-12-18 23:44:08 +01:00
const ComposeDraftsList: React.FC<
ScreenComposeStackScreenProps<'Screen-Compose-DraftsList'>
> = ({
2021-02-07 00:39:11 +01:00
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 (
<Stack.Navigator>
2021-02-07 00:39:11 +01:00
<Stack.Screen
name='Screen-Compose-EditAttachment-Root'
children={children}
options={{
headerLeft,
2021-12-18 23:44:08 +01:00
title: t('content.draftsList.header.title'),
headerShadowVisible: false
2021-02-07 00:39:11 +01:00
}}
/>
</Stack.Navigator>
)
}
export default ComposeDraftsList