I want to make a dynamic progress bar. I have a question, and under it are options to choose. If someone chooses some options, then the progress bar should move. It has to be updated depending on the number of checked-out questions. I have function handleProgress, which is responsible for the updates of the state when someone clicks on the question. Currently, she does nothing because I have no idea how she should send information that the question has been checked out. Below is my code, or maybe someone will give me some hints as to what my functional bay should do, the progress bar updates.
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
progressValue: 0
};
}
handleProgress = () => {
console.log("halo");
};
render() {
return (
<Styles>
<h1>🏁 React Final Form Example</h1>
<Progress value={this.state.progressValue} />
<Wizard
initialValues={{ employed: true }}
onSubmit={() => {
window.alert("Hello");
}}
>
<Wizard.Page>
<p>Page1</p>
<div id="div" onClick={this.handleProgress}>
<Field name="page1" component="input" type="radio" value="1" />
<Field name="page1" component="input" type="radio" value="2" />
<Field name="page1" component="input" type="radio" value="3" />
</div>
</Wizard.Page>
<Wizard.Page>
<p>Page2</p>
<div id="div" onClick={this.handleProgress}>
<Field name="page2" component="input" type="radio" value="1" />
<Field name="spage2" component="input" type="radio" value="2" />
<Field name="page2" component="input" type="radio" value="3" />
</div>
</Wizard.Page>
<Wizard.Page>
<p>Page3</p>
<div id="div" onClick={this.handleProgress}>
<Field name="page3" component="input" type="radio" value="1" />
<Field name="page3" omponent="input" type="radio" value="2" />
<Field name="page3" component="input" type="radio" value="3" />
</div>
</Wizard.Page>
<Wizard.Page>
<p>Page4</p>
<div id="div" onClick={this.handleProgress}>
<Field name="page4" component="input" type="radio" value="1" />
<Field name="page4" component="input" type="radio" value="2" />
<Field name="page4" component="input" type="radio" value="3" />
</div>
</Wizard.Page>
</Wizard>
</Styles>
);
}
}
This is my whole code https://codesandbox.io/s/8l5qn573o2