From 45bbc26ff3c584d0743df088816ce0564eb2f3a5 Mon Sep 17 00:00:00 2001 From: Jake Fulmine Date: Mon, 22 Aug 2022 13:56:06 +0200 Subject: [PATCH] feat(dashboard): add system pronouns + editing (I forgot to) --- dashboard/src/api/types.ts | 1 + dashboard/src/lib/system/Body.svelte | 13 +++++++++++++ dashboard/src/lib/system/Edit.svelte | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/dashboard/src/api/types.ts b/dashboard/src/api/types.ts index 8ca724b5..02bf220d 100644 --- a/dashboard/src/api/types.ts +++ b/dashboard/src/api/types.ts @@ -19,6 +19,7 @@ export interface System { created?: string; privacy?: SystemPrivacy; color?: string; + pronouns?: string; } export interface Config { diff --git a/dashboard/src/lib/system/Body.svelte b/dashboard/src/lib/system/Body.svelte index eb593d22..eb39cf64 100644 --- a/dashboard/src/lib/system/Body.svelte +++ b/dashboard/src/lib/system/Body.svelte @@ -14,6 +14,8 @@ let htmlDescription: string; let htmlName: string; + let htmlPronouns: string; + if (user.description) { htmlDescription = toHTML(parseTimestamps(user.description), {embed: true}); } else { @@ -24,6 +26,10 @@ htmlName = toHTML(user.name); } + if (user.pronouns) { + htmlPronouns = toHTML(user.pronouns); + } + let created = moment(user.created).format("MMM D, YYYY"); let bannerOpen = false; @@ -33,11 +39,13 @@ let descriptionElement: any; let nameElement: any; let tagElement: any; + let pronounElement: any; $: if (settings && settings.appearance.twemoji) { if (descriptionElement) twemoji.parse(descriptionElement); if (nameElement) twemoji.parse(nameElement); if (tagElement) twemoji.parse(tagElement); + if (pronounElement) twemoji.parse(pronounElement); } @@ -58,6 +66,11 @@ Tag: {user.tag} {/if} + {#if user.pronouns} + + Pronouns: {@html htmlPronouns} + + {/if} {#if user.created && !isPublic} Created: {created} diff --git a/dashboard/src/lib/system/Edit.svelte b/dashboard/src/lib/system/Edit.svelte index 2f0b845e..56f1294d 100644 --- a/dashboard/src/lib/system/Edit.svelte +++ b/dashboard/src/lib/system/Edit.svelte @@ -72,6 +72,10 @@ + + + +