class MainPage extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
this.state = {
styles: 'display:"none"'
}
}
handleClick() {
this.setState({
styles: 'display:"block"'
});
}
render() {
var styles = this.state.styles
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>
);
}
};
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>
);
}
};