diff --git a/src/lib/atproto/methods.ts b/src/lib/atproto/methods.ts index 61b6949..b3bdc69 100644 --- a/src/lib/atproto/methods.ts +++ b/src/lib/atproto/methods.ts @@ -247,7 +247,8 @@ export async function getRecord({ } }); - 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 index e725c41..d28fef3 100644 --- a/src/lib/website/EditableProfile.svelte +++ b/src/lib/website/EditableProfile.svelte @@ -1,32 +1,17 @@
{/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 index 94b5765..784ae48 100644 --- 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 index 0000000..3cc0bcd --- /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}