From c4fddecbeb6a20aa118b3007b995c46a25f313a7 Mon Sep 17 00:00:00 2001 From: aaronshiel Date: Thu, 2 May 2024 16:06:47 -0700 Subject: [PATCH] small UI edits --- client/src/components/home/answer-item.tsx | 12 ++++++++-- client/src/components/home/answer-list.tsx | 5 +++- .../src/components/home/recording-block.tsx | 7 ++++-- .../src/components/record/video-recorder.tsx | 21 ++++++++++++++-- .../components/setup/mentor-goal-slide.tsx | 24 +++++++++++++++---- .../setup/select-keywords-slide.tsx | 3 +++ 6 files changed, 61 insertions(+), 11 deletions(-) diff --git a/client/src/components/home/answer-item.tsx b/client/src/components/home/answer-item.tsx index bb0ad9ec..c75e1fba 100644 --- a/client/src/components/home/answer-item.tsx +++ b/client/src/components/home/answer-item.tsx @@ -22,8 +22,16 @@ function AnswerItem(props: { question: QuestionEdits; onEditQuestion: (question: QuestionEdits) => void; onRecordOne: (question: QuestionEdits) => void; + isCompleteAnswer: boolean; }): JSX.Element { - const { mentorId, answer, question, onEditQuestion, onRecordOne } = props; + const { + mentorId, + answer, + question, + onEditQuestion, + onRecordOne, + isCompleteAnswer, + } = props; const [questionInput, setQuestionInput] = useState( question.newQuestionText ); @@ -95,7 +103,7 @@ function AnswerItem(props: { endIcon={} onClick={() => onRecordOne(question)} > - Record + {isCompleteAnswer ? "Edit" : "Record"} diff --git a/client/src/components/home/answer-list.tsx b/client/src/components/home/answer-list.tsx index a3528fa1..325486f6 100644 --- a/client/src/components/home/answer-list.tsx +++ b/client/src/components/home/answer-list.tsx @@ -22,6 +22,7 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import { Answer } from "types"; import AnswerItem from "./answer-item"; import { QuestionEdits } from "hooks/graphql/use-with-review-answer-state"; +import { COMPLETE_ANSWER_HEADER } from "./recording-block"; function AnswerList(props: { classes: Record; @@ -47,6 +48,7 @@ function AnswerList(props: { onAddQuestion, } = props; const [isExpanded, setExpanded] = React.useState(false); + const isCompleteAnswers = header === COMPLETE_ANSWER_HEADER; useEffect(() => { setExpanded(props.expandLists); @@ -83,7 +85,7 @@ function AnswerList(props: { onClick={onRecordAll} disabled={answers.length === 0} > - Record All + {isCompleteAnswers ? "Review All" : "Record All"} {onAddQuestion ? (