misc: hide already added languages
This commit is contained in:
1 parent
98cb1992d2
commit
6334890530
4 files changed
+11
-10
No files matched your search
@@ -65,16 +65,16 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="border rounded-full border-slate-200 dark:border-zinc-800 bg-slate-50 dark:bg-zinc-950 p-1 flex items-center gap-1"
|
||||
class="border rounded-full border-slate-200 dark:border-zinc-800 bg-slate-50 dark:bg-zinc-950 p-1 flex items-center gap-1 w-max max-w-full z-0 relative overflow-auto"
|
||||
>
|
||||
{#each options as option, index}
|
||||
{@const slctd = selected == option}
|
||||
<button
|
||||
class={[
|
||||
'px-3 py-1 rounded-full text-sm font-medium transition-colors duration-75',
|
||||
'px-3 py-1 rounded-full text-sm font-medium transition-colors duration-75 relative',
|
||||
slctd
|
||||
? 'bg-primary-900 dark:bg-primary-100 text-slate-50 dark:text-zinc-900'
|
||||
: 'dark:bg-zinc-900/75 bg-white',
|
||||
: 'dark:bg-zinc-900/50 bg-white',
|
||||
]}
|
||||
onclick={(e) => {
|
||||
e.preventDefault()
|
||||
@@ -84,9 +84,9 @@
|
||||
type="button"
|
||||
>
|
||||
{optionNames[index] || option}
|
||||
{#if headless && option == selected}
|
||||
{#if slctd}
|
||||
<div
|
||||
class="absolute -bottom-1 left-0 w-full border-b-2 rounded-t-sm border-black dark:border-white"
|
||||
class="absolute left-0 top-0 w-full h-full blur-xl scale-75 opacity-50 dark:bg-primary-100 -z-10"
|
||||
></div>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
</Badge>
|
||||
</button>
|
||||
{/snippet}
|
||||
{#each $site.all_languages as language, index}
|
||||
{#each $site.all_languages.filter((l) => !formData.languages?.includes(l.id)) as language, index}
|
||||
<MenuButton
|
||||
class="min-h-[16px] py-0"
|
||||
onclick={() => {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
? {
|
||||
...data.site.site_view.local_site,
|
||||
...data.site.site_view.site,
|
||||
discussion_languages: data.site.discussion_languages,
|
||||
}
|
||||
: undefined,
|
||||
)
|
||||
@@ -245,7 +246,7 @@
|
||||
<SectionTitle>{$t('form.profile.data.languages.title')}</SectionTitle>
|
||||
<p>{$t('form.profile.data.languages.description')}</p>
|
||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||
{#if $site && formData.discussion_languages}
|
||||
{#if $site}
|
||||
<div class="flex gap-2 flex-wrap flex-row">
|
||||
<Menu class="gap-px">
|
||||
{#snippet target()}
|
||||
@@ -256,7 +257,7 @@
|
||||
</Badge>
|
||||
</button>
|
||||
{/snippet}
|
||||
{#each $site.all_languages as language, index}
|
||||
{#each $site.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language, index}
|
||||
<MenuButton
|
||||
class="min-h-[16px] py-0"
|
||||
onclick={() => {
|
||||
@@ -267,7 +268,7 @@
|
||||
</MenuButton>
|
||||
{/each}
|
||||
</Menu>
|
||||
{#each formData.discussion_languages as languageId, index}
|
||||
{#each formData.discussion_languages ?? [] as languageId, index}
|
||||
{@const language = $site.all_languages.find(
|
||||
(l) => l.id == languageId,
|
||||
)}
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
</Badge>
|
||||
</button>
|
||||
{/snippet}
|
||||
{#each $site.all_languages as language, index}
|
||||
{#each $site.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language, index}
|
||||
<MenuButton
|
||||
class="min-h-[16px] py-0"
|
||||
onclick={() => {
|
||||
|
||||
Reference in new issue
Block a user