From ca04f603939612b9285c1328a34a71be5ea81959 Mon Sep 17 00:00:00 2001 From: lukasmartinelli Date: Fri, 9 Sep 2016 14:09:02 +0200 Subject: [PATCH] Nicer text input --- src/index.scss | 3 +++ src/layers.jsx | 67 +++++++++++++++++++++++++++++++++++++++++++------- src/map.jsx | 9 ++++--- src/theme.js | 14 +++++++++-- 4 files changed, 79 insertions(+), 14 deletions(-) diff --git a/src/index.scss b/src/index.scss index e69de29..fa9caa6 100644 --- a/src/index.scss +++ b/src/index.scss @@ -0,0 +1,3 @@ +.app { + +} diff --git a/src/layers.jsx b/src/layers.jsx index c36e9b6..49d5dda 100644 --- a/src/layers.jsx +++ b/src/layers.jsx @@ -1,7 +1,8 @@ import React from 'react' -import { Heading, Checkbox, Slider, Switch, Input, Panel, PanelHeader, Toolbar, NavItem, Tooltip, Container, Space} from 'rebass' +import { Block, ButtonCircle, Heading, Checkbox, Slider, Switch, Input, Panel, PanelHeader, Toolbar, NavItem, Tooltip, Container, Space} from 'rebass' import { Button, Text } from 'rebass' +import {MdArrowDropDown, MdArrowDropUp, MdAddToPhotos, MdDelete, MdVisibilityOff} from 'react-icons/lib/md'; import Collapse from 'react-collapse' import theme from './theme.js' import scrollbars from './scrollbars.scss' @@ -9,9 +10,15 @@ import scrollbars from './scrollbars.scss' export class FillLayer extends React.Component { render() { return
- - + + + + + +
+ + } } @@ -28,6 +35,10 @@ export class SymbolLayer extends React.Component { } export class LayerPanel extends React.Component { + static childContextTypes = { + reactIconBase: React.PropTypes.object + } + constructor(props) { super(props); this.toggleLayer = this.toggleLayer.bind(this); @@ -36,6 +47,15 @@ export class LayerPanel extends React.Component { } } + getChildContext () { + return { + reactIconBase: { + size: theme.fontSizes[4], + color: theme.colors.lowgray, + } + } + } + toggleLayer() { this.setState({isOpened: !this.state.isOpened}) } @@ -48,14 +68,33 @@ export class LayerPanel extends React.Component { layer = } - return - - #{this.props.layer.id} - + return
+ + + #{this.props.layer.id} + + + + + + + + + +
{layer} +
- +
} } @@ -65,7 +104,17 @@ export class LayerEditor extends React.Component { return }); return
- Layers + + + Layers + + + + +
+ style={this.props.mapStyle} + accessToken="pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w"> + + } return
} diff --git a/src/theme.js b/src/theme.js index a967848..280a217 100644 --- a/src/theme.js +++ b/src/theme.js @@ -7,6 +7,7 @@ const baseColors = { black: '#242424', gray: '#313131', midgray: '#778', + lowgray: '#dcdcdc', white: '#fff', blue: '#00d9f7', green: '#0f8', @@ -29,7 +30,7 @@ const colors = { ...themeColors } -const scale = [3, 5, 10, 20, 40] +const scale = [3, 5, 10, 30, 40] const fontSizes = [28, 24, 20, 16, 14, 12, 10] const border = { @@ -47,7 +48,7 @@ const dark = { inverted: colors.midGray, ...border, - Panel: { + Block: { backgroundColor: colors.gray, ...border, borderLeft: 0, @@ -76,6 +77,15 @@ const dark = { Header: { fontWeight: 400, }, + ButtonCircle : { + }, + Toolbar: { + fontWeight: 400, + minHeight: scale[3] + }, + Input: { + fontSize: fontSizes[5], + }, } export default dark