-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement delete confirmation on lesson
- Loading branch information
1 parent
278354f
commit fd43137
Showing
3 changed files
with
86 additions
and
26 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
apps/dashboard/src/lib/components/Course/components/Lesson/DeleteLessonConfirmation.svelte
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,43 @@ | ||
<script lang="ts"> | ||
import Modal from '$lib/components/Modal/index.svelte'; | ||
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte'; | ||
import { VARIANTS } from '$lib/components/PrimaryButton/constants'; | ||
export let lessonTitle: string; | ||
export let openDeleteModal = false; | ||
export let deleteLesson = () => {}; | ||
async function handleDelete() { | ||
deleteLesson(); | ||
openDeleteModal = false; | ||
} | ||
</script> | ||
|
||
<Modal | ||
onClose={() => (openDeleteModal = false)} | ||
bind:open={openDeleteModal} | ||
width="w-96" | ||
modalHeading="Delete" | ||
> | ||
<div> | ||
<h1 class="dark:text-white text-lg"> | ||
Are you sure you want to delete: <strong>{lessonTitle}</strong>? | ||
</h1> | ||
|
||
<div class="mt-5 flex items-center justify-between"> | ||
<PrimaryButton | ||
className="px-6 py-3" | ||
variant={VARIANTS.OUTLINED} | ||
label="No" | ||
onClick={() => (openDeleteModal = false)} | ||
/> | ||
<PrimaryButton | ||
className="px-6 py-3" | ||
variant={VARIANTS.OUTLINED} | ||
label="Yes" | ||
onClick={handleDelete} | ||
/> | ||
</div> | ||
</div> | ||
</Modal> |
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