mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web): album listing page (#4146)
* feat: add more options to album page * pr feedback * pr feedback * feat: add quick actions on the list mode * feat: responsive design * feat: remove dropdown for display mode * pr feedback
This commit is contained in:
parent
dd86aa9259
commit
b8fec26115
5 changed files with 260 additions and 50 deletions
|
|
@ -4,13 +4,12 @@
|
|||
import { clickOutside } from '$lib/utils/click-outside';
|
||||
import { fly } from 'svelte/transition';
|
||||
import type Icon from 'svelte-material-icons/DotsVertical.svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
interface DropdownOption {
|
||||
value: string;
|
||||
icon?: Icon;
|
||||
}
|
||||
|
||||
export let options: DropdownOption[] | string[] = [];
|
||||
const dispatch = createEventDispatcher<{
|
||||
select: string;
|
||||
}>();
|
||||
export let options: string[];
|
||||
export let value = options[0];
|
||||
export let icons: (typeof Icon)[] | undefined = undefined;
|
||||
|
||||
|
|
@ -21,7 +20,12 @@
|
|||
};
|
||||
|
||||
const handleSelectOption = (index: number) => {
|
||||
value = options[index];
|
||||
if (options[index] === value) {
|
||||
dispatch('select', value);
|
||||
} else {
|
||||
value = options[index];
|
||||
}
|
||||
|
||||
showMenu = false;
|
||||
};
|
||||
|
||||
|
|
@ -36,7 +40,7 @@
|
|||
{#if icon}
|
||||
<svelte:component this={icon} size="18" />
|
||||
{/if}
|
||||
{value}
|
||||
<p class="hidden sm:block">{value}</p>
|
||||
</div>
|
||||
</LinkButton>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue