CLASSROOMIO-T-152: Add payment link + reload on org login
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { Course } from '../types';
|
||||
|
||||
export const isCourseFree = (cost: number) => !(Number(cost) > 0);
|
||||
|
||||
export const getStudentInviteLink = (_course: Course, orgSiteName: string) => {
|
||||
const hash = encodeURIComponent(
|
||||
btoa(
|
||||
JSON.stringify({
|
||||
groupId: _course.group?.id,
|
||||
name: _course.title,
|
||||
description: _course.description,
|
||||
orgSiteName
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
return `https://${orgSiteName}.classroomio.com/invite/s/${hash}`;
|
||||
};
|
||||
@@ -1,7 +1,8 @@
|
||||
export default (currency: string | undefined) => {
|
||||
return new Intl.NumberFormat('en-US', {
|
||||
const locale = currency == 'NGN' ? 'en-NG' : 'en-US';
|
||||
return new Intl.NumberFormat(locale, {
|
||||
style: 'currency',
|
||||
currency: currency,
|
||||
minimumFractionDigits: 2,
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { MailService } from '@sendgrid/mail';
|
||||
import { SENDGRID_API_KEY } from '$env/static/private';
|
||||
|
||||
export const SENDGRID_FROM = 'Rotimi Best <[email protected]>';
|
||||
export const SENDGRID_FROM_NOTIFY = 'ClassroomIO <notif[email protected]>';
|
||||
export const SENDGRID_FROM_NOREPLY = 'ClassroomIO <norepl[email protected]>';
|
||||
|
||||
export let sendgrid: MailService;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ interface CourseMetadata {
|
||||
videoUrl?: '';
|
||||
showDiscount: false;
|
||||
discount: 0;
|
||||
paymentLink?: string;
|
||||
reward?: {
|
||||
show: boolean;
|
||||
description: string;
|
||||
@@ -94,7 +95,7 @@ export interface Course {
|
||||
logo?: string;
|
||||
slug?: any; // type unknown;
|
||||
metadata?: CourseMetadata;
|
||||
cost?: number;
|
||||
cost: number;
|
||||
currency?: string;
|
||||
group?: Group;
|
||||
organization?: Organization;
|
||||
|
||||
Reference in New Issue
Block a user