chore: fix
This commit is contained in:
@@ -2,6 +2,8 @@ import React from "react";
|
||||
import { TouchableOpacity, View } from "react-native";
|
||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { useAuth } from "../auth/AuthContext";
|
||||
import { useTheme } from "../context/ThemeContext";
|
||||
@@ -26,6 +28,7 @@ const Stack = createNativeStackNavigator<AdminStackParamList>();
|
||||
function AdminTabs() {
|
||||
const { logout } = useAuth();
|
||||
const { colors, isDark, toggleTheme } = useTheme();
|
||||
const navigation = useNavigation<NativeStackNavigationProp<AdminStackParamList>>();
|
||||
|
||||
const handleLogout = async () => {
|
||||
await logoutAdmin();
|
||||
@@ -55,6 +58,16 @@ function AdminTabs() {
|
||||
color={colors.textSecondary}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
onPress={() => navigation.navigate("Settings")}
|
||||
style={{ marginRight: spacing.m }}
|
||||
>
|
||||
<Ionicons
|
||||
name="settings-outline"
|
||||
size={22}
|
||||
color={colors.textSecondary}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity onPress={handleLogout}>
|
||||
<Ionicons
|
||||
name="log-out-outline"
|
||||
@@ -186,20 +199,6 @@ function AdminTabs() {
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="Settings"
|
||||
component={SettingsScreen}
|
||||
options={{
|
||||
title: "Paramètres",
|
||||
tabBarIcon: ({ color, size }) => (
|
||||
<Ionicons
|
||||
name="settings-outline"
|
||||
size={size}
|
||||
color={color}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Tab.Navigator>
|
||||
);
|
||||
}
|
||||
@@ -224,6 +223,11 @@ export default function AdminNavigator() {
|
||||
component={OrderDetailScreen}
|
||||
options={{ title: "Détail commande" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Settings"
|
||||
component={SettingsScreen}
|
||||
options={{ title: "Paramètres" }}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ export type AdminTabParamList = {
|
||||
Delivery: undefined;
|
||||
Alerts: undefined;
|
||||
Addresses: undefined;
|
||||
Settings: undefined;
|
||||
};
|
||||
|
||||
export type AdminStackParamList = {
|
||||
AdminTabs: undefined;
|
||||
OrderDetail: { orderId: number };
|
||||
Settings: undefined;
|
||||
};
|
||||
|
||||
export type CabineTabParamList = {
|
||||
|
||||
Reference in New Issue
Block a user