2017-01-11 17:52:21 +01:00
|
|
|
import React from 'react'
|
2017-11-06 16:32:04 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2017-01-11 17:52:21 +01:00
|
|
|
import Collapser from './Collapser'
|
|
|
|
|
2017-11-06 15:13:45 +01:00
|
|
|
export default class LayerListGroup extends React.Component {
|
2017-01-11 17:52:21 +01:00
|
|
|
static propTypes = {
|
2017-11-06 16:32:04 +01:00
|
|
|
title: PropTypes.string.isRequired,
|
2018-01-05 18:45:55 +01:00
|
|
|
"data-wd-key": PropTypes.string,
|
2017-11-06 16:32:04 +01:00
|
|
|
isActive: PropTypes.bool.isRequired,
|
|
|
|
onActiveToggle: PropTypes.func.isRequired
|
2017-01-11 17:52:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-11-08 11:13:02 +01:00
|
|
|
return <li className="maputnik-layer-list-group">
|
2017-01-11 17:52:21 +01:00
|
|
|
<div className="maputnik-layer-list-group-header"
|
2018-01-05 18:45:55 +01:00
|
|
|
data-wd-key={"layer-list-group:"+this.props["data-wd-key"]}
|
2017-01-11 17:52:21 +01:00
|
|
|
onClick={e => this.props.onActiveToggle(!this.props.isActive)}
|
|
|
|
>
|
|
|
|
<span className="maputnik-layer-list-group-title">{this.props.title}</span>
|
|
|
|
<span className="maputnik-space" />
|
|
|
|
<Collapser
|
|
|
|
style={{ height: 14, width: 14 }}
|
|
|
|
isCollapsed={this.props.isActive}
|
|
|
|
/>
|
|
|
|
</div>
|
2017-11-08 11:13:02 +01:00
|
|
|
</li>
|
2017-01-11 17:52:21 +01:00
|
|
|
}
|
|
|
|
}
|