forge
Explore
Log in

Don't you dare go Hollow

🧹 remove /profile page (replaced by dialog)

Browse files at this commit

922f9544769f5f724abbcd82e4d1ebc2576e3554Burak BoduroğluParent: 4699896
  • chore
    • 🧹 remove /profile page (replaced by dialog)
Show full message
chore: 🧹 remove /profile page (replaced by dialog)

- profile-page: deleted (edit profile now uses AccountProfileDialog)
- router: remove profileRoute registration + lazy import
- app-shell: remove profile breadcrumb
src/components/layout/app-shell.tsxmodified+0 -1
@@ -48,7 +48,6 @@ export function AppShell(props: ParentProps) {
4848 if (path === "/management/settings") return `${t("nav.group.settings")} / ${t("nav.settings")}`;
4949 if (path === "/management/terms") return `${t("nav.group.settings")} / ${t("nav.terms")}`;
5050 if (path === "/admin/users") return `${t("nav.admin")} / ${t("nav.users")}`;
51- if (path === "/profile") return `${t("nav.account")} / ${t("nav.preferences")}`;
5251 if (path === "/guide") return t("nav.guide");
5352 return path;
5453 });
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"));
4141 const StudentAttendancePage = lazyRoute(() => import("@/pages/student-attendance-page"));
4242 const WorkLogPage = lazyRoute(() => import("@/pages/work-log-page"));
4343 const StaffWorkPage = lazyRoute(() => import("@/pages/staff-work-page"));
44-const ProfilePage = lazyRoute(() => import("@/pages/profile-page"));
4544 const LiveMonitorPage = lazyRoute(() => import("@/pages/live-monitor-page"));
4645 const AdminUsersPage = lazyRoute(() => import("@/pages/admin-users-page"));
4746 const SettingsPage = lazyRoute(() => import("@/pages/settings-page"));
@@ -222,12 +221,6 @@ const liveMonitorRoute = createRoute({
222221 component: LiveMonitorPage,
223222 });
224223
225-const profileRoute = createRoute({
226- getParentRoute: () => rootRoute,
227- path: "/profile",
228- component: ProfilePage,
229-});
230-
231224 const adminUsersRoute = createRoute({
232225 getParentRoute: () => rootRoute,
233226 path: "/admin/users",
@@ -266,7 +259,6 @@ const routeTree = rootRoute.addChildren([
266259 staffWorkRoute,
267260 settingsRoute,
268261 termsRoute,
269- profileRoute,
270262 adminUsersRoute,
271263 guideRoute,
272264 ]);