From 2cd8b7cf696746e58f9d7868ef5094bb9dfd0467 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sat, 5 Aug 2023 05:48:32 +0100 Subject: [PATCH] CLASSROOMIO-T-97: Better button style and fix route not found --- src/lib/components/Navigation/app.svelte | 4 ++-- src/lib/components/PrimaryButton/index.svelte | 4 ++-- src/lib/utils/store/org.js | 15 +++++++-------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/lib/components/Navigation/app.svelte b/src/lib/components/Navigation/app.svelte index ae643b9c..425d2e67 100644 --- a/src/lib/components/Navigation/app.svelte +++ b/src/lib/components/Navigation/app.svelte @@ -26,10 +26,10 @@ function getPathName(_isCoursePage) { if (!_isCoursePage) { - return $currentOrgPath; + return $currentOrgPath ?? '/'; } - return `${$currentOrgPath}/courses`; + return $currentOrgPath ? `${$currentOrgPath}/courses` : ''; } diff --git a/src/lib/components/PrimaryButton/index.svelte b/src/lib/components/PrimaryButton/index.svelte index a2de406e..383d7358 100644 --- a/src/lib/components/PrimaryButton/index.svelte +++ b/src/lib/components/PrimaryButton/index.svelte @@ -21,8 +21,8 @@ : 'cursor-pointer'} flex items-center h-auto {VARIANTS_CLASS[ isLoading ? VARIANTS.OUTLINED : variant ]} {!disablePadding && - 'py-2 px-6'} rounded-md {className} w-fit justify-center sm:w-auto {isLoading && - 'py-2 border-blue-700'} {variant !== VARIANTS.TEXT && + 'py-[0.60rem] px-6'} rounded-md {className} w-fit justify-center sm:w-auto {isLoading && + 'py-[0.60rem] border-blue-700'} {variant !== VARIANTS.TEXT && 'hover:shadow-xl'} transition delay-150 duration-300 ease-in-out {variant !== VARIANTS.CONTAINED_WHITE ? 'dark:text-white' diff --git a/src/lib/utils/store/org.js b/src/lib/utils/store/org.js index 23a7ef09..b9c70dbc 100644 --- a/src/lib/utils/store/org.js +++ b/src/lib/utils/store/org.js @@ -9,13 +9,12 @@ export const currentOrg = writable({ shortName: '', siteName: '', avatar_url: '', - memberId: '', + memberId: '' }); export const orgAudience = writable([]); export const orgTeam = writable([]); -export const currentOrgPath = derived( - currentOrg, - ($currentOrg) => `/org/${$currentOrg.siteName}` +export const currentOrgPath = derived(currentOrg, ($currentOrg) => + $currentOrg.siteName ? `/org/${$currentOrg.siteName}` : '' ); // Quiz @@ -23,13 +22,13 @@ export const createQuizModal = writable({ open: false, openEdit: false, title: '', - id: null, + id: null }); export const deleteModal = writable({ id: null, open: false, - isQuestion: false, + isQuestion: false }); export const quizesStore = writable([]); @@ -40,9 +39,9 @@ export const quizStore = writable({ questions: [], timelimit: '10s', theme: 'standard', - pin: '', + pin: '' }); export const playQuizStore = writable({ - step: STEPS.CONNECT_TO_PLAY, + step: STEPS.CONNECT_TO_PLAY });