Polish custom time range dropdown

pull/2887/head
Alex P 2018-02-27 22:53:12 -08:00
parent f60aa7d660
commit e15cbd0d9d
1 changed files with 7 additions and 6 deletions

View File

@ -10,7 +10,7 @@ class CustomTimeRangeDropdown extends Component {
super(props)
this.state = {
isDropdownOpen: false,
expanded: false,
}
this.handleToggleDropdown = ::this.handleToggleDropdown
@ -22,22 +22,23 @@ class CustomTimeRangeDropdown extends Component {
}
handleToggleDropdown() {
this.setState({isDropdownOpen: !this.state.isDropdownOpen})
this.setState({expanded: !this.state.expanded})
}
handleCloseDropdown() {
this.setState({isDropdownOpen: false})
this.setState({expanded: false})
}
render() {
const {timeRange: {upper, lower}, timeRange, onApplyTimeRange} = this.props
const {isDropdownOpen} = this.state
const {expanded} = this.state
return (
<div
className={classnames('custom-time-range', {open: isDropdownOpen})}
style={{display: 'flex'}}
className={classnames('dropdown dropdown-280 custom-time-range', {
open: expanded,
})}
>
<button
className="btn btn-sm btn-default dropdown-toggle"