From 21bad041abd340266eda0ae27c8cff3d0f577f0a Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Mon, 19 Dec 2016 15:56:19 +0100 Subject: [PATCH] Remove layer specific components --- src/layers/background.jsx | 37 ------------------------ src/layers/editor.jsx | 60 +++++++++++---------------------------- src/layers/fill.jsx | 35 ----------------------- src/layers/line.jsx | 35 ----------------------- src/layers/symbol.jsx | 35 ----------------------- 5 files changed, 17 insertions(+), 185 deletions(-) delete mode 100644 src/layers/background.jsx delete mode 100644 src/layers/fill.jsx delete mode 100644 src/layers/line.jsx delete mode 100644 src/layers/symbol.jsx diff --git a/src/layers/background.jsx b/src/layers/background.jsx deleted file mode 100644 index 9b92e44..0000000 --- a/src/layers/background.jsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react' -import Immutable from 'immutable' -import Input from 'rebass/dist/Input' -import { PropertyGroup } from '../fields/spec' -import PureRenderMixin from 'react-addons-pure-render-mixin'; - -//TODO: All layers contain a lot of redundancy -export default class BackgroundLayer extends React.Component { - static propTypes = { - layer: React.PropTypes.instanceOf(Immutable.Map).isRequired, - onPaintChanged: React.PropTypes.func.isRequired, - onLayoutChanged: React.PropTypes.func.isRequired, - } - - constructor(props) { - super(props); - this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); - } - - render() { - return
- - -
- } -} - diff --git a/src/layers/editor.jsx b/src/layers/editor.jsx index 8418b14..d0e317c 100644 --- a/src/layers/editor.jsx +++ b/src/layers/editor.jsx @@ -7,14 +7,9 @@ import Space from 'rebass/dist/Space' import Tabs from 'react-simpletabs' import theme from '../theme.js' -import FillLayer from './fill.jsx' -import LineLayer from './line.jsx' -import SymbolLayer from './symbol.jsx' -import BackgroundLayer from './background.jsx' import SourceEditor from './source.jsx' import FilterEditor from '../filter/editor.jsx' - - +import { PropertyGroup } from '../fields/spec.jsx' import MdVisibility from 'react-icons/lib/md/visibility' import MdVisibilityOff from 'react-icons/lib/md/visibility-off' @@ -90,42 +85,6 @@ export class LayerEditor extends React.Component { this.props.onLayerChanged(changedLayer) } - layerFromType(type) { - if (type === "fill") { - return - } - - if (type === "background") { - return - } - - if (type === "line") { - return - } - - if (type === "symbol") { - return - } - - return - } - toggleVisibility() { if(this.props.layer.has('layout') && this.props.layer.getIn(['layout', 'visibility']) === 'none') { this.onLayoutChanged('visibility', 'visible') @@ -158,7 +117,22 @@ export class LayerEditor extends React.Component {
- {this.layerFromType(this.props.layer.get('type'))} + +
+
+ +
+
diff --git a/src/layers/fill.jsx b/src/layers/fill.jsx deleted file mode 100644 index c656ada..0000000 --- a/src/layers/fill.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import Immutable from 'immutable' -import { PropertyGroup } from '../fields/spec' -import PureRenderMixin from 'react-addons-pure-render-mixin'; - -//TODO: All layers contain a lot of redundancy -export default class FillLayer extends React.Component { - static propTypes = { - layer: React.PropTypes.instanceOf(Immutable.Map).isRequired, - onPaintChanged: React.PropTypes.func.isRequired, - onLayoutChanged: React.PropTypes.func.isRequired, - } - - constructor(props) { - super(props); - this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); - } - - render() { - return
- - -
- } -} diff --git a/src/layers/line.jsx b/src/layers/line.jsx deleted file mode 100644 index d41c2cc..0000000 --- a/src/layers/line.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import Immutable from 'immutable' -import { PropertyGroup } from '../fields/spec' -import PureRenderMixin from 'react-addons-pure-render-mixin'; - -//TODO: All layers contain a lot of redundancy -export default class LineLayer extends React.Component { - static propTypes = { - layer: React.PropTypes.instanceOf(Immutable.Map).isRequired, - onPaintChanged: React.PropTypes.func.isRequired, - onLayoutChanged: React.PropTypes.func.isRequired, - } - - constructor(props) { - super(props); - this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); - } - - render() { - return
- - -
- } -} diff --git a/src/layers/symbol.jsx b/src/layers/symbol.jsx deleted file mode 100644 index 6478b0b..0000000 --- a/src/layers/symbol.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import Immutable from 'immutable' -import PureRenderMixin from 'react-addons-pure-render-mixin'; -import { PropertyGroup } from '../fields/spec' - -//TODO: All layers contain a lot of redundancy -export default class SymbolLayer extends React.Component { - static propTypes = { - layer: React.PropTypes.instanceOf(Immutable.Map).isRequired, - onPaintChanged: React.PropTypes.func.isRequired, - onLayoutChanged: React.PropTypes.func.isRequired, - } - - constructor(props) { - super(props); - this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); - } - - render() { - return
- - -
- } -}