-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ALS-7605] Add a confirm modal to downloads (#271)
- Loading branch information
Showing
10 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { getModalStore } from '@skeletonlabs/skeleton'; | ||
const modalStore = getModalStore(); | ||
export let message: string; | ||
export let onCancel: () => void = () => modalStore.close(); | ||
export let onConfirm: () => void; | ||
export let cancelText: string = 'Cancel'; | ||
export let confirmText: string = 'Accept'; | ||
onMount(() => { | ||
if ($modalStore[0]?.meta.onCancel) { | ||
onCancel = $modalStore[0]?.meta.onCancel; | ||
} | ||
if ($modalStore[0]?.meta.onConfirm) { | ||
onConfirm = $modalStore[0]?.meta.onConfirm; | ||
} | ||
if ($modalStore[0]?.meta.confirmText) { | ||
confirmText = $modalStore[0]?.meta.confirmText; | ||
} | ||
if ($modalStore[0]?.meta.cancelText) { | ||
cancelText = $modalStore[0]?.meta.cancelText; | ||
} | ||
if ($modalStore[0]?.meta.message) { | ||
message = $modalStore[0]?.meta.message; | ||
} | ||
}); | ||
</script> | ||
|
||
<div class="flex flex-col gap-4"> | ||
<p>{message}</p> | ||
<div class="flex justify-end gap-4"> | ||
<button | ||
class="btn variant-ghost-surface hover:variant-filled-surface mt-6" | ||
on:click={() => onCancel()}>{cancelText}</button | ||
> | ||
<button | ||
class="btn variant-filled hover:variant-filled-primary mt-6" | ||
on:click={() => onConfirm()}>{confirmText}</button | ||
> | ||
</div> | ||
</div> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters