From e8d45ed4e93bd3d4ffa40d8226f48152df0bb94a Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 13 Mar 2023 01:08:46 +0100 Subject: [PATCH] feat(frontend): add names+pronouns to edit profile page, add robots.txt --- .../src/routes/@[username]/+page.server.ts | 2 - .../routes/auth/login/discord/+page.server.ts | 4 +- frontend/src/routes/edit/profile/+page.svelte | 169 +++++++++++++++--- frontend/static/robots.txt | 5 + 4 files changed, 153 insertions(+), 27 deletions(-) create mode 100644 frontend/static/robots.txt diff --git a/frontend/src/routes/@[username]/+page.server.ts b/frontend/src/routes/@[username]/+page.server.ts index 22e1960..9a4c26f 100644 --- a/frontend/src/routes/@[username]/+page.server.ts +++ b/frontend/src/routes/@[username]/+page.server.ts @@ -14,8 +14,6 @@ export const load = async ({ params }) => { throw error(404, (e as APIError).message); } - console.log(e); - throw e; } }; diff --git a/frontend/src/routes/auth/login/discord/+page.server.ts b/frontend/src/routes/auth/login/discord/+page.server.ts index 740922e..472ca94 100644 --- a/frontend/src/routes/auth/login/discord/+page.server.ts +++ b/frontend/src/routes/auth/login/discord/+page.server.ts @@ -3,7 +3,7 @@ import { apiFetch } from "$lib/api/fetch"; import type { PageServerLoad, Actions } from "./$types"; import { PUBLIC_BASE_URL } from "$env/static/public"; -export const load = (async ({ locals, url }) => { +export const load = (async ({ url }) => { try { const resp = await apiFetch("/auth/discord/callback", { method: "POST", @@ -18,8 +18,6 @@ export const load = (async ({ locals, url }) => { ...resp, }; } catch (e) { - console.log(e); - return { error: e as APIError }; } }) satisfies PageServerLoad; diff --git a/frontend/src/routes/edit/profile/+page.svelte b/frontend/src/routes/edit/profile/+page.svelte index a786bdc..94ef8fa 100644 --- a/frontend/src/routes/edit/profile/+page.svelte +++ b/frontend/src/routes/edit/profile/+page.svelte @@ -1,9 +1,16 @@ + + Edit profile - pronouns.cc + +

Edit profile {#if modified} @@ -167,13 +187,9 @@ Error: No user object {:else}
-
+
- - - - To change your username, go to settings. -

Avatar

+

Avatar

{#if avatar} @@ -198,5 +214,114 @@
+
+
+

Names

+ {#each names as _, index} +
+ + + + + + + + + +
+ {/each} +
+
+
+
+

Pronouns

+ {#each pronouns as _, index} +
+ + + + + + + + + + +
+ {/each} +
+
{/if} diff --git a/frontend/static/robots.txt b/frontend/static/robots.txt new file mode 100644 index 0000000..496b815 --- /dev/null +++ b/frontend/static/robots.txt @@ -0,0 +1,5 @@ +User-agent: * +Disallow: /@* +Disallow: /auth +Disallow: /settings +Disallow: /edit