diff --git a/src/components/Backdrop/index.svelte b/src/components/Backdrop/index.svelte index e9d05276..b5efb34e 100644 --- a/src/components/Backdrop/index.svelte +++ b/src/components/Backdrop/index.svelte @@ -12,7 +12,7 @@ position: fixed; align-items: center; justify-content: center; - background-color: rgba(0, 0, 0, 0.5); + background-color: rgba(0, 0, 0, 0.3); -webkit-tap-highlight-color: transparent; color: #fff; z-index: 1201; diff --git a/src/components/Confetti/index.svelte b/src/components/Confetti/index.svelte index 87b44d90..4333cada 100644 --- a/src/components/Confetti/index.svelte +++ b/src/components/Confetti/index.svelte @@ -56,7 +56,7 @@ diff --git a/src/components/Course/components/Lesson/Exercises/index.svelte b/src/components/Course/components/Lesson/Exercises/index.svelte index 725022c5..1649ca15 100644 --- a/src/components/Course/components/Lesson/Exercises/index.svelte +++ b/src/components/Course/components/Lesson/Exercises/index.svelte @@ -3,6 +3,8 @@ import { onMount } from 'svelte'; import AudioConsole32 from 'carbon-icons-svelte/lib/AudioConsole32'; import Box from '../../../../Box/index.svelte'; + import { Firework } from 'svelte-loading-spinners'; + import Backdrop from '../../../../Backdrop/index.svelte'; import PrimaryButton from '../../../../PrimaryButton/index.svelte'; import RoleBasedSecurity from '../../../../RoleBasedSecurity/index.svelte'; import PageBody from '../../../../PageBody/index.svelte'; @@ -20,6 +22,7 @@ export let lessonId; let open = false; + let isFetching = false; let newExercise = { id: 1, title: '', @@ -52,17 +55,19 @@ async function getExercises() { if (!lessonId) return; + isFetching = true; const exercisesData = await supabase .from('exercise') .select(`id, title, created_at`) .match({ lesson_id: lessonId }); $lesson.exercises = exercisesData.data; + isFetching = false; } async function getExercise(exerciseId) { if (!exerciseId) return; - + isFetching = false; isQuestionnaireFetching.update(() => true); const { data } = await supabase @@ -101,6 +106,7 @@ console.log('getExercise', exerciseId, $questionnaire); isQuestionnaireFetching.update(() => false); + isFetching = true; } function goBack() { @@ -114,6 +120,12 @@ $: getExercise(exerciseId); +{#if isFetching} + + + +{/if} + {#if exerciseId} + import { goto } from '@sapper/app'; import Modal from '../../../Modal/index.svelte'; import TextField from '../../../Form/TextField.svelte'; import TextArea from '../../../Form/TextArea.svelte'; @@ -44,6 +45,7 @@ async function handleDelete() { $settingsDialog.open = false; await deleteCourse($course.id); + goto('/courses'); } // function setAvatar(logo) { diff --git a/src/components/CourseContainer/index.svelte b/src/components/CourseContainer/index.svelte index e3ca21fd..9fe58f1f 100644 --- a/src/components/CourseContainer/index.svelte +++ b/src/components/CourseContainer/index.svelte @@ -1,5 +1,7 @@ - + + + Course Logo -
-

+ +

{title}

{description}
-

- + + diff --git a/src/components/Modal/index.svelte b/src/components/Modal/index.svelte index 829cacb9..4db19ca8 100644 --- a/src/components/Modal/index.svelte +++ b/src/components/Modal/index.svelte @@ -21,11 +21,13 @@ {#if open}