* Merge main into turbo-monrepo * feat: rename apps * feat: remove supbase videos and serve all from project * feat: move supabase to root * feat: update README * docs: update link
30 lines
674 B
JavaScript
30 lines
674 B
JavaScript
export function toggleBodyByMode(isDark) {
|
|
if (!document) return;
|
|
|
|
if (isDark) {
|
|
document.body.className = document.body.className.concat(' ', 'dark');
|
|
} else {
|
|
document.body.className = document.body.className.replace(' dark', '');
|
|
}
|
|
}
|
|
|
|
export function isCoursesPage(path) {
|
|
return /courses\/[a-z 0-9 -]/.test(path);
|
|
}
|
|
|
|
export function isCoursePage(path) {
|
|
return /course\/[a-z 0-9 -]/.test(path);
|
|
}
|
|
|
|
export function isOrgPage(path) {
|
|
return /org\/[a-z 0-9 -]/.test(path);
|
|
}
|
|
|
|
export function isQuizPage(path) {
|
|
return /org\/[a-z 0-9 -]+\/quiz\/[a-z 0-9 -]/.test(path);
|
|
}
|
|
|
|
export function isLMSPage(path) {
|
|
return /lms[\/a-z 0-9 -]*/.test(path);
|
|
}
|