course landing page improvements

This commit is contained in:
Rotimi Best
2023-10-30 04:52:00 +00:00
parent 64a058ebc8
commit d6472a54ca
18 changed files with 189 additions and 112 deletions
+11 -2
View File
@@ -1,7 +1,8 @@
import { writable, derived } from 'svelte/store';
import { dev, browser } from '$app/environment';
import { STEPS } from '../constants/quiz';
import type { Writable } from 'svelte/store';
import type { CurrentOrg, OrgTeamMember } from '../types/org';
import type { CurrentOrg, OrgTeamMember, OrgAudience } from '../types/org';
import { ROLE } from '$lib/utils/constants/roles';
import type { UserLessonDataType } from '$lib/utils/types';
@@ -17,7 +18,7 @@ export const currentOrg: Writable<CurrentOrg> = writable({
landingpage: {},
theme: ''
});
export const orgAudience = writable([]);
export const orgAudience = writable<OrgAudience[]>([]);
export const orgTeam = writable<OrgTeamMember[]>([]);
export const isOrgAdmin = derived(
currentOrg,
@@ -26,6 +27,14 @@ export const isOrgAdmin = derived(
export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
$currentOrg.siteName ? `/org/${$currentOrg.siteName}` : ''
);
export const currentOrgDomain = derived(currentOrg, ($currentOrg) => {
const browserOrigin = dev && browser && window.location.origin;
return browserOrigin
? browserOrigin
: $currentOrg.siteName
? `https://${$currentOrg.siteName}.classroomio.com`
: '';
});
// Quiz
export const createQuizModal = writable({