mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 15:40:00 +00:00
- Moved all components into a single directory like nextjs - Made component names consistent with each other - Made component names consistent with their export class names - Added storybook for a few components with the aim to extend this further.
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
|
|
import IconLine from './IconLine.jsx'
|
|
import IconFill from './IconFill.jsx'
|
|
import IconSymbol from './IconSymbol.jsx'
|
|
import IconBackground from './IconBackground.jsx'
|
|
import IconCircle from './IconCircle.jsx'
|
|
import IconMissing from './IconMissing.jsx'
|
|
|
|
export default class IconLayer extends React.Component {
|
|
static propTypes = {
|
|
type: PropTypes.string.isRequired,
|
|
style: PropTypes.object,
|
|
}
|
|
|
|
render() {
|
|
const iconProps = { style: this.props.style }
|
|
switch(this.props.type) {
|
|
case 'fill-extrusion': return <IconBackground {...iconProps} />
|
|
case 'raster': return <IconFill {...iconProps} />
|
|
case 'hillshade': return <IconFill {...iconProps} />
|
|
case 'heatmap': return <IconFill {...iconProps} />
|
|
case 'fill': return <IconFill {...iconProps} />
|
|
case 'background': return <IconBackground {...iconProps} />
|
|
case 'line': return <IconLine {...iconProps} />
|
|
case 'symbol': return <IconSymbol {...iconProps} />
|
|
case 'circle': return <IconCircle {...iconProps} />
|
|
default: return <IconMissing {...iconProps} />
|
|
}
|
|
}
|
|
}
|
|
|