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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user