import { HeaderCenter, HeaderLeft } from '@components/Header' import { ParseEmojis } from '@components/Parse' 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 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, StyleSheet, Text, TextInput, View } from 'react-native' const TabSharedRoot = ({ Stack }: { Stack: ReturnType }) => { const { mode, theme } = useTheme() const { t } = useTranslation('screenTabs') return ( ({ headerLeft: () => navigation.goBack()} /> })} > ) => { return { headerTransparent: true, headerStyle: { backgroundColor: `rgba(255, 255, 255, 0)` }, headerTitle: '', headerLeft: () => ( navigation.goBack()} background /> ) } }} /> ) => { return { headerTitle: () => ( , ]} /> ) } }} /> ) => ({ headerTitle: `#${decodeURIComponent(route.params.hashtag)}`, ...(Platform.OS === 'android' && { headerCenter: () => ( ) }) })} /> ) => ({ headerTitle: () => { const onChangeText = debounce( (text: string) => navigation.setParams({ text }), 1000, { trailing: true } ) return ( navigation.setParams({ text }) } placeholder={t('shared.search.header.placeholder')} placeholderTextColor={theme.secondary} returnKeyType='go' /> ) } })} /> }) }} /> ) => ({ headerTitle: t(`shared.users.${reference}.${type}`, { count }), ...(Platform.OS === 'android' && { headerCenter: () => ( ) }) })} /> ) } const styles = StyleSheet.create({ searchBar: { flexBasis: '80%', flexDirection: 'row', alignItems: 'center' }, textInput: { fontSize: StyleConstants.Font.Size.M } }) export default TabSharedRoot