tooot/src/screens/Shared/sharedScreens.tsx

97 lines
3.1 KiB
TypeScript
Raw Normal View History

2021-01-07 19:13:09 +01:00
import { HeaderLeft } from '@components/Header'
2020-12-13 14:04:25 +01:00
import ScreenSharedAccount from '@screens/Shared/Account'
2021-01-04 18:29:02 +01:00
import ScreenSharedAnnouncements from '@screens/Shared/Announcements'
2020-12-13 14:04:25 +01:00
import ScreenSharedHashtag from '@screens/Shared/Hashtag'
2021-01-04 18:29:02 +01:00
import ScreenSharedImagesViewer from '@screens/Shared/ImagesViewer'
import ScreenSharedRelationships from '@screens/Shared/Relationships'
2020-12-13 14:04:25 +01:00
import ScreenSharedToot from '@screens/Shared/Toot'
import Compose from '@screens/Shared/Compose'
import ScreenSharedSearch from '@screens/Shared/Search'
2020-12-23 01:31:11 +01:00
import React from 'react'
2020-11-30 00:24:53 +01:00
import { useTranslation } from 'react-i18next'
2020-11-21 13:19:05 +01:00
2020-11-24 00:18:47 +01:00
const sharedScreens = (Stack: any) => {
2020-11-30 00:24:53 +01:00
const { t } = useTranslation()
2020-11-21 13:19:05 +01:00
return [
<Stack.Screen
key='Screen-Shared-Account'
name='Screen-Shared-Account'
component={ScreenSharedAccount}
options={({ navigation }: any) => {
return {
headerTranslucent: true,
headerStyle: {
backgroundColor: `rgba(255, 255, 255, 0)`
},
headerCenter: () => null,
2020-12-26 23:27:53 +01:00
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />
}
}}
2020-11-21 13:19:05 +01:00
/>,
<Stack.Screen
key='Screen-Shared-Hashtag'
name='Screen-Shared-Hashtag'
component={ScreenSharedHashtag}
options={({ route, navigation }: any) => ({
2020-12-13 23:38:37 +01:00
title: `#${decodeURIComponent(route.params.hashtag)}`,
2020-12-26 23:27:53 +01:00
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />
2020-11-21 13:19:05 +01:00
})}
/>,
<Stack.Screen
key='Screen-Shared-Toot'
name='Screen-Shared-Toot'
component={ScreenSharedToot}
options={({ navigation }: any) => ({
2020-12-13 23:38:37 +01:00
title: t('sharedToot:heading'),
2020-12-26 23:27:53 +01:00
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />
2020-11-21 13:19:05 +01:00
})}
/>,
<Stack.Screen
2020-11-22 00:57:43 +01:00
key='Screen-Shared-Compose'
name='Screen-Shared-Compose'
component={Compose}
2020-11-21 13:19:05 +01:00
options={{
stackPresentation: 'fullScreenModal'
}}
2020-11-24 00:18:47 +01:00
/>,
<Stack.Screen
key='Screen-Shared-Search'
name='Screen-Shared-Search'
component={ScreenSharedSearch}
2021-01-04 18:29:02 +01:00
options={({ navigation }: any) => ({
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />
})}
2020-12-23 01:31:11 +01:00
/>,
<Stack.Screen
key='Screen-Shared-Announcements'
name='Screen-Shared-Announcements'
component={ScreenSharedAnnouncements}
options={{
stackPresentation: 'transparentModal',
stackAnimation: 'fade'
}}
2020-12-25 18:20:09 +01:00
/>,
<Stack.Screen
key='Screen-Shared-ImagesViewer'
name='Screen-Shared-ImagesViewer'
component={ScreenSharedImagesViewer}
options={{
stackPresentation: 'transparentModal',
stackAnimation: 'none'
}}
2021-01-04 18:29:02 +01:00
/>,
<Stack.Screen
key='Screen-Shared-Relationships'
name='Screen-Shared-Relationships'
component={ScreenSharedRelationships}
options={({ route, navigation }: any) => ({
title: route.params.account.display_name || route.params.account.name,
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />
})}
2020-11-21 13:19:05 +01:00
/>
]
}
export default sharedScreens