diff --git a/apps/dashboard/src/routes/courses/[id]/+layout.svelte b/apps/dashboard/src/routes/courses/[id]/+layout.svelte
index 3e460d30..b33763ba 100644
--- a/apps/dashboard/src/routes/courses/[id]/+layout.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/+layout.svelte
@@ -2,12 +2,13 @@
import { onMount } from 'svelte';
import { sideBar } from '$lib/components/Org/store';
import { apps } from '$lib/components/Apps/store';
+ import { globalStore } from '$lib/utils/store/app';
import APPS_CONSTANTS from '$lib/components/Apps/constants';
import hotkeys from 'hotkeys-js';
function handleClose() {
$apps.selectedApp = undefined;
- if ($apps.isStudent) {
+ if ($globalStore.isStudent) {
$apps.open = false;
}
}
diff --git a/apps/dashboard/src/routes/courses/[id]/attendance/+page.svelte b/apps/dashboard/src/routes/courses/[id]/attendance/+page.svelte
index c76bf666..9af31520 100644
--- a/apps/dashboard/src/routes/courses/[id]/attendance/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/attendance/+page.svelte
@@ -1,5 +1,4 @@
-
+
@@ -189,8 +188,8 @@
{#each $lessons as lesson}
-
+
diff --git a/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte b/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte
index ffbea3bf..18e56d04 100644
--- a/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte
@@ -18,7 +18,6 @@
import Select from '$lib/components/Form/Select.svelte';
import { updateLesson } from '$lib/utils/services/courses';
import CourseContainer from '$lib/components/CourseContainer/index.svelte';
- import { profile } from '$lib/utils/store/user';
import type { Lesson } from '$lib/utils/types';
import {
lessons,
@@ -32,13 +31,13 @@
import AddLessonModal from '$lib/components/Course/components/Lesson/AddLessonModal.svelte';
import DateField from '$lib/components/Form/Date.svelte';
import DeleteLessonConfirmation from '$lib/components/Course/components/Lesson/DeleteLessonConfirmation.svelte';
+ import { handleAddLessonWidget } from '$lib/components/Course/components/Navigation/store.js';
export let data;
let lessonEditing: string | undefined;
let lessonToDelete: Lesson | undefined;
let isStudent = true;
- let openModal = false;
let openDeleteModal = false;
const flipDurationMs = 300;
@@ -55,7 +54,7 @@
}
function addLesson() {
- openModal = true;
+ $handleAddLessonWidget.open = true;
}
function handleDndConsider(e: any) {
@@ -88,17 +87,11 @@
return index + 1;
}
}
-
- $: {
- const user = $group.people.find((person) => person.profile_id === $profile.id);
-
- if (user) {
- isStudent = user.role_id === 3;
- }
- }
-
+{#if $handleAddLessonWidget}
+
+{/if}
handleDelete(lessonToDelete?.id)}
/>
+
diff --git a/apps/dashboard/src/routes/courses/[id]/lessons/[...lessonParams]/+page.svelte b/apps/dashboard/src/routes/courses/[id]/lessons/[...lessonParams]/+page.svelte
index 29d78c9f..c3017d70 100644
--- a/apps/dashboard/src/routes/courses/[id]/lessons/[...lessonParams]/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/lessons/[...lessonParams]/+page.svelte
@@ -217,6 +217,7 @@
$: isLessonComplete = getIsLessonComplete($lesson.lesson_completion, $profile.id);
+
!!person.profile && person.profile.id === $profile.id)
: $group.people.filter((person) => !!person.profile && person.role_id === ROLE.STUDENT);
$: browser && $course.id && firstRender($course.id);
-
+
diff --git a/apps/dashboard/src/routes/courses/[id]/people/+page.svelte b/apps/dashboard/src/routes/courses/[id]/people/+page.svelte
index 39d34a4f..265fc447 100644
--- a/apps/dashboard/src/routes/courses/[id]/people/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/people/+page.svelte
@@ -40,7 +40,6 @@
let member: { id?: string; email?: string; profile?: { email: string } } = {};
let shouldEditMemberId: string | null = null;
let filterBy: ProfileRole = ROLES[0];
- let isStudent = false;
let searchValue = '';
// function setPeople(people: Array) {
@@ -91,12 +90,13 @@
return profile ? profile.email : email;
}
- function obscureEmail(email) {
- const [username, domain] = email.split('@');
- const obscuredUsername = username.charAt(0) + '*'.repeat(username.length - 2) + username.charAt(username.length - 1);
+ function obscureEmail(email) {
+ const [username, domain] = email.split('@');
+ const obscuredUsername =
+ username.charAt(0) + '*'.repeat(username.length - 2) + username.charAt(username.length - 1);
- return `${obscuredUsername}@${domain}`;
- }
+ return `${obscuredUsername}@${domain}`;
+ }
function handleEditStudentIdMode(personId: string) {
shouldEditMemberId = personId;
@@ -120,7 +120,7 @@
{deletePerson}
/>
-
+
diff --git a/apps/dashboard/src/routes/courses/[id]/settings/+page.svelte b/apps/dashboard/src/routes/courses/[id]/settings/+page.svelte
index 944a957c..07a2801e 100644
--- a/apps/dashboard/src/routes/courses/[id]/settings/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/settings/+page.svelte
@@ -5,10 +5,9 @@
import Settings from '$lib/components/Course/components/Settings/index.svelte';
export let data;
- let isStudent = false;
-
+
diff --git a/apps/dashboard/src/routes/org/[slug]/+page.svelte b/apps/dashboard/src/routes/org/[slug]/+page.svelte
index 6aead062..04001b51 100644
--- a/apps/dashboard/src/routes/org/[slug]/+page.svelte
+++ b/apps/dashboard/src/routes/org/[slug]/+page.svelte
@@ -16,10 +16,10 @@
import { onMount } from 'svelte';
import { Add } from 'carbon-icons-svelte';
import { isOrgAdmin, currentOrgPath, currentOrg, userUpcomingData } from '$lib/utils/store/org';
- import { VARIANTS } from '$lib/components/PrimaryButton/constants.js';
+ import { VARIANTS } from '$lib/components/PrimaryButton/constants';
import VisitOrgSiteButton from '$lib/components/Buttons/VisitOrgSite.svelte';
import { getGreeting } from '$lib/utils/functions/date';
- import { appStore } from '$lib/utils/store/app';
+ import { globalStore } from '$lib/utils/store/app';
export let data;
@@ -164,15 +164,15 @@
},
colors: {
text: {
- primary: $appStore.isDark ? '#eee' : '#333',
+ primary: $globalStore.isDark ? '#eee' : '#333',
highlight: '#fff'
},
background: {
- primary: $appStore.isDark ? '#333' : '#fff',
- highlight: $appStore.isDark ? '#5829d6' : '#eb7400',
- hover: $appStore.isDark ? '#222' : '#eee'
+ primary: $globalStore.isDark ? '#333' : '#fff',
+ highlight: $globalStore.isDark ? '#5829d6' : '#eb7400',
+ hover: $globalStore.isDark ? '#222' : '#eee'
},
- border: $appStore.isDark ? '#222' : '#eee'
+ border: $globalStore.isDark ? '#222' : '#eee'
}
}
};