From 24db54d65d091c9dbdf695f1d718f2825195813c Mon Sep 17 00:00:00 2001 From: Florian <45694132+flo-bit@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:08:44 +0000 Subject: [PATCH] some styling updates, move editing into modal --- src/lib/atproto/methods.ts | 3 ++- src/lib/website/EditableProfile.svelte | 141 ++++----------------------------------------------------------------------------------------------------------------------------------------- src/lib/website/Profile.svelte | 7 +++---- src/lib/website/Pronouns.svelte | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 file(s) changed, 152 insertion(s)(+), 142 deletion(s)(-) diff --git a/src/lib/atproto/methods.ts b/src/lib/atproto/methods.ts --- a/src/lib/atproto/methods.ts +++ b/src/lib/atproto/methods.ts @@ -247,7 +247,8 @@ } }); - if (!record.ok) throw new Error((record.data as { message?: string })?.message ?? 'Record not found'); + if (!record.ok) + throw new Error((record.data as { message?: string })?.message ?? 'Record not found'); return JSON.parse(JSON.stringify(record.data)); } diff --git a/src/lib/website/EditableProfile.svelte b/src/lib/website/EditableProfile.svelte --- a/src/lib/website/EditableProfile.svelte +++ b/src/lib/website/EditableProfile.svelte @@ -1,32 +1,17 @@ @@ -185,90 +135,7 @@ {/if} - {#if editingPronouns} -
-
- {#each pronounSets as set, i (i)} -
0 && 'opacity-40' - ]} - > - updateSetInput(i, e.currentTarget.value)} - placeholder="e.g. she/her" - class="bg-base-100 dark:bg-base-800 text-base-600 dark:text-base-300 w-full rounded px-2 py-1 text-sm outline-none" - /> - {#if pronounSets.length > 1} - - {/if} -
- {/each} -
- {#if pronounSets.length > 1} -
- { - displayMode = checked ? 'firstOnly' : 'all'; - updatePronouns(); - }} - class="scale-75" - /> - -
- {/if} -
- {#if pronounSets.length < 10} - - {/if} - -
-
- {:else} - - {/if} +
diff --git a/src/lib/website/Profile.svelte b/src/lib/website/Profile.svelte --- a/src/lib/website/Profile.svelte +++ b/src/lib/website/Profile.svelte @@ -7,6 +7,7 @@ import { qrOverlay } from '$lib/components/qr/qrOverlay.svelte'; import MadeWithBlento from './MadeWithBlento.svelte'; import { Avatar } from '@foxui/core'; + import Pronouns from './Pronouns.svelte'; let { data, @@ -61,10 +62,8 @@ {getName(data)}
- {#if data.pronouns} -
- {data.pronouns} -
+ {#if data.pronounsRecord?.value?.sets?.length} + {/if}
diff --git a/src/lib/website/Pronouns.svelte b/src/lib/website/Pronouns.svelte new file mode 100644 --- /dev/null +++ b/src/lib/website/Pronouns.svelte @@ -0,0 +1,143 @@ + + +{#if sets.length} +
+ {#each sets as set, i (i)} + {set.forms.join('/')} + {/each} +
+{/if} + +{#if editing} + + + (modalOpen = v)} closeButton> +
+

Edit pronouns

+ +
+ {#each editSets as set, i (i)} +
+ updateSetInput(i, e.currentTarget.value)} + placeholder="e.g. she/her" + variant="secondary" + sizeVariant="sm" + class="grow" + /> + {#if editSets.length > 1} + + {/if} +
+ {/each} +
+ + {#if editSets.length < 10} + + {/if} + + {#if editSets.length > 1} +
+ { + editDisplayMode = checked ? 'firstOnly' : 'all'; + }} + /> + +
+ {/if} + +
+ + +
+
+
+{/if} -- tangled.sh