feat(web): Add select all button to all views (#2714)

* Add select all to photos

* Add selection of favorites

* Add select all button to albums

* Add select all to archive

* Add select all to search

* try to fix identation

* Revert "try to fix identation"

This reverts commit 40c727b74a.

* try to fix identation

* try to fix identation

* try to fix identation

* try to fix identation

* fix bucketposition

* Run prettier

---------

Co-authored-by: Yonggan <yonggan@obco.pro>
This commit is contained in:
Yonggan
2023-06-10 21:06:13 +02:00
committed by GitHub
parent 73075c64d1
commit 9a80a2151c
7 changed files with 74 additions and 0 deletions
@@ -10,6 +10,7 @@
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import { archivedAsset } from '$lib/stores/archived-asset.store';
import { handleError } from '$lib/utils/handle-error';
import { api, AssetResponseDto } from '@api';
@@ -17,6 +18,7 @@
import DotsVertical from 'svelte-material-icons/DotsVertical.svelte';
import Plus from 'svelte-material-icons/Plus.svelte';
import type { PageData } from './$types';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
export let data: PageData;
@@ -39,6 +41,9 @@
const onAssetDelete = (assetId: string) => {
$archivedAsset = $archivedAsset.filter((a) => a.id !== assetId);
};
const handleSelectAll = () => {
selectedAssets = new Set($archivedAsset);
};
</script>
<UserPageLayout user={data.user} hideNavbar={isMultiSelectionMode} title={data.meta.title}>
@@ -57,6 +62,7 @@
clearSelect={() => (selectedAssets = new Set())}
>
<ArchiveAction unarchive onAssetArchive={(asset) => onAssetDelete(asset.id)} />
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll} />
<CreateSharedLink />
<AssetSelectContextMenu icon={Plus} title="Add">
<AddToAlbum />