I want to display/hide the chat body when on/off the switch. That means when switch on I want to display the chat body and when to switch off I want to hide it. Below is an image of toggle switch that I have used. Can you give me help to do that?
class MyApp extends Component {
render() {
return (
<FormControlLabel
control=
{
<Switch
name="sector"
color="primary"
style={{paddingRight: "30px"}}
onClick={this.handleClick.bind(this)}
/>
}
label="Sector 1"
/>
<div className="chatBody">
This is my chat body
</div>
);
}
}
export default MyApp;