Skip to content

Instantly share code, notes, and snippets.

@techomoro
Created April 29, 2021 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techomoro/b6d1f58d2429b9ddc1617872e516fe6b to your computer and use it in GitHub Desktop.
Save techomoro/b6d1f58d2429b9ddc1617872e516fe6b to your computer and use it in GitHub Desktop.
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