mirror of
https://github.com/maputnik/editor.git
synced 2026-02-10 22:50:00 +00:00
Adds lint to CI and fixes errors. I'm not sure I'm fully proud of all the solutions there. But there's no lint issues and the lint is being checked as part of the CI. --------- Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
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>
|
|
}
|
|
}
|