Files
classroomio/src/components/Course/function.js
T

33 lines
547 B
JavaScript
Raw Normal View History

2021-07-01 09:31:26 +03:00
const ROUTES = {
COURSES: "courses",
LECTURES: "lecture",
};
export function getNavItemRoute(courseId, routeId) {
const path = `/${ROUTES.COURSES}/${courseId}`;
if (!routeId) {
return path;
}
return `${path}/${routeId}`;
}
export function getLectureRoute(courseId, lectureId) {
const path = getNavItemRoute(courseId, ROUTES.LECTURES);
if (!lectureId) {
return path;
}
return `${path}/${lectureId}`;
}
export function getLectureNo(index) {
if (index < 9) {
return `00${index}`;
}
return `0${index}`;
}