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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user