mirror of
https://github.com/maputnik/editor.git
synced 2026-09-01 18:07:37 +00:00
656264f2bc
This is in continue to: - #850 - #848 The last files should be converted as part of this PR, there are only a handful left.
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import React from 'react'
|
|
import Icon from '@mdi/react'
|
|
import {
|
|
mdiMenuDown,
|
|
mdiMenuUp
|
|
} from '@mdi/js';
|
|
import {
|
|
AccordionItem,
|
|
AccordionItemHeading,
|
|
AccordionItemButton,
|
|
AccordionItemPanel,
|
|
} from 'react-accessible-accordion';
|
|
|
|
|
|
type LayerEditorGroupProps = {
|
|
"id"?: string
|
|
"data-wd-key"?: string
|
|
title: string
|
|
isActive: boolean
|
|
children: React.ReactElement
|
|
onActiveToggle(active: boolean): unknown
|
|
};
|
|
|
|
|
|
export default class LayerEditorGroup extends React.Component<LayerEditorGroupProps> {
|
|
render() {
|
|
return <AccordionItem uuid={this.props.id}>
|
|
<AccordionItemHeading className="maputnik-layer-editor-group"
|
|
data-wd-key={"layer-editor-group:"+this.props["data-wd-key"]}
|
|
onClick={_e => this.props.onActiveToggle(!this.props.isActive)}
|
|
>
|
|
<AccordionItemButton className="maputnik-layer-editor-group__button">
|
|
<span style={{flexGrow: 1}}>{this.props.title}</span>
|
|
<Icon
|
|
path={mdiMenuUp}
|
|
size={1}
|
|
className="maputnik-layer-editor-group__button__icon maputnik-layer-editor-group__button__icon--up"
|
|
/>
|
|
<Icon
|
|
path={mdiMenuDown}
|
|
size={1}
|
|
className="maputnik-layer-editor-group__button__icon maputnik-layer-editor-group__button__icon--down"
|
|
/>
|
|
</AccordionItemButton>
|
|
</AccordionItemHeading>
|
|
<AccordionItemPanel>
|
|
{this.props.children}
|
|
</AccordionItemPanel>
|
|
</AccordionItem>
|
|
}
|
|
}
|