on select filter close filters
This commit is contained in:
parent
bae0e60ad5
commit
a4f0160343
|
@ -30,9 +30,12 @@ function Transition(props) {
|
||||||
return <Slide direction="up" {...props} />;
|
return <Slide direction="up" {...props} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ListButton = ({ name, setPollOrder, selected }) => (
|
const ListButton = ({ name, setPollOrder, selected, handleClose }) => (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ListItem button onClick={() => setPollOrder(name)}>
|
<ListItem button onClick={() => {
|
||||||
|
setPollOrder(name);
|
||||||
|
handleClose();
|
||||||
|
}}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={selected}
|
checked={selected}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -59,6 +62,7 @@ class OrderingDialog extends PureComponent {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { classes } = this.props;
|
const { classes } = this.props;
|
||||||
|
const { handleClose } = this;
|
||||||
return (
|
return (
|
||||||
<VotingContext.Consumer>
|
<VotingContext.Consumer>
|
||||||
{({ setPollOrder, pollOrder }) =>
|
{({ setPollOrder, pollOrder }) =>
|
||||||
|
@ -78,13 +82,10 @@ class OrderingDialog extends PureComponent {
|
||||||
<Typography variant="title" color="inherit" className={classes.flex}>
|
<Typography variant="title" color="inherit" className={classes.flex}>
|
||||||
close
|
close
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button color="inherit" onClick={this.handleClose}>
|
|
||||||
save
|
|
||||||
</Button>
|
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
<List>
|
<List>
|
||||||
{Object.keys(constants).map((name, i) => <ListButton key={i} name={name} setPollOrder={setPollOrder} selected={pollOrder === name}/>)}
|
{Object.keys(constants).map((name, i) => <ListButton key={i} name={name} setPollOrder={setPollOrder} selected={pollOrder === name} handleClose={handleClose} />)}
|
||||||
</List>
|
</List>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue