diff --git a/src/Index.tsx b/src/Index.tsx index 83904fb7..7612e74d 100644 --- a/src/Index.tsx +++ b/src/Index.tsx @@ -118,7 +118,7 @@ export const Index: React.FC = () => { } })} > - {() => <>} + {() => null} = ({ onPress, text, icon }) => { const { theme } = useTheme() return ( - + {text ? ( {text} ) : ( )} @@ -31,7 +40,10 @@ const HeaderLeft: React.FC = ({ onPress, text, icon }) => { const styles = StyleSheet.create({ base: { - paddingRight: StyleConstants.Spacing.S + flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', + borderRadius: 100 }, text: { fontSize: StyleConstants.Font.Size.M diff --git a/src/components/Header/Right.tsx b/src/components/Header/Right.tsx index 9b3bac00..b12e1b34 100644 --- a/src/components/Header/Right.tsx +++ b/src/components/Header/Right.tsx @@ -29,7 +29,16 @@ const HeaderRight: React.FC = ({ const { theme } = useTheme() return ( - + {text && ( = ({ )} @@ -53,7 +62,10 @@ const HeaderRight: React.FC = ({ const styles = StyleSheet.create({ base: { - paddingLeft: StyleConstants.Spacing.S + flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', + borderRadius: 100 }, text: { fontSize: StyleConstants.Font.Size.M diff --git a/src/components/Timelines.tsx b/src/components/Timelines.tsx index 583b78c6..175e7107 100644 --- a/src/components/Timelines.tsx +++ b/src/components/Timelines.tsx @@ -15,6 +15,7 @@ import { import { useTheme } from '@utils/styles/ThemeManager' import { useNavigation } from '@react-navigation/native' import getCurrentTab from '@utils/getCurrentTab' +import { HeaderRight } from './Header' const Stack = createNativeStackNavigator() @@ -112,12 +113,7 @@ const Timelines: React.FC = ({ name, content }) => { ), headerRight: () => ( - + ) }) }} diff --git a/src/components/Timelines/Timeline/Shared/Card.tsx b/src/components/Timelines/Timeline/Shared/Card.tsx index 9a082455..9812c0df 100644 --- a/src/components/Timelines/Timeline/Shared/Card.tsx +++ b/src/components/Timelines/Timeline/Shared/Card.tsx @@ -41,9 +41,7 @@ const TimelineCard: React.FC = ({ card }) => { > {card.description} - ) : ( - <> - )} + ) : null} {card.url} diff --git a/src/screens/Me.tsx b/src/screens/Me.tsx index 031f58c8..95accd07 100644 --- a/src/screens/Me.tsx +++ b/src/screens/Me.tsx @@ -1,7 +1,6 @@ import React from 'react' import { createNativeStackNavigator } from 'react-native-screens/native-stack' import { useTranslation } from 'react-i18next' -import { useSelector } from 'react-redux' import ScreenMeRoot from '@screens/Me/Root' import ScreenMeConversations from '@screens/Me/Cconversations' @@ -12,71 +11,102 @@ import sharedScreens from '@screens/Shared/sharedScreens' import ScreenMeListsList from '@screens/Me/Root/Lists/List' import ScreenMeSettings from '@screens/Me/Settings' -import { RootState } from 'src/store' +import { HeaderLeft } from '@root/components/Header' +import { useNavigation } from '@react-navigation/native' const Stack = createNativeStackNavigator() const ScreenMe: React.FC = () => { + const navigation = useNavigation() const { t } = useTranslation() - const localRegistered = useSelector( - (state: RootState) => state.instances.local.url - ) return ( <> - } - // : { headerTitle: t('meRoot:heading') } - } + options={{ + headerTranslucent: true, + headerStyle: { backgroundColor: 'rgba(255, 255, 255, 0)' }, + headerCenter: () => null + }} /> ( + navigation.goBack()} + /> + ) }} /> ( + navigation.goBack()} + /> + ) }} /> ( + navigation.goBack()} + /> + ) }} /> ( + navigation.goBack()} + /> + ) }} /> ({ - headerTitle: t('meListsList:heading', { list: route.params.title }) + headerTitle: t('meListsList:heading', { list: route.params.title }), + headerLeft: () => ( + navigation.goBack()} + /> + ) })} /> ( + navigation.goBack()} + /> + ) }} /> diff --git a/src/screens/Shared/sharedScreens.tsx b/src/screens/Shared/sharedScreens.tsx index 9ea6a120..1d691274 100644 --- a/src/screens/Shared/sharedScreens.tsx +++ b/src/screens/Shared/sharedScreens.tsx @@ -8,8 +8,11 @@ import Compose from '@screens/Shared/Compose' import ComposeEditAttachment from '@screens/Shared/Compose/EditAttachment' import ScreenSharedSearch from '@screens/Shared/Search' import { useTranslation } from 'react-i18next' +import { useNavigation } from '@react-navigation/native' +import { HeaderLeft } from '@root/components/Header' const sharedScreens = (Stack: any) => { + const navigation = useNavigation() const { t } = useTranslation() return [ @@ -20,7 +23,10 @@ const sharedScreens = (Stack: any) => { options={{ headerTranslucent: true, headerStyle: { backgroundColor: 'rgba(255, 255, 255, 0)' }, - headerCenter: () => <> + headerCenter: () => null, + headerLeft: () => ( + navigation.goBack()} /> + ) }} />, { name='Screen-Shared-Hashtag' component={ScreenSharedHashtag} options={({ route }: any) => ({ - title: `#${decodeURIComponent(route.params.hashtag)}` + title: `#${decodeURIComponent(route.params.hashtag)}`, + headerLeft: () => ( + navigation.goBack()} /> + ) })} />, { name='Screen-Shared-Toot' component={ScreenSharedToot} options={() => ({ - title: t('sharedToot:heading') + title: t('sharedToot:heading'), + headerLeft: () => ( + navigation.goBack()} /> + ) })} />, { name='Screen-Shared-Compose-EditAttachment' component={ComposeEditAttachment} options={{ - stackPresentation: 'modal', + stackPresentation: 'modal' }} />,