feat: filter community questions by course (#157)
* checkpoint save * checkpoint * feat: course dropdown * added comments * feat: generate db migration * fixes * PR Fixes * PR Fixes * refactoring * show empty state * improve styling * fix styling issue * PR Fixes * PR Fixes * PR Fixes * dropdown for edit mode * test db schema change on staging * fix: change course_id to courseId * fix theming issue --------- Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
co-authored by
Rotimi Best
parent
75e32a22f6
commit
13ab070178
@@ -1,4 +1,4 @@
|
||||
export function setTheme(theme: string) {
|
||||
export function setTheme(theme?: string) {
|
||||
// In case the default theme is added but another theme exists
|
||||
if (!theme && document.body.className.includes('theme-')) {
|
||||
const regex = /theme-[\w]+/gi;
|
||||
@@ -7,8 +7,8 @@ export function setTheme(theme: string) {
|
||||
}
|
||||
|
||||
// In case theme already exists in dom, don't add
|
||||
if (document.body.className.includes(theme)) return;
|
||||
if (document.body.className.includes(theme || '')) return;
|
||||
|
||||
localStorage.setItem('theme', theme);
|
||||
document.body.className = document.body.className.concat(' ', theme);
|
||||
localStorage.setItem('theme', theme || '');
|
||||
document.body.className = document.body.className.concat(' ', theme || '');
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ const askCommunityValidationSchema = z.object({
|
||||
body: z.string().min(20, {
|
||||
message: 'Must be 10 or more characters long',
|
||||
invalid_type_error: 'Must not be empty'
|
||||
}),
|
||||
courseId: z.string().min(36, {
|
||||
message: 'Select a course',
|
||||
invalid_type_error: 'Select a course'
|
||||
})
|
||||
});
|
||||
const commentInCommunityValidationSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user