1
+ import type { FC } from "react" ;
1
2
import React from "react" ;
2
3
import { useTranslation } from "react-i18next" ;
3
4
5
+ import { HeaderBackButton } from "@react-navigation/elements" ;
6
+ import type { NativeStackScreenProps } from "@react-navigation/native-stack" ;
4
7
import { createNativeStackNavigator } from "@react-navigation/native-stack" ;
5
8
6
9
import { Advanced } from "@/pages/Advanced" ;
@@ -10,7 +13,7 @@ import type { SettingsStackParamList } from "./types";
10
13
11
14
const SettingsStack = createNativeStackNavigator < SettingsStackParamList > ( ) ;
12
15
13
- export const SettingsNavigator = ( ) => {
16
+ export const SettingsNavigator : FC < NativeStackScreenProps < SettingsStackParamList , "Settings" > > = ( { navigation } ) => {
14
17
const i18n = useTranslation ( "common" ) ;
15
18
16
19
return (
@@ -19,16 +22,17 @@ export const SettingsNavigator = () => {
19
22
name = { "Settings" }
20
23
component = { Settings }
21
24
options = { {
25
+ headerLeft : props => < HeaderBackButton { ...props } onPress = { navigation . goBack } /> ,
22
26
title : i18n . t ( "Settings" ) ,
23
- headerBackTitleVisible : false ,
24
27
} }
25
28
/>
26
29
< SettingsStack . Screen
27
30
name = { "Advanced" }
28
31
component = { Advanced }
29
32
options = { {
30
- title : i18n . t ( "Advanced" ) ,
33
+ headerBackVisible : true ,
31
34
headerBackTitleVisible : false ,
35
+ title : i18n . t ( "Advanced" ) ,
32
36
} }
33
37
/>
34
38
</ SettingsStack . Navigator >
0 commit comments