🧹 remove /profile page (replaced by dialog)
Browse files at this commit922f9544769f5f724abbcd82e4d1ebc2576e3554Parent: 4699896- chore
- 🧹 remove /profile page (replaced by dialog)
3 changed files +0 -96
- src/components/layout/app-shell.tsx +0 -1
- src/pages/profile-page.tsx +0 -87
- src/routes/router.tsx +0 -8
src/components/layout/app-shell.tsxmodified+0 -1
| @@ -48,7 +48,6 @@ export function AppShell(props: ParentProps) { | ||
| 48 | 48 | if (path === "/management/settings") return `${t("nav.group.settings")} / ${t("nav.settings")}`; |
| 49 | 49 | if (path === "/management/terms") return `${t("nav.group.settings")} / ${t("nav.terms")}`; |
| 50 | 50 | if (path === "/admin/users") return `${t("nav.admin")} / ${t("nav.users")}`; |
| 51 | - if (path === "/profile") return `${t("nav.account")} / ${t("nav.preferences")}`; | |
| 52 | 51 | if (path === "/guide") return t("nav.guide"); |
| 53 | 52 | return path; |
| 54 | 53 | }); |
src/pages/profile-page.tsxdeleted+0 -87
| @@ -1,87 +0,0 @@ | ||
| 1 | -import { Show, Suspense } from "solid-js"; | |
| 2 | -import type { Role } from "@/api/types"; | |
| 3 | -import { ProfileForm } from "@/components/users/profile-form"; | |
| 4 | -import { RouteGuard } from "@/components/layout/route-guard"; | |
| 5 | -import { PageHeader } from "@/components/layout/page-header"; | |
| 6 | -import { PageSpinner } from "@/components/ui/page-spinner"; | |
| 7 | -import type { MessageKey } from "@/i18n/messages"; | |
| 8 | -import { useAuth } from "@/stores/auth-context"; | |
| 9 | -import { useT } from "@/stores/preferences-context"; | |
| 10 | - | |
| 11 | -const ROLE_KEY: Record<Role, MessageKey> = { | |
| 12 | - student: "role.student", | |
| 13 | - teacher: "role.teacher", | |
| 14 | - manager: "role.manager", | |
| 15 | - admin: "role.admin", | |
| 16 | -}; | |
| 17 | - | |
| 18 | -export default function ProfilePage() { | |
| 19 | - return ( | |
| 20 | - <RouteGuard> | |
| 21 | - <ProfileContent /> | |
| 22 | - </RouteGuard> | |
| 23 | - ); | |
| 24 | -} | |
| 25 | - | |
| 26 | -function ProfileContent() { | |
| 27 | - const auth = useAuth(); | |
| 28 | - const t = useT(); | |
| 29 | - | |
| 30 | - return ( | |
| 31 | - <Suspense fallback={<PageSpinner />}> | |
| 32 | - <Show when={auth.user()}> | |
| 33 | - {(u) => ( | |
| 34 | - <div class="space-y-6"> | |
| 35 | - <PageHeader | |
| 36 | - accent="mint" | |
| 37 | - eyebrow={t("nav.account")} | |
| 38 | - title={u().username} | |
| 39 | - description={t(ROLE_KEY[u().role])} | |
| 40 | - /> | |
| 41 | - | |
| 42 | - <div class="grid gap-6 lg:grid-cols-2"> | |
| 43 | - <section class="surface-card p-5"> | |
| 44 | - <div class="mb-4"> | |
| 45 | - <h2 class="font-display text-lg font-semibold">{t("profile.edit")}</h2> | |
| 46 | - <p class="mt-1 text-sm text-muted-foreground">{t("nav.account")}</p> | |
| 47 | - </div> | |
| 48 | - <ProfileForm | |
| 49 | - user={u()} | |
| 50 | - onSaved={async () => { | |
| 51 | - await auth.refresh(); | |
| 52 | - }} | |
| 53 | - /> | |
| 54 | - </section> | |
| 55 | - | |
| 56 | - <section class="surface-card space-y-4 p-5"> | |
| 57 | - <h2 class="font-display text-lg font-semibold">{t("nav.account")}</h2> | |
| 58 | - <div class="grid gap-3 text-sm"> | |
| 59 | - <div class="rounded-lg border bg-background/60 p-3"> | |
| 60 | - <p class="text-xs text-muted-foreground">{t("profile.name")}</p> | |
| 61 | - <p class="mt-1 font-medium">{u().name || "—"}</p> | |
| 62 | - </div> | |
| 63 | - <div class="rounded-lg border bg-background/60 p-3"> | |
| 64 | - <p class="text-xs text-muted-foreground">{t("profile.surname")}</p> | |
| 65 | - <p class="mt-1 font-medium">{u().surname || "—"}</p> | |
| 66 | - </div> | |
| 67 | - <div class="rounded-lg border bg-background/60 p-3"> | |
| 68 | - <p class="text-xs text-muted-foreground">{t("profile.email")}</p> | |
| 69 | - <p class="mt-1 font-medium">{u().email || "—"}</p> | |
| 70 | - </div> | |
| 71 | - <div class="rounded-lg border bg-background/60 p-3"> | |
| 72 | - <p class="text-xs text-muted-foreground">{t("profile.phone")}</p> | |
| 73 | - <p class="mt-1 font-medium">{u().phone || "—"}</p> | |
| 74 | - </div> | |
| 75 | - <div class="rounded-lg border bg-background/60 p-3"> | |
| 76 | - <p class="text-xs text-muted-foreground">{t("profile.birthDate")}</p> | |
| 77 | - <p class="mt-1 font-medium">{u().birth_date || "—"}</p> | |
| 78 | - </div> | |
| 79 | - </div> | |
| 80 | - </section> | |
| 81 | - </div> | |
| 82 | - </div> | |
| 83 | - )} | |
| 84 | - </Show> | |
| 85 | - </Suspense> | |
| 86 | - ); | |
| 87 | -} |
src/routes/router.tsxmodified+0 -8
| @@ -41,7 +41,6 @@ const AttendancePage = lazyRoute(() => import("@/pages/attendance-page")); | ||
| 41 | 41 | const StudentAttendancePage = lazyRoute(() => import("@/pages/student-attendance-page")); |
| 42 | 42 | const WorkLogPage = lazyRoute(() => import("@/pages/work-log-page")); |
| 43 | 43 | const StaffWorkPage = lazyRoute(() => import("@/pages/staff-work-page")); |
| 44 | -const ProfilePage = lazyRoute(() => import("@/pages/profile-page")); | |
| 45 | 44 | const LiveMonitorPage = lazyRoute(() => import("@/pages/live-monitor-page")); |
| 46 | 45 | const AdminUsersPage = lazyRoute(() => import("@/pages/admin-users-page")); |
| 47 | 46 | const SettingsPage = lazyRoute(() => import("@/pages/settings-page")); |
| @@ -222,12 +221,6 @@ const liveMonitorRoute = createRoute({ | ||
| 222 | 221 | component: LiveMonitorPage, |
| 223 | 222 | }); |
| 224 | 223 | |
| 225 | -const profileRoute = createRoute({ | |
| 226 | - getParentRoute: () => rootRoute, | |
| 227 | - path: "/profile", | |
| 228 | - component: ProfilePage, | |
| 229 | -}); | |
| 230 | - | |
| 231 | 224 | const adminUsersRoute = createRoute({ |
| 232 | 225 | getParentRoute: () => rootRoute, |
| 233 | 226 | path: "/admin/users", |
| @@ -266,7 +259,6 @@ const routeTree = rootRoute.addChildren([ | ||
| 266 | 259 | staffWorkRoute, |
| 267 | 260 | settingsRoute, |
| 268 | 261 | termsRoute, |
| 269 | - profileRoute, | |
| 270 | 262 | adminUsersRoute, |
| 271 | 263 | guideRoute, |
| 272 | 264 | ]); |