Skip to content

Commit 43548a8

Browse files
Improve multiple updates at once
Add and consolidate phase-3 features: emergency module, community reporting, and enhanced profiles - Introduce Emergency page accessible without login with hotlines and guides - Add Community Reporting framework with migrations, UI, and routing - Extend navigation to surface new emergency and community options - Prepare for enhanced profiles and notification enhancements in next steps X-Lovable-Edit-ID: edt-0d0c88a6-2388-4d98-9fb5-933c9e2aa02a
2 parents d00d4af + 5b194b3 commit 43548a8

File tree

6 files changed

+1281
-1
lines changed

6 files changed

+1281
-1
lines changed

src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const ProfileSettings = lazy(() => import("./pages/settings/Profile"));
3030
const ThemeSettings = lazy(() => import("./pages/settings/Theme"));
3131
const NotificationSettings = lazy(() => import("./pages/settings/Notifications"));
3232
const SecuritySettings = lazy(() => import("./pages/settings/Security"));
33+
const FamilyMembers = lazy(() => import("./pages/settings/FamilyMembers"));
34+
const Caregivers = lazy(() => import("./pages/settings/Caregivers"));
3335
const NotFound = lazy(() => import("./pages/NotFound"));
3436

3537
const ChatBotWrapper = () => {
@@ -74,6 +76,8 @@ const App = () => (
7476
<Route path="/settings/theme" element={<ProtectedRoute><ThemeSettings /></ProtectedRoute>} />
7577
<Route path="/settings/notifications" element={<ProtectedRoute><NotificationSettings /></ProtectedRoute>} />
7678
<Route path="/settings/security" element={<ProtectedRoute><SecuritySettings /></ProtectedRoute>} />
79+
<Route path="/settings/family" element={<ProtectedRoute><FamilyMembers /></ProtectedRoute>} />
80+
<Route path="/settings/caregivers" element={<ProtectedRoute><Caregivers /></ProtectedRoute>} />
7781
<Route path="*" element={<NotFound />} />
7882
</Routes>
7983
</Suspense>

src/components/Navigation.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Link, useLocation, useNavigate } from "react-router-dom";
22
import { cn } from "@/lib/utils";
3-
import { Shield, FileText, Activity, LogOut, User, ClipboardCheck, Database, Utensils, Menu, Settings, Moon, Bell, Lock, FlaskConical, MoreHorizontal, Pill, AlertCircle, Users } from "lucide-react";
3+
import { Shield, FileText, Activity, LogOut, User, ClipboardCheck, Database, Utensils, Menu, Settings, Moon, Bell, Lock, FlaskConical, MoreHorizontal, Pill, AlertCircle, Users, UserCog } from "lucide-react";
44
import { useAuth } from "@/contexts/AuthContext";
55
import { Button } from "./ui/button";
66
import { OptimizedImage } from "./OptimizedImage";
@@ -238,6 +238,14 @@ export function Navigation() {
238238
<Lock className="w-4 h-4 mr-2" />
239239
Privacy & Security
240240
</DropdownMenuItem>
241+
<DropdownMenuItem onClick={() => navigate('/settings/family')}>
242+
<Users className="w-4 h-4 mr-2" />
243+
Family Members
244+
</DropdownMenuItem>
245+
<DropdownMenuItem onClick={() => navigate('/settings/caregivers')}>
246+
<UserCog className="w-4 h-4 mr-2" />
247+
Caregivers
248+
</DropdownMenuItem>
241249
<DropdownMenuSeparator />
242250
<DropdownMenuItem onClick={handleSignOut} className="text-destructive focus:text-destructive">
243251
<LogOut className="w-4 h-4 mr-2" />

src/integrations/supabase/types.ts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,48 @@ export type Database = {
1414
}
1515
public: {
1616
Tables: {
17+
caregivers: {
18+
Row: {
19+
approved_at: string | null
20+
can_add_medications: boolean | null
21+
can_manage_reminders: boolean | null
22+
can_view_history: boolean | null
23+
can_view_reports: boolean | null
24+
caregiver_user_id: string
25+
created_at: string | null
26+
id: string
27+
patient_user_id: string
28+
status: string
29+
updated_at: string | null
30+
}
31+
Insert: {
32+
approved_at?: string | null
33+
can_add_medications?: boolean | null
34+
can_manage_reminders?: boolean | null
35+
can_view_history?: boolean | null
36+
can_view_reports?: boolean | null
37+
caregiver_user_id: string
38+
created_at?: string | null
39+
id?: string
40+
patient_user_id: string
41+
status?: string
42+
updated_at?: string | null
43+
}
44+
Update: {
45+
approved_at?: string | null
46+
can_add_medications?: boolean | null
47+
can_manage_reminders?: boolean | null
48+
can_view_history?: boolean | null
49+
can_view_reports?: boolean | null
50+
caregiver_user_id?: string
51+
created_at?: string | null
52+
id?: string
53+
patient_user_id?: string
54+
status?: string
55+
updated_at?: string | null
56+
}
57+
Relationships: []
58+
}
1759
counterfeit_reports: {
1860
Row: {
1961
batch_number: string | null
@@ -92,6 +134,54 @@ export type Database = {
92134
}
93135
Relationships: []
94136
}
137+
dashboard_stats: {
138+
Row: {
139+
counterfeit_detected: number | null
140+
created_at: string | null
141+
drug_interaction_checks: number | null
142+
id: string
143+
last_login_date: string | null
144+
last_verification_date: string | null
145+
prescription_scans: number | null
146+
safety_score_checks: number | null
147+
streak_days: number | null
148+
successful_verifications: number | null
149+
total_verifications: number | null
150+
updated_at: string | null
151+
user_id: string
152+
}
153+
Insert: {
154+
counterfeit_detected?: number | null
155+
created_at?: string | null
156+
drug_interaction_checks?: number | null
157+
id?: string
158+
last_login_date?: string | null
159+
last_verification_date?: string | null
160+
prescription_scans?: number | null
161+
safety_score_checks?: number | null
162+
streak_days?: number | null
163+
successful_verifications?: number | null
164+
total_verifications?: number | null
165+
updated_at?: string | null
166+
user_id: string
167+
}
168+
Update: {
169+
counterfeit_detected?: number | null
170+
created_at?: string | null
171+
drug_interaction_checks?: number | null
172+
id?: string
173+
last_login_date?: string | null
174+
last_verification_date?: string | null
175+
prescription_scans?: number | null
176+
safety_score_checks?: number | null
177+
streak_days?: number | null
178+
successful_verifications?: number | null
179+
total_verifications?: number | null
180+
updated_at?: string | null
181+
user_id?: string
182+
}
183+
Relationships: []
184+
}
95185
drugs: {
96186
Row: {
97187
active_ingredient: string
@@ -140,6 +230,60 @@ export type Database = {
140230
}
141231
Relationships: []
142232
}
233+
family_members: {
234+
Row: {
235+
allergies: string[] | null
236+
blood_group: string | null
237+
chronic_conditions: string[] | null
238+
created_at: string | null
239+
date_of_birth: string | null
240+
emergency_contact: string | null
241+
emergency_contact_phone: string | null
242+
gender: string | null
243+
has_separate_account: boolean | null
244+
id: string
245+
linked_user_id: string | null
246+
name: string
247+
relationship: string
248+
updated_at: string | null
249+
user_id: string
250+
}
251+
Insert: {
252+
allergies?: string[] | null
253+
blood_group?: string | null
254+
chronic_conditions?: string[] | null
255+
created_at?: string | null
256+
date_of_birth?: string | null
257+
emergency_contact?: string | null
258+
emergency_contact_phone?: string | null
259+
gender?: string | null
260+
has_separate_account?: boolean | null
261+
id?: string
262+
linked_user_id?: string | null
263+
name: string
264+
relationship: string
265+
updated_at?: string | null
266+
user_id: string
267+
}
268+
Update: {
269+
allergies?: string[] | null
270+
blood_group?: string | null
271+
chronic_conditions?: string[] | null
272+
created_at?: string | null
273+
date_of_birth?: string | null
274+
emergency_contact?: string | null
275+
emergency_contact_phone?: string | null
276+
gender?: string | null
277+
has_separate_account?: boolean | null
278+
id?: string
279+
linked_user_id?: string | null
280+
name?: string
281+
relationship?: string
282+
updated_at?: string | null
283+
user_id?: string
284+
}
285+
Relationships: []
286+
}
143287
notifications: {
144288
Row: {
145289
created_at: string | null

0 commit comments

Comments
 (0)