CLASSROOMIO-T-152: Add payment link + reload on org login

This commit is contained in:
Rotimi Best
2023-09-14 23:04:51 +01:00
parent 530ea721a2
commit bc7a5e1e4d
16 changed files with 133 additions and 91 deletions
@@ -15,6 +15,7 @@
import { sendTeacherCourseWelcome } from './utils';
import type { Course } from '$lib/utils/types';
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
import { getStudentInviteLink } from '$lib/utils/functions/course';
interface Tutor {
id: number;
@@ -109,21 +110,6 @@
isLoadingTutors = false;
}
function getInviteLink(_course: Course, siteName: string) {
const hash = encodeURIComponent(
btoa(
JSON.stringify({
groupId: _course.group?.id,
name: _course.title,
description: _course.description,
orgSiteName: siteName
})
)
);
return `https://${siteName}.classroomio.com/invite/s/${hash}`;
}
function copyLink() {
copy(link);
copied = true;
@@ -139,7 +125,7 @@
$: setTutors($currentOrg.id, $invitationModal.open);
$: link = getInviteLink($course, $currentOrg.siteName);
$: link = getStudentInviteLink($course, $currentOrg.siteName);
</script>
<Modal
+1
View File
@@ -21,6 +21,7 @@ export const course: Writable<Course> = writable({
videoUrl: '',
showDiscount: false,
discount: 0,
paymentLink: '',
reward: {
show: false,
description: ''