fix: course and org landing page improvements (#468)

* make gift section HTML rendered

* hide classroomio branding on landing page

* improve section expanding

* feat: toggle show sections on course landing page

* fix: show discount on landing page course card
This commit is contained in:
Rotimi Best
2024-09-09 01:14:55 +01:00
committed by GitHub
parent 982acb0711
commit 8ab51095a7
27 changed files with 531 additions and 232 deletions
@@ -29,3 +29,10 @@ export function replaceHTMLTag(text: string) {
.map((char) => tagsToReplace[char] || char)
.join('');
}
export function calcCourseDiscount(percent = 0, cost: number, showDiscount: boolean) {
if (!percent || !showDiscount) return cost;
const discountAmount = (percent / 100) * cost;
const discountedPrice = cost - discountAmount;
return Math.round(discountedPrice);
}