CLASSROOMIO-T-80: Replace sapper with sveltekit

This commit is contained in:
Rotimi Best
2023-08-02 19:35:27 +01:00
parent 8ffdf319b3
commit 7dfbb05451
320 changed files with 5207 additions and 18330 deletions
+26
View File
@@ -0,0 +1,26 @@
<script>
import Overview from '$lib/components/Course/index.svelte';
import CourseContainer from '$lib/components/CourseContainer/index.svelte';
import { setCourse } from '$lib/components/Course/store';
import { fetchCourse } from '$lib/utils/services/courses';
export let data;
const { courseId } = data;
let prevCourseId = '';
async function onCourseIdChange(courseId = '') {
if (!courseId || prevCourseId === courseId) return;
const { data: _data } = await fetchCourse(courseId);
setCourse(_data);
prevCourseId = courseId;
}
$: onCourseIdChange(courseId);
</script>
<CourseContainer>
<Overview />
</CourseContainer>