Skip to content

Commit

Permalink
Migration of more components
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Dec 22, 2023
1 parent a36f56f commit a192b04
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import PropTypes from 'prop-types'
import Icon from '@mdi/react'
import {
mdiMenuDown,
Expand All @@ -13,21 +12,22 @@ import {
} from 'react-accessible-accordion';


export default class LayerEditorGroup extends React.Component {
static propTypes = {
"id": PropTypes.string,
"data-wd-key": PropTypes.string,
title: PropTypes.string.isRequired,
isActive: PropTypes.bool.isRequired,
children: PropTypes.element.isRequired,
onActiveToggle: PropTypes.func.isRequired
}
type LayerEditorGroupProps = {
"id"?: string
"data-wd-key"?: string
title: string
isActive: boolean
children: React.ReactElement
onActiveToggle(...args: unknown[]): 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)}
onClick={_e => this.props.onActiveToggle(!this.props.isActive)}
>
<AccordionItemButton className="maputnik-layer-editor-group__button">
<span style={{flexGrow: 1}}>{this.props.title}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React from 'react'
import PropTypes from 'prop-types'
import Collapser from './Collapser'

export default class LayerListGroup extends React.Component {
static propTypes = {
title: PropTypes.string.isRequired,
"data-wd-key": PropTypes.string,
isActive: PropTypes.bool.isRequired,
onActiveToggle: PropTypes.func.isRequired,
'aria-controls': PropTypes.string,
}
type LayerListGroupProps = {
title: string
"data-wd-key"?: string
isActive: boolean
onActiveToggle(...args: unknown[]): unknown
'aria-controls'?: string
};

export default class LayerListGroup extends React.Component<LayerListGroupProps> {
render() {
return <li className="maputnik-layer-list-group">
<div className="maputnik-layer-list-group-header"
data-wd-key={"layer-list-group:"+this.props["data-wd-key"]}
onClick={e => this.props.onActiveToggle(!this.props.isActive)}
onClick={_e => this.props.onActiveToggle(!this.props.isActive)}
>
<button
className="maputnik-layer-list-group-title"
Expand Down

0 comments on commit a192b04

Please sign in to comment.