diff --git a/src/App.tsx b/src/App.tsx index f50912e..fcfc88c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,11 +3,9 @@ import { Activity, AlertTriangle, CalendarDays, - CheckCircle2, ChevronRight, Cloud, Command, - Database, Edit3, FileJson, FileSpreadsheet, @@ -26,7 +24,6 @@ import { RotateCcw, Search, Settings2, - ShieldCheck, Sparkles, TimerReset, Trash2, @@ -693,17 +690,9 @@ function App() { void exportExcel()} - onImportExcel={() => excelFileInputRef.current?.click()} - onOpenSettings={() => setActiveView("settings")} - onRefresh={() => void refreshEntries(user.$id)} /> @@ -929,93 +918,83 @@ function AuthView({ return ( - - - - - {setupStatus.state === "ok" ? "Appwrite sync online" : "Appwrite setup check"} - - - Red Bull Tracker App - - - Soft Material You intake tracking with Appwrite authentication, device sync, and polished Excel exports. - - - - - - - {setupStatus.state !== "ok" && ( - - {setupStatus.message} - - )} - - - - - setMode("login")} - > - Log in - - setMode("signup")} - > - Sign up - + + + + Red Bull Tracker + Track intake, sync across devices. - - {mode === "signup" && ( - - Name - setName(event.target.value)} placeholder="Ned" /> - - )} - - Email - setEmail(event.target.value)} placeholder="you@example.com" required /> - - - Password - setPassword(event.target.value)} placeholder="8+ characters" required /> - - - {authError && ( - - {authError} + + {setupStatus.state !== "ok" && ( + + {setupStatus.message} )} - - {busy ? : } - {mode === "signup" ? "Create account" : "Log in"} - - + + setMode("login")} + > + Log in + + setMode("signup")} + > + Sign up + + - - - OAuth - - + + {mode === "signup" && ( + + Name + setName(event.target.value)} placeholder="Ned" /> + + )} + + Email + setEmail(event.target.value)} placeholder="you@example.com" required /> + + + Password + setPassword(event.target.value)} placeholder="8+ characters" required /> + - - onOAuth("github")}> - - GitHub - - onOAuth("google")}> - - Google - + {authError && ( + + {authError} + + )} + + + {busy ? : } + {mode === "signup" ? "Create account" : "Log in"} + + + + + + or + + + + + onOAuth("github")}> + + Continue with GitHub + + onOAuth("google")}> + + Continue with Google + + - + ); @@ -1193,29 +1172,13 @@ function MobileNav({ activeView, onChange }: { activeView: AppView; onChange: (v } function TopBar({ - activeTheme, activeView, actionLoading, - dataLoading, - entries, - user, onAdd, - onExportExcel, - onImportExcel, - onOpenSettings, - onRefresh, }: { - activeTheme: AppTheme; activeView: AppView; actionLoading: string | null; - dataLoading: boolean; - entries: RedBullEntry[]; - user: AuthUser; onAdd: () => void; - onExportExcel: () => void; - onImportExcel: () => void; - onOpenSettings: () => void; - onRefresh: () => void; }) { const activeItem = NAV_ITEMS.find((item) => item.id === activeView) ?? NAV_ITEMS[0]; const title = activeItem.label; @@ -1226,8 +1189,6 @@ function TopBar({ month: "long", }).format(new Date()); - const [showActions, setShowActions] = useState(false); - return ( @@ -1240,86 +1201,13 @@ function TopBar({ {title} - - - {user.email || "Synced user"} - - - - - - Add Intake - - - setShowActions(!showActions)} - > - - Actions - - - - {/* Desktop actions (shown on md and up) */} - - - {dataLoading ? : } - Sync - - - - Export XLSX - - - - Import XLSX - - - - {/* Mobile actions tray (collapsible dropdown style) */} - - {showActions && ( - - { onRefresh(); setShowActions(false); }} - disabled={dataLoading} - > - {dataLoading ? : } - Sync with Cloud - - { onExportExcel(); setShowActions(false); }} - disabled={!entries.length || Boolean(actionLoading)} - > - - Export XLSX Spreadsheet - - { onImportExcel(); setShowActions(false); }} - disabled={Boolean(actionLoading)} - > - - Import XLSX Spreadsheet - - - )} - + + + Add Intake + ); @@ -2144,6 +2032,10 @@ function SettingsView({ + { typeof window !== 'undefined' && window.location.reload(); }} disabled={dataLoading}> + {dataLoading ? : } + Sync now + Export XLSX
- Soft Material You intake tracking with Appwrite authentication, device sync, and polished Excel exports. -
Track intake, sync across devices.