Created
April 29, 2021 07:28
-
-
Save techomoro/b6d1f58d2429b9ddc1617872e516fe6b to your computer and use it in GitHub Desktop.
This file contains 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
import React, { useContext } from "react"; | |
import { Button, TextField } from "@material-ui/core"; | |
import { makeStyles } from "@material-ui/core/styles"; | |
import AppContext from "../AppContext"; | |
import { ArrowRight } from "@material-ui/icons"; | |
const useStyles = makeStyles((theme) => ({ | |
buttonContainer: { | |
display: "block", | |
marginTop: "1rem", | |
}, | |
button: { | |
background: "white", | |
}, | |
})); | |
function Question() { | |
const classes = useStyles(); | |
const value = useContext(AppContext); | |
let { questionAnswer } = value.state; | |
let { handleChangeInput, nextQuestion } = value.function; | |
return ( | |
<div> | |
<form noValidate autoComplete="on" onSubmit={nextQuestion}> | |
<TextField | |
id="standard-basic" | |
label={questionAnswer.question} | |
name={questionAnswer.resumeFieldId} | |
value={questionAnswer.answer ? questionAnswer.answer : ""} | |
onChange={handleChangeInput} | |
/> | |
<div className={classes.buttonContainer}> | |
<Button | |
type="submit" | |
variant="contained" | |
color="default" | |
className={classes.button} | |
endIcon={<ArrowRight />} | |
> | |
Next | |
</Button> | |
</div> | |
</form> | |
</div> | |
); | |
} | |
export default Question; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment