- Add Lucide React Native icon library and use across tabs and screens
- Mobile-like design: rounded cards (xl/2xl), section dividers, icon chips, chevrons
- New pages from swagger: register, invoices/[id], reports, documents, settings
- Invoice detail: amount, bill to, items, Share/PDF actions (GET /invoices/{id})
- Register screen with link to login (POST /auth/register)
- Reports list with mock data and download (GET /reports)
- Documents list with upload CTA (GET /documents)
- Settings: notifications link, language, about
- Profile: links to Notifications, Reports, Documents, Settings
- Home: invoice rows navigate to /invoices/[id]
- Login ↔ Register navigation
- Keep orange (#ea580c) and dark navbar (#2d2d2d) theme throughout
- README: update screens table with new routes
Co-authored-by: Cursor <cursoragent@cursor.com>
120 lines
5.3 KiB
TypeScript
120 lines
5.3 KiB
TypeScript
import { View, ScrollView, Pressable } from 'react-native';
|
|
import { router } from 'expo-router';
|
|
import { Text } from '@/components/ui/text';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
import { MOCK_USER } from '@/lib/mock-data';
|
|
import { User, Mail, Globe, Bell, ChevronRight, Info, LogOut, LogIn, FileText, FolderOpen, Settings } from '@/lib/icons';
|
|
|
|
const PRIMARY = '#ea580c';
|
|
|
|
export default function ProfileScreen() {
|
|
return (
|
|
<ScrollView
|
|
className="flex-1 bg-[#f5f5f5]"
|
|
contentContainerStyle={{ padding: 20, paddingBottom: 40 }}
|
|
showsVerticalScrollIndicator={false}
|
|
>
|
|
<View className="mb-6 items-center">
|
|
<View className="mb-3 h-20 w-20 items-center justify-center rounded-full bg-primary">
|
|
<Text className="text-3xl font-bold text-primary-foreground">{MOCK_USER.name[0]}</Text>
|
|
</View>
|
|
<Text className="text-xl font-semibold text-gray-900">{MOCK_USER.name}</Text>
|
|
<Text className="text-muted-foreground mt-1 text-sm">{MOCK_USER.email}</Text>
|
|
</View>
|
|
|
|
<Card className="mb-4 overflow-hidden rounded-xl border border-border bg-white">
|
|
<CardHeader className="pb-2">
|
|
<CardTitle className="text-base">Account</CardTitle>
|
|
</CardHeader>
|
|
<CardContent className="gap-0">
|
|
<View className="flex-row items-center justify-between border-b border-border py-3">
|
|
<View className="flex-row items-center gap-3">
|
|
<Mail color="#71717a" size={20} strokeWidth={2} />
|
|
<Text className="text-muted-foreground">Email</Text>
|
|
</View>
|
|
<Text className="text-gray-900">{MOCK_USER.email}</Text>
|
|
</View>
|
|
<View className="flex-row items-center justify-between border-b border-border py-3">
|
|
<View className="flex-row items-center gap-3">
|
|
<Globe color="#71717a" size={20} strokeWidth={2} />
|
|
<Text className="text-muted-foreground">Language</Text>
|
|
</View>
|
|
<Text className="text-gray-900">English</Text>
|
|
</View>
|
|
<Pressable
|
|
onPress={() => router.push('/notifications')}
|
|
className="flex-row items-center justify-between border-b border-border py-3"
|
|
>
|
|
<View className="flex-row items-center gap-3">
|
|
<Bell color="#71717a" size={20} strokeWidth={2} />
|
|
<Text className="text-muted-foreground">Notifications</Text>
|
|
</View>
|
|
<View className="flex-row items-center gap-1">
|
|
<Text className="text-primary font-medium">Manage</Text>
|
|
<ChevronRight color={PRIMARY} size={18} strokeWidth={2} />
|
|
</View>
|
|
</Pressable>
|
|
<Pressable
|
|
onPress={() => router.push('/reports')}
|
|
className="flex-row items-center justify-between border-b border-border py-3"
|
|
>
|
|
<View className="flex-row items-center gap-3">
|
|
<FileText color="#71717a" size={20} strokeWidth={2} />
|
|
<Text className="text-muted-foreground">Reports</Text>
|
|
</View>
|
|
<ChevronRight color="#a1a1aa" size={18} strokeWidth={2} />
|
|
</Pressable>
|
|
<Pressable
|
|
onPress={() => router.push('/documents')}
|
|
className="flex-row items-center justify-between border-b border-border py-3"
|
|
>
|
|
<View className="flex-row items-center gap-3">
|
|
<FolderOpen color="#71717a" size={20} strokeWidth={2} />
|
|
<Text className="text-muted-foreground">Documents</Text>
|
|
</View>
|
|
<ChevronRight color="#a1a1aa" size={18} strokeWidth={2} />
|
|
</Pressable>
|
|
<Pressable
|
|
onPress={() => router.push('/settings')}
|
|
className="flex-row items-center justify-between py-3"
|
|
>
|
|
<View className="flex-row items-center gap-3">
|
|
<Settings color="#71717a" size={20} strokeWidth={2} />
|
|
<Text className="text-muted-foreground">Settings</Text>
|
|
</View>
|
|
<ChevronRight color="#a1a1aa" size={18} strokeWidth={2} />
|
|
</Pressable>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card className="mb-4 overflow-hidden rounded-xl border border-border bg-white">
|
|
<CardHeader className="pb-2">
|
|
<View className="flex-row items-center gap-2">
|
|
<Info color="#71717a" size={18} strokeWidth={2} />
|
|
<CardTitle className="text-base">About</CardTitle>
|
|
</View>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<Text className="text-muted-foreground text-sm leading-5">
|
|
Yaltopia Tickets App — Scan. Send. Reconcile. Companion to the Yaltopia Tickets web app.
|
|
</Text>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Button
|
|
variant="outline"
|
|
className="mt-2 min-h-12 rounded-xl border-border"
|
|
onPress={() => router.push('/login')}
|
|
>
|
|
<LogIn color={PRIMARY} size={20} strokeWidth={2} />
|
|
<Text className="ml-2 font-medium text-gray-700">Sign in (different account)</Text>
|
|
</Button>
|
|
<Button variant="destructive" className="mt-3 min-h-12 rounded-xl">
|
|
<LogOut color="#ffffff" size={20} strokeWidth={2} />
|
|
<Text className="ml-2 font-medium">Log out</Text>
|
|
</Button>
|
|
</ScrollView>
|
|
);
|
|
}
|