thêm giao diện quản lý thuyền

This commit is contained in:
Tran Anh Tuan
2025-12-10 19:49:54 +07:00
parent df4318fed4
commit 3e1c4dcbc5
24 changed files with 2091 additions and 135 deletions

View File

@@ -3,8 +3,10 @@ import { Tabs, useSegments } from "expo-router";
import { HapticTab } from "@/components/haptic-tab";
import { IconSymbol } from "@/components/ui/icon-symbol";
import { Colors } from "@/constants/theme";
import { queryProfile } from "@/controller/AuthController";
import { useI18n } from "@/hooks/use-i18n";
import { useColorScheme } from "@/hooks/use-theme-context";
import { addUserStorage } from "@/utils/storage";
import { useEffect, useRef } from "react";
export default function TabLayout() {
@@ -29,6 +31,23 @@ export default function TabLayout() {
}
}, [currentSegment]);
useEffect(() => {
const getUserProfile = async () => {
try {
const resp = await queryProfile();
if (resp.data && resp.status === 200) {
await addUserStorage(
resp.data.id || "",
resp.data.metadata?.user_type || ""
);
}
} catch (error) {
console.error("Error when get Profile: ", error);
}
};
getUserProfile();
}, []);
return (
<Tabs
screenOptions={{