feat: Sprint 1 — Onboarding screen, user persistence, Contact management (list, add, edit, delete, detail, search, filter)

This commit is contained in:
root
2026-02-18 14:35:49 +08:00
parent 8f66a4d4ed
commit 5ddfa9722b
10 changed files with 595 additions and 34 deletions

View File

@@ -1,7 +1,18 @@
import { Tabs } from 'expo-router';
// app/(tabs)/_layout.tsx
import { Tabs, router } from 'expo-router';
import { useEffect } from 'react';
import { Home, Users, Map, Settings } from 'lucide-react-native';
import { useUserStore } from '@/store/useUserStore';
export default function TabLayout() {
const user = useUserStore((s) => s.user);
useEffect(() => {
if (!user) {
router.replace('/onboarding');
}
}, [user]);
return (
<Tabs
screenOptions={{
@@ -10,34 +21,10 @@ export default function TabLayout() {
headerShown: false,
}}
>
<Tabs.Screen
name="index"
options={{
title: 'Home',
tabBarIcon: ({ color, size }) => <Home size={size} color={color} />,
}}
/>
<Tabs.Screen
name="contacts"
options={{
title: 'Contacts',
tabBarIcon: ({ color, size }) => <Users size={size} color={color} />,
}}
/>
<Tabs.Screen
name="map"
options={{
title: 'Map',
tabBarIcon: ({ color, size }) => <Map size={size} color={color} />,
}}
/>
<Tabs.Screen
name="settings"
options={{
title: 'Settings',
tabBarIcon: ({ color, size }) => <Settings size={size} color={color} />,
}}
/>
<Tabs.Screen name="index" options={{ title: 'Home', tabBarIcon: ({ color, size }) => <Home size={size} color={color} /> }} />
<Tabs.Screen name="contacts" options={{ title: 'Contacts', tabBarIcon: ({ color, size }) => <Users size={size} color={color} /> }} />
<Tabs.Screen name="map" options={{ title: 'Map', tabBarIcon: ({ color, size }) => <Map size={size} color={color} /> }} />
<Tabs.Screen name="settings" options={{ title: 'Settings', tabBarIcon: ({ color, size }) => <Settings size={size} color={color} /> }} />
</Tabs>
);
}