diff --git a/src/lib/components/layout/SearchModal.svelte b/src/lib/components/layout/SearchModal.svelte index 1f625a1b7c..eea26842ec 100644 --- a/src/lib/components/layout/SearchModal.svelte +++ b/src/lib/components/layout/SearchModal.svelte @@ -4,7 +4,9 @@ import { toast } from 'svelte-sonner'; import { settings } from '$lib/stores'; import DropdownMenu from '$lib/components/common/DropdownMenu.svelte'; - import SettingsSelect from '$lib/components/common/SettingsSelect.svelte'; + import DropdownSub from '$lib/components/common/DropdownSub.svelte'; + import Check from '$lib/components/icons/Check.svelte'; + import ChevronRight from '$lib/components/icons/ChevronRight.svelte'; import Spinner from '$lib/components/common/Spinner.svelte'; import Loader from '$lib/components/common/Loader.svelte'; import { @@ -277,7 +279,9 @@ class="{quietButton} !h-[1.375rem] bg-gray-50/60 dark:bg-gray-800/40" on:click={() => (sharing = 'all')} aria-label={$i18n.t('Remove sharing filter')} - >{$i18n.t(sharing === 'mine' ? 'Created by you' : 'Shared with you')}{$i18n.t(sharing === 'mine' ? 'Created by you' : 'Shared with you')}{/if} {#if scope} {/if} {#if panel === 'filters'} - - - - {$i18n.t('View')}{$i18n.t('All')}{$i18n.t('Created by you')}{$i18n.t('Shared with you')} + + + + {$i18n.t('View')} + {$i18n.t( + sharing === 'all' + ? 'All' + : sharing === 'mine' + ? 'Created by you' + : 'Shared with you' + )} - - - {$i18n.t('Location')}{$i18n.t('Everywhere')}{#each scopes.filter((s) => s.kind === 'folder') as item}{item.name}{/each}{#each scopes.filter((s) => s.kind === 'channel') as item}{item.name}{/each} - - - {$i18n.t('Reset')} + + {#each [{ value: 'all', label: 'All' }, { value: 'mine', label: 'Created by you' }, { value: 'shared', label: 'Shared with you' }] as option} + { + sharing = option.value; panel = null; input.focus(); - }}>{$i18n.t('Done')} - - + {$i18n.t(option.label)} + {#if sharing === option.value}{/if} + + {/each} + + + + {$i18n.t('Location')} + {scopeName || $i18n.t('Everywhere')} + + + { + scope = ''; + panel = null; + input.focus(); + }} + > + {$i18n.t('Everywhere')}{#if !scope}{/if} + + {#each [{ kind: 'folder', label: 'Folders' }, { kind: 'channel', label: 'Channels' }] as group} + {#if scopes.some((item) => item.kind === group.kind)} + + {$i18n.t(group.label)} + + {#each scopes.filter((item) => item.kind === group.kind) as item} + { + scope = item.id; + panel = null; + input.focus(); + }} + > + {item.name}{#if scope === item.id}{/if} + + {/each} + {/if} + {/each} + + {#if kind !== 'all' || sharing !== 'all' || scope} + + {$i18n.t('Reset')} + {/if} + {/if}