-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEV-1515] Fix webinar form and webinar questions page (#747)
* Fix webinar form and webinar questions page * Fixes after code review * Fixes after code review * Fixes after functional review * Fixes after code review * Simplify filter
- Loading branch information
1 parent
5739492
commit 9bddc42
Showing
8 changed files
with
188 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"nextjs-website": patch | ||
--- | ||
|
||
Fix webinar form and webinar questions page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
apps/nextjs-website/src/components/organisms/WebinarQuestionsTable/WebinarQuestionsTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { | ||
Paper, | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableContainer, | ||
TableHead, | ||
TableRow, | ||
} from '@mui/material'; | ||
import WebinarQuestionRow from '@/components/molecules/WebinarQuestion/WebinarQuestionRow'; | ||
import { updateWebinarQuestion } from '@/lib/webinarApi'; | ||
import { WebinarQuestion } from '@/lib/webinars/webinarQuestions'; | ||
|
||
type WebinarQuestionsTableProps = { | ||
userName: string; | ||
questions: WebinarQuestion[]; | ||
title: string; | ||
}; | ||
|
||
const WebinarQuestionsTable = ({ | ||
userName, | ||
questions, | ||
title, | ||
}: WebinarQuestionsTableProps) => { | ||
return ( | ||
<TableContainer component={Paper} sx={{ marginY: 2 }}> | ||
<Table aria-label='simple table'> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell>{title}</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{questions.map((question) => ( | ||
<WebinarQuestionRow | ||
key={question.id.createdAt.toISOString()} | ||
question={question} | ||
userName={userName} | ||
onHide={async (hide) => | ||
await updateWebinarQuestion({ | ||
id: question.id, | ||
updates: { | ||
hiddenBy: hide | ||
? { operation: 'update', value: userName } | ||
: { operation: 'remove' }, | ||
}, | ||
}) | ||
} | ||
onHighlight={async (highlight) => | ||
await updateWebinarQuestion({ | ||
id: question.id, | ||
updates: { | ||
highlightedBy: highlight | ||
? { operation: 'update', value: userName } | ||
: { operation: 'remove' }, | ||
}, | ||
}) | ||
} | ||
/> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
); | ||
}; | ||
|
||
export default WebinarQuestionsTable; |
Oops, something went wrong.