diff --git a/frontend/src/routes/@[username]/+page.svelte b/frontend/src/routes/@[username]/+page.svelte index 0492ad2..ca29cbc 100644 --- a/frontend/src/routes/@[username]/+page.svelte +++ b/frontend/src/routes/@[username]/+page.svelte @@ -164,7 +164,7 @@ {#if $userStore && $userStore.id === data.id} You are currently viewing your public profile. -
Edit your profile +
Edit your profile
{/if}
diff --git a/frontend/src/routes/edit/profile/+layout.svelte b/frontend/src/routes/@[username]/edit/+layout.svelte similarity index 81% rename from frontend/src/routes/edit/profile/+layout.svelte rename to frontend/src/routes/@[username]/edit/+layout.svelte index 59a8f95..6bcb23b 100644 --- a/frontend/src/routes/edit/profile/+layout.svelte +++ b/frontend/src/routes/@[username]/edit/+layout.svelte @@ -80,13 +80,13 @@ {/if}
diff --git a/frontend/src/routes/edit/profile/+layout.ts b/frontend/src/routes/@[username]/edit/+layout.ts similarity index 100% rename from frontend/src/routes/edit/profile/+layout.ts rename to frontend/src/routes/@[username]/edit/+layout.ts diff --git a/frontend/src/routes/@[username]/edit/+page.svelte b/frontend/src/routes/@[username]/edit/+page.svelte new file mode 100644 index 0000000..e727633 --- /dev/null +++ b/frontend/src/routes/@[username]/edit/+page.svelte @@ -0,0 +1,143 @@ + + +
+
+
+
+ {#if $user.avatar === ""} + + {:else if $user.avatar} + New avatar + {:else} + + {/if} +
+
+ +

+ Only PNG, JPEG, GIF, and WebP images can be used + as avatars. Avatars cannot be larger than 1 MB, and animated avatars will be made static. +

+

+ + ($user.avatar = "")}>Remove avatar +

+
+
+
+
+ + +

+ + You can change your username in + your settings. +

+
+ + +

+ + Your display name is used in page titles and as a header. +

+
+
+
+
+

Names

+ {#each $user.names as _, index} + moveName(index, true)} + moveDown={() => moveName(index, false)} + remove={() => removeName(index)} + /> + {/each} +
+ + + +
diff --git a/frontend/src/routes/edit/profile/bio/+page.svelte b/frontend/src/routes/@[username]/edit/bio/+page.svelte similarity index 100% rename from frontend/src/routes/edit/profile/bio/+page.svelte rename to frontend/src/routes/@[username]/edit/bio/+page.svelte diff --git a/frontend/src/routes/edit/profile/fields/+page.svelte b/frontend/src/routes/@[username]/edit/fields/+page.svelte similarity index 100% rename from frontend/src/routes/edit/profile/fields/+page.svelte rename to frontend/src/routes/@[username]/edit/fields/+page.svelte diff --git a/frontend/src/routes/edit/profile/flags/+page.svelte b/frontend/src/routes/@[username]/edit/flags/+page.svelte similarity index 100% rename from frontend/src/routes/edit/profile/flags/+page.svelte rename to frontend/src/routes/@[username]/edit/flags/+page.svelte diff --git a/frontend/src/routes/edit/profile/links/+page.svelte b/frontend/src/routes/@[username]/edit/links/+page.svelte similarity index 100% rename from frontend/src/routes/edit/profile/links/+page.svelte rename to frontend/src/routes/@[username]/edit/links/+page.svelte diff --git a/frontend/src/routes/edit/profile/other/+page.svelte b/frontend/src/routes/@[username]/edit/other/+page.svelte similarity index 100% rename from frontend/src/routes/edit/profile/other/+page.svelte rename to frontend/src/routes/@[username]/edit/other/+page.svelte diff --git a/frontend/src/routes/edit/profile/other/CustomPreference.svelte b/frontend/src/routes/@[username]/edit/other/CustomPreference.svelte similarity index 100% rename from frontend/src/routes/edit/profile/other/CustomPreference.svelte rename to frontend/src/routes/@[username]/edit/other/CustomPreference.svelte diff --git a/frontend/src/routes/edit/profile/other/IconPicker.svelte b/frontend/src/routes/@[username]/edit/other/IconPicker.svelte similarity index 100% rename from frontend/src/routes/edit/profile/other/IconPicker.svelte rename to frontend/src/routes/@[username]/edit/other/IconPicker.svelte diff --git a/frontend/src/routes/edit/profile/pronouns/+page.svelte b/frontend/src/routes/@[username]/edit/pronouns/+page.svelte similarity index 100% rename from frontend/src/routes/edit/profile/pronouns/+page.svelte rename to frontend/src/routes/@[username]/edit/pronouns/+page.svelte diff --git a/frontend/src/routes/edit/profile/+page.svelte b/frontend/src/routes/edit/profile/+page.svelte index e727633..a8beed5 100644 --- a/frontend/src/routes/edit/profile/+page.svelte +++ b/frontend/src/routes/edit/profile/+page.svelte @@ -1,143 +1 @@ - - -
-
-
-
- {#if $user.avatar === ""} - - {:else if $user.avatar} - New avatar - {:else} - - {/if} -
-
- -

- Only PNG, JPEG, GIF, and WebP images can be used - as avatars. Avatars cannot be larger than 1 MB, and animated avatars will be made static. -

-

- - ($user.avatar = "")}>Remove avatar -

-
-
-
-
- - -

- - You can change your username in - your settings. -

-
- - -

- - Your display name is used in page titles and as a header. -

-
-
-
-
-

Names

- {#each $user.names as _, index} - moveName(index, true)} - moveDown={() => moveName(index, false)} - remove={() => removeName(index)} - /> - {/each} -
- - - -
+
diff --git a/frontend/src/routes/edit/profile/+page.ts b/frontend/src/routes/edit/profile/+page.ts new file mode 100644 index 0000000..1e8be0c --- /dev/null +++ b/frontend/src/routes/edit/profile/+page.ts @@ -0,0 +1,11 @@ +import type { MeUser } from "$lib/api/entities"; +import { apiFetchClient } from "$lib/api/fetch"; +import { redirect } from "@sveltejs/kit"; + +export const ssr = false; + +export const load = async () => { + const resp = await apiFetchClient(`/users/@me`); + + throw redirect(303, `/@${resp.name}/edit`); +};