Skip to content

Commit

Permalink
[Enhancement] add disabled to layer-configurator group (#897)
Browse files Browse the repository at this point in the history
- Geojson Layer: Do not hide height config when filll color is disabled
Signed-off-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
heshan0131 committed Jan 13, 2020
1 parent a919aab commit 0a24f07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/components/side-panel/layer-panel/layer-config-group.js
Expand Up @@ -70,6 +70,10 @@ export const StyledLayerConfigGroup = styled.div`
padding-left: 18px;
margin-bottom: 12px;
&.disabled {
opacity: 0.3;
pointer-events: none;
}
&.collapsed {
.layer-config-group__header__collapsible {
overflow: visible;
Expand Down Expand Up @@ -119,7 +123,8 @@ class LayerConfigGroup extends Component {
collapsible: false,
expanded: false,
onChange: () => {},
description: null
description: null,
disabled: false
};

static getDerivedStateFromProps(props, state) {
Expand All @@ -143,14 +148,15 @@ class LayerConfigGroup extends Component {
layer,
onChange,
collapsible,
description
description,
disabled
} = this.props;

const {collapsed} = this.state;

return (
<StyledLayerConfigGroup
className={classnames('layer-config-group', {collapsed})}
className={classnames('layer-config-group', {collapsed, disabled})}
>
<StyledConfigGroupHeader
className="layer-config-group__header"
Expand Down
3 changes: 2 additions & 1 deletion src/components/side-panel/layer-panel/layer-configurator.js
Expand Up @@ -736,10 +736,11 @@ export default function LayerConfiguratorFactory(SourceDataSelector) {
</LayerConfigGroup>

{/* Elevation */}
{featureTypes.polygon && visConfig.filled ? (
{featureTypes.polygon ? (
<LayerConfigGroup
{...visConfiguratorProps}
{...LAYER_VIS_CONFIGS.enable3d}
disabled={!visConfig.filled}
collapsible
>
<VisConfigSlider
Expand Down

0 comments on commit 0a24f07

Please sign in to comment.