mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-27 05:51:56 +00:00
feat: add delete button for cached files
This commit is contained in:
parent
3f22192835
commit
7c209ebbbc
5 changed files with 29 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||||
import { apiUploadCoverLetter } from '$lib/@api/candidate';
|
import { apiDeleteCoverLetter, apiUploadCoverLetter } from '$lib/@api/candidate';
|
||||||
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
||||||
|
|
||||||
const onFileDrop = async (detail: any) => {
|
const onFileDrop = async (detail: any) => {
|
||||||
|
|
@ -9,10 +9,16 @@
|
||||||
await apiUploadCoverLetter(file, callback);
|
await apiUploadCoverLetter(file, callback);
|
||||||
await fetchSubmProgress();
|
await fetchSubmProgress();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onDelete = async () => {
|
||||||
|
await apiDeleteCoverLetter();
|
||||||
|
await fetchSubmProgress();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<DashboardUploadCard
|
<DashboardUploadCard
|
||||||
on:filedrop={(e) => onFileDrop(e.detail)}
|
on:filedrop={(e) => onFileDrop(e.detail)}
|
||||||
|
on:delete={onDelete}
|
||||||
title="Motivační dopis"
|
title="Motivační dopis"
|
||||||
filetype="PDF"
|
filetype="PDF"
|
||||||
filesize={10}
|
filesize={10}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,13 @@
|
||||||
<div class="mb-4 mt-1 sm:mb-0 sm:mt-0">
|
<div class="mb-4 mt-1 sm:mb-0 sm:mt-0">
|
||||||
<FileType {filetype} filesize={filesize + ' MB'} />
|
<FileType {filetype} filesize={filesize + ' MB'} />
|
||||||
</div>
|
</div>
|
||||||
<div class="absolute right-0 top-4 px-7">
|
<div class="absolute right-0 top-4 flex items-center px-7">
|
||||||
|
{#if status === 'uploaded'}
|
||||||
|
<button
|
||||||
|
class="mr-3 rounded-xl bg-[#ef8b46] py-0.5 px-2 text-white shadow-md transition-all duration-300 hover:bg-orange-400"
|
||||||
|
on:click={() => dispatch('delete')}>Smazat</button
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
<StatusNotificationDot {status} />
|
<StatusNotificationDot {status} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||||
import { apiUploadPortfolioLetter } from '../../@api/candidate';
|
import { apiDeletePortfolioLetter, apiUploadPortfolioLetter } from '../../@api/candidate';
|
||||||
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
||||||
|
|
||||||
const onFileDrop = async (detail: any) => {
|
const onFileDrop = async (detail: any) => {
|
||||||
|
|
@ -9,10 +9,16 @@
|
||||||
await apiUploadPortfolioLetter(file, callback);
|
await apiUploadPortfolioLetter(file, callback);
|
||||||
await fetchSubmProgress();
|
await fetchSubmProgress();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onDelete = async () => {
|
||||||
|
await apiDeletePortfolioLetter();
|
||||||
|
await fetchSubmProgress();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<DashboardUploadCard
|
<DashboardUploadCard
|
||||||
on:filedrop={(e) => onFileDrop(e.detail)}
|
on:filedrop={(e) => onFileDrop(e.detail)}
|
||||||
|
on:delete={onDelete}
|
||||||
title="Portfolio"
|
title="Portfolio"
|
||||||
filetype="PDF"
|
filetype="PDF"
|
||||||
filesize={10}
|
filesize={10}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||||
import { apiUploadPortfolioZip } from '$lib/@api/candidate';
|
import { apiDeletePortfolioZip, apiUploadPortfolioZip } from '$lib/@api/candidate';
|
||||||
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
||||||
|
|
||||||
const onFileDrop = async (detail: any) => {
|
const onFileDrop = async (detail: any) => {
|
||||||
|
|
@ -9,10 +9,16 @@
|
||||||
await apiUploadPortfolioZip(file, callback);
|
await apiUploadPortfolioZip(file, callback);
|
||||||
await fetchSubmProgress();
|
await fetchSubmProgress();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onDelete = async () => {
|
||||||
|
await apiDeletePortfolioZip();
|
||||||
|
await fetchSubmProgress();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<DashboardUploadCard
|
<DashboardUploadCard
|
||||||
on:filedrop={(e) => onFileDrop(e.detail)}
|
on:filedrop={(e) => onFileDrop(e.detail)}
|
||||||
|
on:delete={onDelete}
|
||||||
title="Další data"
|
title="Další data"
|
||||||
filetype="ZIP"
|
filetype="ZIP"
|
||||||
filesize={100}
|
filesize={100}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<!-- make red dot -->
|
<!-- make red dot -->
|
||||||
<div class="flex animate-pulse flex-row justify-between div-{status}">
|
<div class="flex animate-pulse flex-row justify-between div-{status}">
|
||||||
<span class="mt-1 h-6 w-6 rounded-full {status}" />
|
<span class="h-6 w-6 rounded-full {status}" />
|
||||||
<!-- <h3 class="ml-8 font-bold text-xl">{title}</h3> -->
|
<!-- <h3 class="ml-8 font-bold text-xl">{title}</h3> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue