Cleanup web import
This commit is contained in:
@@ -22,6 +22,6 @@
|
||||
{$confirmationPopupStore?.message}
|
||||
</h3>
|
||||
<Button color="red" class="mr-2" on:click={$confirmationPopupStore?.onConfirm}>Yes</Button>
|
||||
<Button color="alternative">No</Button>
|
||||
<Button color="alternative" on:click={$confirmationPopupStore?.onCancel}>No</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
@@ -4,13 +4,15 @@ type ConfirmationPopup = {
|
||||
open: boolean;
|
||||
message: string;
|
||||
onConfirm?: () => void;
|
||||
onCancel?: () => void;
|
||||
};
|
||||
export const confirmationPopupStore = writable<ConfirmationPopup | undefined>(undefined);
|
||||
|
||||
export function promptConfirmation(message: string, onConfirm?: () => void) {
|
||||
export function promptConfirmation(message: string, onConfirm?: () => void, onCancel?: () => void) {
|
||||
confirmationPopupStore.set({
|
||||
open: true,
|
||||
message,
|
||||
onConfirm
|
||||
onConfirm,
|
||||
onCancel
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user