feat: add icon to create a new lesson from side nav (#145)

* feat: classroomio-issue-143

* issue 143: remove bg-color from the add icon

* fix: hide the + icon for student

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Adeyemi Adetunji
2024-02-01 20:18:03 +01:00
committed by GitHub
co-authored by Rotimi Best
parent 67db904dae
commit cadfa81913
28 changed files with 123 additions and 100 deletions
@@ -6,7 +6,7 @@
import Tabs from './components/Tabs.svelte';
import { polls } from './store';
import type { PollType, TabsType, PollOptionsSubmissionType } from './types';
import { apps } from '$lib/components/Apps/store';
import { globalStore } from '$lib/utils/store/app';
import { getSupabase } from '$lib/utils/functions/supabase';
import { profile } from '$lib/utils/store/user';
import { group, course } from '$lib/components/Course/store';
@@ -198,7 +198,7 @@
return;
}
polls.set(getPollsData(data, $apps.isStudent));
polls.set(getPollsData(data, $globalStore.isStudent));
setCoursePolls();
@@ -1,6 +1,6 @@
import type { PollType, FetchPollsResponse } from './types';
export const getPollsData = (data: FetchPollsResponse, isStudent: boolean) => {
export const getPollsData = (data: FetchPollsResponse, isStudent?: boolean) => {
const pollsData: PollType[] = data.map((appsPollItem) => ({
id: appsPollItem.id,
courseId: appsPollItem.courseId,
@@ -6,6 +6,7 @@
import IconButton from '$lib/components/IconButton/index.svelte';
import Settings from 'carbon-icons-svelte/lib/Settings.svelte';
import { apps } from './store';
import { globalStore } from '$lib/utils/store/app';
import Chip from '$lib/components/Chip/index.svelte';
import QandA from './components/QandA/index.svelte';
@@ -19,7 +20,7 @@
let appBarRef: HTMLDivElement;
let appContentRef: HTMLDivElement;
let topPadding = $apps.isStudent ? '48px' : '109px';
let topPadding = $globalStore.isStudent ? '48px' : '109px';
const getResizableSidebar = () => {
if (!browser) return;
@@ -29,7 +30,7 @@
function handleClose() {
$apps.selectedApp = undefined;
if ($apps.isStudent) {
if ($globalStore.isStudent) {
$apps.open = false;
}
}
@@ -43,7 +44,7 @@
$apps.dropdown = !$apps.dropdown;
}
function updateTopPadding(isStudent: boolean) {
function updateTopPadding(isStudent?: boolean) {
topPadding = isStudent ? '48px' : '109px';
}
@@ -54,10 +55,10 @@
}
onMount(() => {
updateTopPadding($apps.isStudent);
updateTopPadding($globalStore.isStudent);
});
$: updateTopPadding($apps.isStudent);
$: updateTopPadding($globalStore.isStudent);
$: getResizableSidebar();
</script>
@@ -4,10 +4,8 @@ export const apps = writable<{
open: boolean;
dropdown: boolean;
selectedApp: string | undefined;
isStudent: boolean;
}>({
open: false,
dropdown: false,
selectedApp: undefined,
isStudent: false
selectedApp: undefined
});