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);
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ export const currentOrgDomain = derived(currentOrg, ($currentOrg) => {
|
||||
: '';
|
||||
});
|
||||
|
||||
// Utility org store
|
||||
export const isFreePlan = derived(
|
||||
currentOrgPlan,
|
||||
($plan) => !$plan || $plan.plan_name === PLAN.BASIC
|
||||
);
|
||||
export const isFreePlan = derived(currentOrgPlan, ($plan) => {
|
||||
if (!$plan) return false;
|
||||
|
||||
return !$plan || $plan.plan_name === PLAN.BASIC;
|
||||
});
|
||||
export const currentOrgMaxAudience = derived(currentOrgPlan, ($plan) =>
|
||||
!$plan
|
||||
? 20
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
"course_content": "Kursinhalte",
|
||||
"modules": "Module",
|
||||
"modules": "module",
|
||||
"lessons": "Unterricht",
|
||||
"exercises": "Übungen"
|
||||
},
|
||||
@@ -1430,4 +1430,4 @@
|
||||
"no": "NEIN",
|
||||
"yes": "Ja"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -923,12 +923,14 @@
|
||||
"goals": "Goals",
|
||||
"reviews": "Reviews",
|
||||
"instructor": "Instructor",
|
||||
"pricing": "Pricing"
|
||||
"pricing": "Pricing",
|
||||
"certificate": "Certificate"
|
||||
},
|
||||
|
||||
"save": "Save",
|
||||
"page_builder": "Page Builder",
|
||||
"section": "section",
|
||||
"display_section": "Display section",
|
||||
|
||||
"header_form": {
|
||||
"title": "Title",
|
||||
@@ -962,6 +964,10 @@
|
||||
}
|
||||
},
|
||||
|
||||
"certificate_form": {
|
||||
"upload_template": "Certificate template"
|
||||
},
|
||||
|
||||
"instructor_form": {
|
||||
"upload": "Instructor Logo",
|
||||
"name": "Instructor name",
|
||||
@@ -1002,7 +1008,7 @@
|
||||
},
|
||||
|
||||
"course_content": "Course content",
|
||||
"modules": "Modules",
|
||||
"modules": "modules",
|
||||
"lessons": "lessons",
|
||||
"exercises": "exercises",
|
||||
"start_course": "Start Course",
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
"course_content": "Contenido del curso",
|
||||
"modules": "Módulos",
|
||||
"modules": "módulos",
|
||||
"lessons": "lecciones",
|
||||
"exercises": "ceremonias"
|
||||
},
|
||||
@@ -1430,4 +1430,4 @@
|
||||
"no": "No",
|
||||
"yes": "Sí"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
"course_content": "Contenu du cours",
|
||||
"modules": "Modules",
|
||||
"modules": "modules",
|
||||
"lessons": "leçons",
|
||||
"exercises": "exercices"
|
||||
},
|
||||
@@ -1430,4 +1430,4 @@
|
||||
"no": "Non",
|
||||
"yes": "Oui"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
"course_content": "Conteúdo do curso",
|
||||
"modules": "Módulos",
|
||||
"modules": "módulos",
|
||||
"lessons": "lições",
|
||||
"exercises": "exercícios"
|
||||
},
|
||||
@@ -1430,4 +1430,4 @@
|
||||
"no": "Não",
|
||||
"yes": "Sim"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
"course_content": "Содержание курса",
|
||||
"modules": "Модули",
|
||||
"modules": "mодули",
|
||||
"lessons": "уроки",
|
||||
"exercises": "упражнения"
|
||||
},
|
||||
@@ -1430,4 +1430,4 @@
|
||||
"no": "Нет",
|
||||
"yes": "Да"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
"course_content": "Nội dung khóa học",
|
||||
"modules": "Mô-đun",
|
||||
"modules": "mô-đun",
|
||||
"lessons": "bài học",
|
||||
"exercises": "bài tập"
|
||||
},
|
||||
@@ -1430,4 +1430,4 @@
|
||||
"no": "KHÔNG",
|
||||
"yes": "Đúng"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,11 +97,15 @@ interface CourseMetadata {
|
||||
description: string;
|
||||
imgUrl: string;
|
||||
};
|
||||
certificate?: {
|
||||
templateUrl: string;
|
||||
};
|
||||
reviews?: Array<Review>;
|
||||
lessonTabsOrder?: Array<Tabs>;
|
||||
grading?: boolean;
|
||||
lessonDownload?: boolean;
|
||||
allowNewStudent: boolean;
|
||||
sectionDisplay?: Record<string, boolean>;
|
||||
}
|
||||
|
||||
export interface LessonCommentInsertPayload {
|
||||
|
||||
Reference in New Issue
Block a user