mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 23:50:02 +00:00
Remove Immutable JS
This commit is contained in:
@@ -35,7 +35,6 @@ class ColorField extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log(Color(this.props.value))
|
||||
const picker = <div style={{
|
||||
position: 'absolute',
|
||||
left: 163,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from 'react'
|
||||
import Immutable from 'immutable'
|
||||
import GlSpec from 'mapbox-gl-style-spec/reference/latest.min.js'
|
||||
|
||||
import ZoomSpecField from './ZoomSpecField'
|
||||
@@ -26,7 +25,7 @@ function getGroupName(layerType, fieldName) {
|
||||
export default class PropertyGroup extends React.Component {
|
||||
static propTypes = {
|
||||
layer: React.PropTypes.object.isRequired,
|
||||
groupFields: React.PropTypes.instanceOf(Immutable.OrderedSet).isRequired,
|
||||
groupFields: React.PropTypes.array.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
@@ -50,7 +49,7 @@ export default class PropertyGroup extends React.Component {
|
||||
value={fieldValue}
|
||||
fieldSpec={fieldSpec}
|
||||
/>
|
||||
}).toIndexedSeq()
|
||||
})
|
||||
|
||||
return <div style={{
|
||||
padding: margins[2],
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from 'react'
|
||||
import Immutable from 'immutable'
|
||||
import color from 'color'
|
||||
|
||||
import GlSpec from 'mapbox-gl-style-spec/reference/latest.min.js'
|
||||
@@ -12,10 +11,6 @@ import StringField from './StringField'
|
||||
import input from '../../config/input.js'
|
||||
import theme from '../../config/rebass.js'
|
||||
|
||||
function isZoomField(value) {
|
||||
return Immutable.Map.isMap(value)
|
||||
}
|
||||
|
||||
function labelFromFieldName(fieldName) {
|
||||
let label = fieldName.split('-').slice(1).join(' ')
|
||||
if(label.length > 0) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from 'react'
|
||||
import Immutable from 'immutable'
|
||||
import Color from 'color'
|
||||
|
||||
import NumberField from './NumberField'
|
||||
@@ -14,7 +13,7 @@ import colors from '../../config/colors.js'
|
||||
import { margins } from '../../config/scales.js'
|
||||
|
||||
function isZoomField(value) {
|
||||
return Immutable.Map.isMap(value)
|
||||
return typeof value === 'object' && value.stops
|
||||
}
|
||||
|
||||
const specFieldProps = {
|
||||
@@ -46,9 +45,9 @@ export default class ZoomSpecField extends React.Component {
|
||||
</label>
|
||||
|
||||
if(isZoomField(this.props.value)) {
|
||||
const zoomFields = this.props.value.get('stops').map(stop => {
|
||||
const zoomLevel = stop.get(0)
|
||||
const value = stop.get(1)
|
||||
const zoomFields = this.props.value.stops.map(stop => {
|
||||
const zoomLevel = stop[0]
|
||||
const value = stop[1]
|
||||
|
||||
return <div style={input.property} key={zoomLevel}>
|
||||
{label}
|
||||
@@ -71,7 +70,7 @@ export default class ZoomSpecField extends React.Component {
|
||||
max={22}
|
||||
/>
|
||||
</div>
|
||||
}).toSeq()
|
||||
})
|
||||
return <div style={{
|
||||
border: 1,
|
||||
borderStyle: 'solid',
|
||||
|
||||
Reference in New Issue
Block a user