Files
classroomio/src/components/Courses/index.svelte
T

34 lines
892 B
Svelte
Raw Normal View History

2021-05-06 08:22:25 +03:00
<script>
2021-08-29 07:23:19 +03:00
import Box from '../Box/index.svelte';
import { Moon } from 'svelte-loading-spinners';
2021-08-29 07:23:19 +03:00
import Card from './components/Card/index.svelte';
2021-12-30 22:30:30 +02:00
import CopyCourseModal from './components/CopyCourseModal/index.svelte';
import { courses, courseMetaDeta } from './store';
2021-05-06 08:22:25 +03:00
</script>
2021-12-30 22:30:30 +02:00
<CopyCourseModal />
2021-09-17 06:33:49 +03:00
<div
class="flex items-center justify-center lg:justify-start flex-wrap my-4 m-auto"
>
2021-12-30 22:30:30 +02:00
{#if $courseMetaDeta.isLoading}
2021-08-29 07:23:19 +03:00
<Box>
<Moon size="60" color="#1d4ed8" unit="px" duration="1s" />
2021-08-29 07:23:19 +03:00
</Box>
2021-12-30 22:30:30 +02:00
{:else}
{#each $courses as courseData}
<Card
id={courseData.id}
logo={courseData.logo}
title={courseData.title}
description={courseData.description}
role_id={courseData.role_id}
/>
{:else}
<Box>
<h3 class="text-2xl text-gray-500">No Course Assigned</h3>
</Box>
{/each}
{/if}
2021-05-07 03:43:37 +03:00
</div>