this.setState({
dob: {
...this.state.dob,
year: '1980'
}
})
class MainPage extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
this.state = {
shown: false
}
}
handleClick() {
this.setState({
shown: true
});
}
render() {
var styles = this.state.shown ? {
display: 'block'
} : {
display: 'none'
}
return (
<div className="orders-page">
<div className="inner">
<div className="grid hidden-palm margin-bottom-30">
<CreateOrderButton onClick={this.handleClick} />
<PopupNewOrder style={styles} />
</div>
</div>
</div>
);
}
};