diff --git a/src/app.html b/src/app.html index 23a64582..c10fdbc4 100644 --- a/src/app.html +++ b/src/app.html @@ -6,6 +6,25 @@ + ClassroomIO – The LMS with Superpowers + + + + + + + + + + + + + + + diff --git a/src/lib/components/Course/components/Lesson/Exercise/index.svelte b/src/lib/components/Course/components/Lesson/Exercise/index.svelte index a3234e13..2c18b7a8 100644 --- a/src/lib/components/Course/components/Lesson/Exercise/index.svelte +++ b/src/lib/components/Course/components/Lesson/Exercise/index.svelte @@ -27,7 +27,6 @@ import { SNACKBAR_SEVERITY } from '$lib/components/Snackbar/constants'; export let exerciseId; - export let refetchExercise = () => {}; export let goBack = () => {}; let preview = false; diff --git a/src/lib/components/Course/components/Lesson/Exercise/store.js b/src/lib/components/Course/components/Lesson/Exercise/store.js index b6424c66..3c77cac0 100644 --- a/src/lib/components/Course/components/Lesson/Exercise/store.js +++ b/src/lib/components/Course/components/Lesson/Exercise/store.js @@ -1,6 +1,4 @@ import { writable } from 'svelte/store'; -import MODES from '$lib/utils/constants/mode.js'; -import { ROLE } from '$lib/utils/constants/roles'; export const exerciseMode = writable({ editMode: true diff --git a/src/lib/components/Course/components/Lesson/Exercises/index.svelte b/src/lib/components/Course/components/Lesson/Exercises/index.svelte index 7ab0e7ef..55f59683 100644 --- a/src/lib/components/Course/components/Lesson/Exercises/index.svelte +++ b/src/lib/components/Course/components/Lesson/Exercises/index.svelte @@ -15,8 +15,6 @@ import { QUESTION_TYPES } from '$lib/components/Question/constants'; import { lesson } from '../store/lessons'; import { questionnaire, isQuestionnaireFetching, handleAddQuestion } from '../store/exercise'; - import MODES from '$lib/utils/constants/mode.js'; - import { ROLE } from '$lib/utils/constants/roles'; import { exerciseMode } from '../Exercise/store'; export let path; @@ -139,10 +137,10 @@ {/if} {#if exerciseId} - getExercise(exerciseId)} /> + {:else} - +
diff --git a/src/lib/components/Form/TextField.svelte b/src/lib/components/Form/TextField.svelte index be84b32d..22decfcd 100644 --- a/src/lib/components/Form/TextField.svelte +++ b/src/lib/components/Form/TextField.svelte @@ -67,7 +67,8 @@ {/if} diff --git a/src/lib/components/Org/Settings/TeamMembers.svelte b/src/lib/components/Org/Settings/TeamMembers.svelte index e38fcbf0..7da053cd 100644 --- a/src/lib/components/Org/Settings/TeamMembers.svelte +++ b/src/lib/components/Org/Settings/TeamMembers.svelte @@ -1,11 +1,5 @@ + +Hey there, + + You have been invited to join {orgName} on ClassroomIO. + + +
+ +
+Best regards +Rotimi Best +ClassroomIO diff --git a/src/routes/api/email/invite/template.svelte b/src/routes/api/email/invite/template.svelte new file mode 100644 index 00000000..068b6441 --- /dev/null +++ b/src/routes/api/email/invite/template.svelte @@ -0,0 +1,15 @@ + + + diff --git a/src/routes/api/email/teacher/+server.js b/src/routes/api/email/teacher/+server.js deleted file mode 100644 index cceaaabe..00000000 --- a/src/routes/api/email/teacher/+server.js +++ /dev/null @@ -1,7 +0,0 @@ -import { json } from '@sveltejs/kit'; - -export async function GET({ url }) { - // Get org data from request - // Get teacher email - // Generate -} diff --git a/src/routes/api/email/teacher/template.svelte b/src/routes/api/email/teacher/template.svelte deleted file mode 100644 index e69de29b..00000000 diff --git a/src/routes/courses/[id]/lessons/+page.svelte b/src/routes/courses/[id]/lessons/+page.svelte index 88114a04..f4130525 100644 --- a/src/routes/courses/[id]/lessons/+page.svelte +++ b/src/routes/courses/[id]/lessons/+page.svelte @@ -109,7 +109,10 @@ isStudent = user.role_id === 3; } } - $: $exerciseMode.editMode = !isStudent; + $: { + console.log('isStudent', isStudent); + $exerciseMode.editMode = !isStudent; + } diff --git a/src/routes/invite/[hash]/+layout.server.ts b/src/routes/invite/[hash]/+layout.server.ts new file mode 100644 index 00000000..8dcb5fd3 --- /dev/null +++ b/src/routes/invite/[hash]/+layout.server.ts @@ -0,0 +1,24 @@ +import { redirect } from '@sveltejs/kit'; +import { getCurrentOrg } from '$lib/utils/services/org'; +import { getSupabase } from '$lib/utils/functions/supabase'; + +export const load = async ({ params = { hash: '' } }) => { + try { + const hashData = atob(decodeURIComponent(params.hash)); + console.log('hashData', hashData); + + const { orgId, email, orgSiteName } = JSON.parse(hashData); + + getSupabase(); + const _currentOrg = await getCurrentOrg(orgSiteName, true); + + return { + orgId, + email, + currentOrg: _currentOrg + }; + } catch (error) { + console.error('Error decoding invite params.hash', error); + throw redirect(301, '/404'); + } +}; diff --git a/src/routes/invite/[hash]/+page.svelte b/src/routes/invite/[hash]/+page.svelte new file mode 100644 index 00000000..0ac809b1 --- /dev/null +++ b/src/routes/invite/[hash]/+page.svelte @@ -0,0 +1,194 @@ + + + + Join ClassroomIO + + + +
+

Create a free account

+ + + + + {#if submitError} +

{submitError}

+ {/if} +
+ +
+ +
+
diff --git a/src/routes/onboarding/+page.svelte b/src/routes/onboarding/+page.svelte index fc9913d1..5f6df51a 100644 --- a/src/routes/onboarding/+page.svelte +++ b/src/routes/onboarding/+page.svelte @@ -11,6 +11,7 @@ import { welcomeModalStore } from '$lib/components/WelcomeModal/store'; import { getOrganizations } from '$lib/utils/services/org'; import { sendWelcomeEmail } from './utils'; + import { currentOrg } from '$lib/utils/store/org'; interface OnboardingField { fullname?: string; @@ -200,6 +201,10 @@ ?.replace(/\s+/g, '-') ?.replace(/[^a-zA-Z0-9-]/g, ''); $: setOrgSiteName(fields.orgName, isSiteNameTouched); + + $: { + console.log('currentOrg', $currentOrg); + } {#if $profile.id} diff --git a/src/routes/org/[slug]/courses/+page.svelte b/src/routes/org/[slug]/courses/+page.svelte index 69e31727..f2f6df0a 100644 --- a/src/routes/org/[slug]/courses/+page.svelte +++ b/src/routes/org/[slug]/courses/+page.svelte @@ -8,7 +8,7 @@ import PrimaryButton from '$lib/components/PrimaryButton/index.svelte'; import { courses, createCourseModal, courseMetaDeta } from '$lib/components/Courses/store'; import { setProfileIdOfGroupMember } from '$lib/utils/services/courses'; - import { currentOrg } from '$lib/utils/store/org.js'; + import { currentOrg } from '$lib/utils/store/org'; export let data; let { allCourses, cantFetch } = data; diff --git a/static/classroomio-opengraph-image.png b/static/classroomio-opengraph-image.png new file mode 100644 index 00000000..a78d2436 Binary files /dev/null and b/static/classroomio-opengraph-image.png differ