Skip to content

Instantly share code, notes, and snippets.

@tanner-west
Created April 27, 2022 13:40
Show Gist options
  • Save tanner-west/57dc0c517263ce794b16c3ba7b53fbe6 to your computer and use it in GitHub Desktop.
Save tanner-west/57dc0c517263ce794b16c3ba7b53fbe6 to your computer and use it in GitHub Desktop.
return (
<>
{showCorrectAnswerCard ? (
<View style={{marginVertical: 5}}>
<Card status={'success'}>
<Text>Correct 🥳</Text>
</Card>
</View>
) : null}
{showWrongAnswerCard ? (
<View style={{marginVertical: 5}}>
<Card status={'danger'}>
<Text>Incorrect 😞</Text>
</Card>
</View>
) : null}
<Text>{question.text}</Text>
<RadioGroup
selectedIndex={selectedAnswer}
onChange={(index: number) => setSelectedAnswer(index)}>
{question.answers.map(answer => (
<Radio key={question.id} disabled={isSubmitted}>
{answer}
</Radio>
))}
</RadioGroup>
<Button
disabled={isSubmitted}
style={{marginVertical: 5}}
onPress={onSubmitAnswer}>
Submit
</Button>
</>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment