import contextMenuAccount from '@components/ContextMenu/account' import contextMenuShare from '@components/ContextMenu/share' import { HeaderCenter, HeaderLeft, HeaderRight } from '@components/Header' import { ParseEmojis } from '@components/Parse' import CustomText from '@components/Text' import { createNativeStackNavigator } from '@react-navigation/native-stack' import TabSharedAccount from '@screens/Tabs/Shared/Account' import TabSharedAttachments from '@screens/Tabs/Shared/Attachments' import TabSharedHashtag from '@screens/Tabs/Shared/Hashtag' import TabSharedHistory from '@screens/Tabs/Shared/History' import TabSharedSearch from '@screens/Tabs/Shared/Search' import TabSharedToot from '@screens/Tabs/Shared/Toot' import TabSharedUsers from '@screens/Tabs/Shared/Users' import { TabSharedStackScreenProps } from '@utils/navigation/navigators' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import { debounce } from 'lodash' import React from 'react' import { Trans, useTranslation } from 'react-i18next' import { Platform, TextInput, View } from 'react-native' import ContextMenu, { ContextMenuAction } from 'react-native-context-menu-view' const TabShared = ({ Stack }: { Stack: ReturnType }) => { const { colors, mode } = useTheme() const { t } = useTranslation('screenTabs') return ( ({ headerLeft: () => navigation.goBack()} /> })} > ) => { return { headerTransparent: true, headerStyle: { backgroundColor: `rgba(255, 255, 255, 0)` }, title: '', headerLeft: () => navigation.goBack()} background />, headerRight: () => { const actions: ContextMenuAction[] = [] const shareOnPress = contextMenuShare({ actions, type: 'account', url: account.url }) const accountOnPress = contextMenuAccount({ actions, type: 'account', id: account.id }) return ( { shareOnPress(index) accountOnPress(index) }} dropdownMenuMode > {}} background /> ) } } }} /> ) => { return { headerTitle: () => ( , ]} /> ) } }} /> ) => ({ title: `#${decodeURIComponent(route.params.hashtag)}` })} /> ) => ({ ...(Platform.OS === 'ios' ? { headerLeft: () => navigation.goBack()} /> } : { headerLeft: () => null }), headerTitle: () => { const onChangeText = debounce((text: string) => navigation.setParams({ text }), 1000, { trailing: true }) return ( navigation.setParams({ text })} placeholder={t('shared.search.header.placeholder')} placeholderTextColor={colors.secondary} returnKeyType='go' /> ) } })} /> ) => ({ title: t(`shared.users.${reference}.${type}`, { count }), ...(Platform.OS === 'android' && { headerCenter: () => ( ) }) })} /> ) } export default TabShared