Skip to content

Commit

Permalink
small UI edits
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed May 2, 2024
1 parent 35bd1f2 commit c4fddec
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 11 deletions.
12 changes: 10 additions & 2 deletions client/src/components/home/answer-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(
question.newQuestionText
);
Expand Down Expand Up @@ -95,7 +103,7 @@ function AnswerItem(props: {
endIcon={<PlayArrowIcon />}
onClick={() => onRecordOne(question)}
>
Record
{isCompleteAnswer ? "Edit" : "Record"}
</Button>
</ListItemSecondaryAction>
</div>
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/home/answer-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>;
Expand All @@ -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);
Expand Down Expand Up @@ -83,7 +85,7 @@ function AnswerList(props: {
onClick={onRecordAll}
disabled={answers.length === 0}
>
Record All
{isCompleteAnswers ? "Review All" : "Record All"}
</Button>
{onAddQuestion ? (
<Button
Expand Down Expand Up @@ -129,6 +131,7 @@ function AnswerList(props: {
question={question}
onEditQuestion={onEditQuestion}
onRecordOne={onRecordOne}
isCompleteAnswer={isCompleteAnswers}
/>
</ListItem>
);
Expand Down
7 changes: 5 additions & 2 deletions client/src/components/home/recording-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
} from "hooks/graphql/use-with-review-answer-state";
import { isAnswerComplete } from "helpers";

export const INCOMPLETE_ANSWER_HEADER = "Incomplete";
export const COMPLETE_ANSWER_HEADER = "Complete";

export default function RecordingBlockItem(props: {
classes: Record<string, string>;
block: RecordingBlock;
Expand Down Expand Up @@ -79,7 +82,7 @@ export default function RecordingBlockItem(props: {
classes={classes}
subjectId={block.subject}
mentorId={props.mentorId}
header="Complete"
header={COMPLETE_ANSWER_HEADER}
answers={complete}
questions={questionEdits}
expandLists={props.expandAllRecordingBlocks}
Expand All @@ -97,7 +100,7 @@ export default function RecordingBlockItem(props: {
<AnswerList
classes={classes}
subjectId={block.subject}
header="Incomplete"
header={INCOMPLETE_ANSWER_HEADER}
answers={incomplete}
questions={questionEdits}
expandLists={props.expandAllRecordingBlocks}
Expand Down
21 changes: 19 additions & 2 deletions client/src/components/record/video-recorder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ function VideoRecorder(props: {
style={{
color: "white",
position: "absolute",
top: height / 2,
top: height / 4,
bottom: height / 2,
left: width / 2,
right: width / 2,
visibility: countdownInProgress ? "visible" : "hidden",
visibility: countdownInProgress ? "visible" : "visible",
}}
>
{recordStartCountdown ||
Expand All @@ -525,6 +525,23 @@ function VideoRecorder(props: {
) ||
""}
</Typography>
{recordStartCountdown && (
<Typography
data-cy="countdown-message"
variant="h2"
align="center"
style={{
color: "white",
position: "absolute",

bottom: 0,
width: width,
visibility: countdownInProgress ? "visible" : "visible",
}}
>
Press Spacebar to stop recording.
</Typography>
)}
</div>
<div
data-cy="controls"
Expand Down
24 changes: 20 additions & 4 deletions client/src/components/setup/mentor-goal-slide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,31 @@ export function MentorGoalSlide(props: {
classes={props.classes}
title="My Goal"
content={
<div>
<Typography variant="h4">
What do you really want someone to take away from talking to your
mentor? (1-2 sentences)
<div
style={{
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
width: "100%",
}}
>
<Typography
variant="h4"
style={{
width: "80%",
textAlign: "center",
alignSelf: "center",
}}
>
Think how you would describe yourself to a mentee, what do you
really want someone to take away from talking to your mentor?
</Typography>
<TextField
required
data-cy="goal-input"
variant="outlined"
placeholder="Enter your goal here..."
multiline
minRows={6}
value={mentor.goal || ""}
Expand Down
3 changes: 3 additions & 0 deletions client/src/components/setup/select-keywords-slide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export function SelectKeywordsSlide(props: {
renderInput={(params) => (
<TextField
{...params}
style={{
marginLeft: 10,
}}
variant="outlined"
placeholder={`Choose ${kw.type.toLowerCase()}`}
/>
Expand Down

0 comments on commit c4fddec

Please sign in to comment.