tooot/src/screens/Compose/EditAttachment.tsx

50 lines
1.7 KiB
TypeScript
Raw Normal View History

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-03-09 14:43:31 +01:00
import React, { useCallback } from 'react'
2021-01-19 01:13:45 +01:00
import { useTranslation } from 'react-i18next'
2021-03-09 14:43:31 +01:00
import { KeyboardAvoidingView, Platform } from 'react-native'
2020-12-06 12:52:29 +01:00
import { SafeAreaView } from 'react-native-safe-area-context'
2020-12-30 00:56:25 +01:00
import ComposeEditAttachmentRoot from './EditAttachment/Root'
2021-03-09 14:43:31 +01:00
import ComposeEditAttachmentSubmit from './EditAttachment/Submit'
2020-12-06 12:52:29 +01:00
const Stack = createNativeStackNavigator()
2021-08-29 15:25:38 +02:00
const ComposeEditAttachment: React.FC<ScreenComposeStackScreenProps<
2021-01-31 03:09:35 +01:00
'Screen-Compose-EditAttachment'
2021-08-29 15:25:38 +02:00
>> = ({
2020-12-06 12:52:29 +01:00
route: {
2020-12-30 00:56:25 +01:00
params: { index }
},
navigation
2020-12-06 12:52:29 +01:00
}) => {
2022-08-19 01:58:17 +02:00
const { t } = useTranslation('screenCompose')
2020-12-30 00:56:25 +01:00
2022-08-19 01:58:17 +02:00
return (
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={{ flex: 1 }}
>
<SafeAreaView style={{ flex: 1 }} edges={['left', 'right', 'bottom']}>
<Stack.Navigator>
<Stack.Screen
name='Screen-Compose-EditAttachment-Root'
children={() => <ComposeEditAttachmentRoot index={index} />}
options={{
headerLeft: () => <HeaderLeft
type='icon'
content='ChevronDown'
onPress={() => navigation.goBack()}
/>,
headerRight: () => <ComposeEditAttachmentSubmit index={index} />,
title: t('content.editAttachment.header.title')
}}
/>
</Stack.Navigator>
</SafeAreaView>
</KeyboardAvoidingView>
)
}
2020-12-06 12:52:29 +01:00
export default ComposeEditAttachment