mirror of
https://github.com/maputnik/editor.git
synced 2026-08-26 15:07:41 +00:00
Switch to own input classes
This commit is contained in:
+12
-7
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Select, Input } from 'rebass'
|
import { Label, Input } from 'rebass'
|
||||||
|
import {inputBase} from '../theme'
|
||||||
|
|
||||||
/*** Number fields with support for min, max and units and documentation*/
|
/*** Number fields with support for min, max and units and documentation*/
|
||||||
class ColorField extends React.Component {
|
class ColorField extends React.Component {
|
||||||
@@ -16,12 +17,16 @@ static propTypes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Input
|
return <div>
|
||||||
onChange={this.onChange.bind(this)}
|
<Label htmlFor={this.props.name} children={this.props.name} />
|
||||||
label={this.props.name}
|
<input
|
||||||
name={this.props.name}
|
style={inputBase}
|
||||||
value={this.props.value}
|
name={this.props.name}
|
||||||
/>
|
placeholder={this.props.default}
|
||||||
|
value={this.props.value}
|
||||||
|
onChange={this.onChange.bind(this)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-8
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Select, Input } from 'rebass'
|
import { Label, Input } from 'rebass'
|
||||||
|
import {inputBase} from '../theme'
|
||||||
|
|
||||||
/*** Number fields with support for min, max and units and documentation*/
|
/*** Number fields with support for min, max and units and documentation*/
|
||||||
class NumberField extends React.Component {
|
class NumberField extends React.Component {
|
||||||
@@ -19,13 +20,17 @@ class NumberField extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Input
|
return <div>
|
||||||
type="number"
|
<Label htmlFor={this.props.name} children={this.props.name} />
|
||||||
onChange={this.onChange.bind(this)}
|
<input
|
||||||
label={this.props.name}
|
style={inputBase}
|
||||||
name={this.props.name}
|
type="number"
|
||||||
message={this.props.doc}
|
name={this.props.name}
|
||||||
/>
|
placeholder={this.props.default}
|
||||||
|
value={this.props.value}
|
||||||
|
onChange={this.onChange.bind(this)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Input } from 'rebass'
|
import { Label, Input } from 'rebass'
|
||||||
|
import {inputBase} from '../theme'
|
||||||
|
|
||||||
/*** Number fields with support for min, max and units and documentation*/
|
/*** Number fields with support for min, max and units and documentation*/
|
||||||
class StringField extends React.Component {
|
class StringField extends React.Component {
|
||||||
@@ -16,12 +17,16 @@ static propTypes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Input
|
return <div>
|
||||||
onChange={this.onChange.bind(this)}
|
<Label htmlFor={this.props.name} children={this.props.name} />
|
||||||
label={this.props.name}
|
<input
|
||||||
name={this.props.name}
|
style={inputBase}
|
||||||
value={this.props.value}
|
name={this.props.name}
|
||||||
/>
|
placeholder={this.props.default}
|
||||||
|
value={this.props.value}
|
||||||
|
onChange={this.onChange.bind(this)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class SourceList extends React.Component {
|
|||||||
return <div>
|
return <div>
|
||||||
<Toolbar style={{marginRight: 20}}>
|
<Toolbar style={{marginRight: 20}}>
|
||||||
<NavItem>
|
<NavItem>
|
||||||
<Heading>Layers</Heading>
|
<Heading>Sources</Heading>
|
||||||
</NavItem>
|
</NavItem>
|
||||||
<Space auto x={1} />
|
<Space auto x={1} />
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
|||||||
@@ -37,6 +37,16 @@ export const colors = {
|
|||||||
...themeColors
|
...themeColors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const inputBase = {
|
||||||
|
display: 'block',
|
||||||
|
border: '1px solid rgb(36, 36, 36)',
|
||||||
|
height: 30,
|
||||||
|
width: '100%',
|
||||||
|
paddingLeft: 5,
|
||||||
|
paddingRight: 5,
|
||||||
|
backgroundColor: colors.gray,
|
||||||
|
}
|
||||||
|
|
||||||
const scale = [3, 5, 10, 30, 40]
|
const scale = [3, 5, 10, 30, 40]
|
||||||
const fontSizes = [28, 24, 20, 16, 14, 12, 10]
|
const fontSizes = [28, 24, 20, 16, 14, 12, 10]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user