feat: list view on courses page (#269)

* working on the list view

* working on the list view navigation

* worked on the list view for the course page

* worked on the list view for the course page

* clean up

* rename store

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Em_Dev
2024-04-20 14:40:44 +01:00
committed by GitHub
co-authored by Rotimi Best
parent a95be6d620
commit ec30e076bc
6 changed files with 200 additions and 28 deletions
@@ -2,6 +2,7 @@ import { writable, derived } from 'svelte/store';
import type { Course } from '$lib/utils/types';
export const courses = writable<Course[]>([]);
export const view = writable('grid');
export const coursesInProgress = derived(courses, ($courses) =>
$courses.length > 0 ? $courses.slice(0, 3) : []
);
@@ -12,8 +13,12 @@ export const coursesComplete = derived(courses, ($courses) =>
})
: []
);
export const courseMetaDeta = writable({
isLoading: true
export const courseMetaDeta = writable<{
isLoading: boolean;
view: 'grid' | 'list';
}>({
isLoading: true,
view: 'grid'
});
export const createCourseModal = writable({