Skip to content

Commit

Permalink
increase q/a font size and fix value hiding after question asked
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Apr 17, 2024
1 parent 687073e commit 6992fe5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/trivia/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function TriviaGame({ data }) {
<Fragment>
<Row>
<Col>
<p>{selectedQuestion.answer}</p>
<p>Answer: {selectedQuestion.answer}</p>
</Col>
</Row>
<Row>
Expand All @@ -81,7 +81,7 @@ export default function TriviaGame({ data }) {
variant="success"
onClick={() => {
setSelectedQuestion((prevVal) => {
prevVal.value = '';
prevVal.value = -1;
return null;
});
setRevealed(false);
Expand Down Expand Up @@ -120,9 +120,17 @@ export default function TriviaGame({ data }) {
xs={12}
key={index}
className={classNames('trivia-card')}
onClick={() => setSelectedQuestion(question)}
onClick={() =>
setSelectedQuestion((prevVal) => {
if (!prevVal?.value) {
return question;
} else {
return null;
}
})
}
>
${question.value}
{question.value > 0 && `$${question.value}`}
</Col>
))}
</Row>
Expand Down
1 change: 1 addition & 0 deletions src/components/trivia/game.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
display: flex;
align-items: center;
background-color: #060ce9;
font-size: 28px;

> .container-fluid {
text-align: center;
Expand Down

0 comments on commit 6992fe5

Please sign in to comment.