diff --git a/packages/frontend/src/lib/i18n/locales/en.ts b/packages/frontend/src/lib/i18n/locales/en.ts index c6c6805..84725b0 100644 --- a/packages/frontend/src/lib/i18n/locales/en.ts +++ b/packages/frontend/src/lib/i18n/locales/en.ts @@ -91,6 +91,23 @@ export default { me: { title: "Dashboard", welcome: "Welcome back, {name}", + nav: { + profile: "Profile", + security: "Security", + recordings: "Recordings", + analytics: "Analytics", + back_to_site: "← Back to site", + back_mobile: "← Back", + }, + analytics: { + title: "Analytics", + description: "Track your content performance and audience engagement", + total_videos: "Total Videos", + total_likes: "Total Likes", + total_plays: "Total Plays", + video_performance: "Video Performance", + video_performance_description: "Detailed metrics for each video", + }, view_profile: "View Public Profile", settings: { title: "Settings", diff --git a/packages/frontend/src/routes/me/+layout.server.ts b/packages/frontend/src/routes/me/+layout.server.ts new file mode 100644 index 0000000..341546d --- /dev/null +++ b/packages/frontend/src/routes/me/+layout.server.ts @@ -0,0 +1,12 @@ +import { redirect } from "@sveltejs/kit"; +import { isModel } from "$lib/api"; + +export async function load({ locals }) { + if (!locals.authStatus.authenticated) { + throw redirect(302, "/login"); + } + return { + authStatus: locals.authStatus, + isModel: isModel(locals.authStatus.user!), + }; +} diff --git a/packages/frontend/src/routes/me/+layout.svelte b/packages/frontend/src/routes/me/+layout.svelte new file mode 100644 index 0000000..89d2524 --- /dev/null +++ b/packages/frontend/src/routes/me/+layout.svelte @@ -0,0 +1,112 @@ + + +
+
+ +
+
+ + {$_("me.nav.back_mobile")} + + {#each navLinks as link (link.href)} + + + + + {/each} +
+
+ + +
+ + + + +
+ {@render children()} +
+
+
+
diff --git a/packages/frontend/src/routes/me/+page.server.ts b/packages/frontend/src/routes/me/+page.server.ts index 04741dc..17cef2d 100644 --- a/packages/frontend/src/routes/me/+page.server.ts +++ b/packages/frontend/src/routes/me/+page.server.ts @@ -1,25 +1,4 @@ import { redirect } from "@sveltejs/kit"; -import { getAnalytics, getFolders, getRecordings } from "$lib/services"; -import { isModel } from "$lib/api"; - -export async function load({ locals, fetch }) { - // Redirect to login if not authenticated - if (!locals.authStatus.authenticated) { - throw redirect(302, "/login"); - } - - const recordings = await getRecordings(fetch).catch(() => []); - - const analytics = isModel(locals.authStatus.user!) - ? await getAnalytics(fetch).catch(() => null) - : null; - - const folders = await getFolders(fetch).catch(() => []); - - return { - authStatus: locals.authStatus, - folders, - recordings, - analytics, - }; +export function load() { + throw redirect(302, "/me/profile"); } diff --git a/packages/frontend/src/routes/me/+page.svelte b/packages/frontend/src/routes/me/+page.svelte index fd1c8f9..e69de29 100644 --- a/packages/frontend/src/routes/me/+page.svelte +++ b/packages/frontend/src/routes/me/+page.svelte @@ -1,690 +0,0 @@ - - - - -
- -
- -
-
-

{$_("me.title")}

-

- {$_("me.welcome", { values: { name: data.authStatus.user!.artist_name } })} -

-
- {#if isModel(data.authStatus.user!)} - - {/if} -
- - - - - - - {$_("me.settings.title")} - - - - {$_("me.recordings.title")} - - {#if data.analytics} - - - Analytics - - {/if} - - - - -
- - - - {$_("me.settings.profile_title")} - {$_("me.settings.profile_subtitle")} - - -
-
- -
- -
- {#if avatar} - {avatar.name} -
- -
- {:else} -
- - Upload -
- {/if} -
-
-
-

JPG, PNG · max 2 MB

-

- Click or drop to {avatar ? "change" : "upload"} -

- {#if avatar} - - {/if} -
-
-
- -
-
- - -
-
- - -
-
-
- - -
-
- -