move Object.values(Answer) to constant

This commit is contained in:
Dawid Wysokiński 2021-04-10 09:07:37 +02:00
parent f01e11d734
commit 46a1c35314
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,8 @@ export interface QuestionProps {
reviewMode: boolean;
}
const ANSWERS = Object.values(Answer);
const Question = ({
question,
answer,
@ -61,7 +63,7 @@ const Question = ({
)}
</div>
)}
{Object.values(Answer).map(a => {
{ANSWERS.map(a => {
const upper = a.toUpperCase();
const image = question[
`answer${upper}Image` as keyof QuestionT