feat(web) Add drag n drop upload functionality (#1216)

* Add image drag n drop functionality

* Change upload cover name, background color and opacity
This commit is contained in:
Krisjanis Lejejs
2022-12-30 04:07:18 +02:00
committed by GitHub
parent 6736063f83
commit 10b0924cfb
11 changed files with 159 additions and 177 deletions

View File

@@ -9,7 +9,7 @@
import type { PageData } from './$types';
import { openFileUploadDialog, UploadType } from '$lib/utils/file-uploader';
import { openFileUploadDialog } from '$lib/utils/file-uploader';
import {
assetInteractionStore,
isMultiSelectStoreState,
@@ -26,6 +26,7 @@
NotificationType
} from '$lib/components/shared-components/notification/notification';
import { assetStore } from '$lib/stores/assets.store';
import { addAssetsToAlbum } from '$lib/utils/asset-utils';
export let data: PageData;
@@ -100,12 +101,8 @@
const album = event.detail.album;
const assetIds = Array.from($selectedAssets).map((asset) => asset.id);
api.albumApi.addAssetsToAlbum(album.id, { assetIds }).then(({ data: dto }) => {
notificationController.show({
message: `Added ${dto.successfullyAdded} to ${dto.album?.albumName}`,
type: NotificationType.Info
});
addAssetsToAlbum(album.id, assetIds).then(() => {
assetInteractionStore.clearMultiselect();
});
};
@@ -137,10 +134,7 @@
</svelte:fragment>
</ControlAppBar>
{:else}
<NavigationBar
user={data.user}
on:uploadClicked={() => openFileUploadDialog(UploadType.GENERAL)}
/>
<NavigationBar user={data.user} on:uploadClicked={() => openFileUploadDialog()} />
{/if}
{#if isShowAddMenu}