2021-07-10 19:16:10 +00:00
|
|
|
<script>
|
2022-12-30 13:08:54 +01:00
|
|
|
import { Moon } from 'svelte-loading-spinners';
|
2021-07-14 09:05:09 +03:00
|
|
|
import Navigation from '../Course/components/Navigation/index.svelte';
|
2021-12-30 22:30:30 +02:00
|
|
|
import Backdrop from '../../components/Backdrop/index.svelte';
|
2021-08-18 19:47:02 +03:00
|
|
|
// import { lessons, lesson } from '../Course/components/Lesson/store/lessons';
|
|
|
|
|
// import { questionnaire } from '../Course/components/Lesson/Exercise/store/exercise';
|
|
|
|
|
// import { questionnaireMetaData } from '../Course/components/Lesson/store/answers';
|
2021-09-19 20:01:54 +03:00
|
|
|
import { course, group } from '../Course/store';
|
2021-08-18 19:47:02 +03:00
|
|
|
import Confetti from '../Confetti/index.svelte';
|
2021-09-17 06:33:49 +03:00
|
|
|
import { isMobile } from '../../utils/store/useMobile';
|
2021-09-19 20:01:54 +03:00
|
|
|
import { profile } from '../../utils/store/user';
|
2021-07-13 16:27:02 +00:00
|
|
|
|
2021-08-24 10:45:43 +03:00
|
|
|
export let path = '';
|
2021-08-18 19:47:02 +03:00
|
|
|
export let isExercisePage = false;
|
2021-09-19 20:01:54 +03:00
|
|
|
export let isStudent = false;
|
2021-12-30 22:30:30 +02:00
|
|
|
export let isFetching = false;
|
2021-07-13 16:27:02 +00:00
|
|
|
|
2021-09-19 20:01:54 +03:00
|
|
|
$: {
|
|
|
|
|
const user = $group.people.find(
|
|
|
|
|
(person) => person.profile_id === $profile.id
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (user) {
|
|
|
|
|
isStudent = user.role_id === 3;
|
|
|
|
|
}
|
2021-07-25 17:44:11 +03:00
|
|
|
}
|
2021-07-10 19:16:10 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svelte:head>
|
2021-08-18 19:47:02 +03:00
|
|
|
<title>{$course.title || 'ClassroomIO Course'}</title>
|
2021-07-10 19:16:10 +00:00
|
|
|
</svelte:head>
|
|
|
|
|
|
2021-12-30 22:30:30 +02:00
|
|
|
{#if isFetching}
|
|
|
|
|
<Backdrop>
|
2022-12-30 13:08:54 +01:00
|
|
|
<Moon size="60" color="#1d4ed8" unit="px" duration="1s" />
|
2021-12-30 22:30:30 +02:00
|
|
|
</Backdrop>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2021-07-10 19:16:10 +00:00
|
|
|
<div class="root">
|
2021-09-19 20:01:54 +03:00
|
|
|
<Navigation {path} {isStudent} />
|
2021-09-17 06:33:49 +03:00
|
|
|
<div class="rightBar" class:isMobile={$isMobile}>
|
2021-08-18 19:47:02 +03:00
|
|
|
{#if isExercisePage}
|
|
|
|
|
<Confetti />
|
|
|
|
|
{/if}
|
2021-07-10 19:16:10 +00:00
|
|
|
<slot />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.root {
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.rightBar {
|
|
|
|
|
flex-grow: 1;
|
2021-08-18 19:47:02 +03:00
|
|
|
width: calc(100% - 360px);
|
2021-07-10 19:16:10 +00:00
|
|
|
}
|
2021-09-17 06:33:49 +03:00
|
|
|
|
|
|
|
|
.rightBar.isMobile {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
2021-07-10 19:16:10 +00:00
|
|
|
</style>
|