refactor(navigation): wrap settings screen in stack navigator
This commit is contained in:
@@ -4,7 +4,7 @@ import { Ionicons } from "@expo/vector-icons";
|
||||
import { MainTabParamList } from "./types";
|
||||
import { WorkoutNavigator } from "./WorkoutNavigator";
|
||||
import { HistoryNavigator } from "./HistoryNavigator";
|
||||
import { SettingsScreen } from "../features/settings/screens/SettingsScreen";
|
||||
import { SettingsNavigator } from "./SettingsNavigator";
|
||||
|
||||
const Tab = createBottomTabNavigator<MainTabParamList>();
|
||||
|
||||
@@ -45,8 +45,9 @@ export function MainTabNavigator() {
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="Settings"
|
||||
component={SettingsScreen}
|
||||
component={SettingsNavigator}
|
||||
options={{
|
||||
headerShown: false,
|
||||
tabBarLabel: t("settings"),
|
||||
tabBarIcon: ({ color, size }) => (
|
||||
<Ionicons name="settings-outline" size={size} color={color} />
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||
import { SettingsStackParamList } from "./types";
|
||||
import { SettingsScreen } from "../features/settings/screens/SettingsScreen";
|
||||
|
||||
const Stack = createNativeStackNavigator<SettingsStackParamList>();
|
||||
|
||||
export function SettingsNavigator() {
|
||||
const { t } = useTranslation("navigation");
|
||||
|
||||
return (
|
||||
<Stack.Navigator
|
||||
screenOptions={{
|
||||
headerStyle: { backgroundColor: "#0ea5e9" },
|
||||
headerTintColor: "#fff",
|
||||
headerTitleStyle: { fontWeight: "bold" },
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="SettingsMain"
|
||||
component={SettingsScreen}
|
||||
options={{ title: t("settings") }}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
@@ -26,6 +26,10 @@ export type HistoryStackParamList = {
|
||||
SessionDetail: { sessionId: string };
|
||||
};
|
||||
|
||||
export type SettingsStackParamList = {
|
||||
SettingsMain: undefined;
|
||||
};
|
||||
|
||||
export type RootStackProps<T extends keyof RootStackParamList> =
|
||||
NativeStackScreenProps<RootStackParamList, T>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user