2021-07-01 09:31:26 +03:00
|
|
|
const ROUTES = {
|
2021-07-12 05:55:57 +03:00
|
|
|
COURSES: 'courses',
|
|
|
|
|
LESSONS: 'lessons',
|
2021-07-01 09:31:26 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function getNavItemRoute(courseId, routeId) {
|
|
|
|
|
const path = `/${ROUTES.COURSES}/${courseId}`;
|
|
|
|
|
|
|
|
|
|
if (!routeId) {
|
|
|
|
|
return path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return `${path}/${routeId}`;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-12 05:55:57 +03:00
|
|
|
export function getLessonsRoute(courseId, lessonId) {
|
|
|
|
|
const path = getNavItemRoute(courseId, ROUTES.LESSONS);
|
2021-07-01 09:31:26 +03:00
|
|
|
|
2021-07-12 05:55:57 +03:00
|
|
|
if (!lessonId) {
|
2021-07-01 09:31:26 +03:00
|
|
|
return path;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-12 05:55:57 +03:00
|
|
|
return `${path}/${lessonId}`;
|
2021-07-01 09:31:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getLectureNo(index) {
|
|
|
|
|
if (index < 9) {
|
|
|
|
|
return `00${index}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return `0${index}`;
|
|
|
|
|
}
|