Created
April 27, 2022 13:40
-
-
Save tanner-west/57dc0c517263ce794b16c3ba7b53fbe6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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