Add layer button and increase contrast

This commit is contained in:
Lukas Martinelli 2017-01-11 15:48:15 +01:00
parent 3917a3e323
commit cb752c0343
6 changed files with 81 additions and 52 deletions

View file

@ -1,7 +1,9 @@
import React from 'react' import React from 'react'
import cloneDeep from 'lodash.clonedeep' import cloneDeep from 'lodash.clonedeep'
import Button from '../Button'
import LayerListItem from './LayerListItem' import LayerListItem from './LayerListItem'
import AddIcon from 'react-icons/lib/md/add-circle-outline'
import style from '../../libs/style.js' import style from '../../libs/style.js'
import {SortableContainer, SortableHandle, arrayMove} from 'react-sortable-hoc'; import {SortableContainer, SortableHandle, arrayMove} from 'react-sortable-hoc';
@ -67,9 +69,16 @@ class LayerListContainer extends React.Component {
onLayerVisibilityToggle={this.onLayerVisibilityToggle.bind(this)} onLayerVisibilityToggle={this.onLayerVisibilityToggle.bind(this)}
/> />
}) })
return <ul className="maputnik-layer-list-container"> return <div className="maputnik-layer-list">
<header className="maputnik-layer-list-header">
<span>Layers</span>
<span className="maputnik-space" />
<Button className="maputnik-add-layer">Add Layer</Button>
</header>
<ul className="maputnik-layer-list-container">
{layerPanels} {layerPanels}
</ul> </ul>
</div>
} }
} }

View file

@ -46,7 +46,7 @@ class IconAction extends React.Component {
render() { render() {
return <a return <a
className="maputnik-icon-action" className="maputnik-layer-list-icon-action"
onClick={this.props.onClick} onClick={this.props.onClick}
> >
{this.renderIcon()} {this.renderIcon()}

View file

@ -14,7 +14,7 @@
html { html {
color: $color-white; color: $color-white;
font-size: $font-size-2; font-size: $font-size-5;
box-sizing: border-box; box-sizing: border-box;
} }
@ -33,6 +33,7 @@ p {
h1 { h1 {
font-size: $font-size-2; font-size: $font-size-2;
margin-bottom: $margin-3; margin-bottom: $margin-3;
font-weight: bold;
} }
h2 { h2 {

View file

@ -19,7 +19,6 @@
box-sizing: border-box; box-sizing: border-box;
font-size: $font-size-6; font-size: $font-size-6;
line-height: 2; line-height: 2;
color: $color-lowgray;
user-select: none; user-select: none;
position: relative; position: relative;
vertical-align: top; vertical-align: top;
@ -86,8 +85,8 @@
margin: $margin-3; margin: $margin-3;
&-label { &-label {
display: inline-block;
color: $color-lowgray; color: $color-lowgray;
display: inline-block;
user-select: none; user-select: none;
width: 50%; width: 50%;
vertical-align: top; vertical-align: top;
@ -124,3 +123,4 @@
color: $color-red; color: $color-red;
} }
} }

View file

@ -10,7 +10,7 @@
padding-right: $margin-2; padding-right: $margin-2;
border: none; border: none;
background-color: $color-gray; background-color: $color-gray;
color: $color-lowgray; color: lighten($color-lowgray, 12);
} }
.maputnik-string { .maputnik-string {

View file

@ -1,11 +1,29 @@
// LAYER LIST // LAYER LIST
.maputnik-layer-list-container { .maputnik-add-layer {
}
.maputnik-layer-list {
&-header{
padding: $margin-2;
font-weight: bold;
font-size: $font-size-5;
color: $color-lowgray;
display: flex;
flex-direction: row;
> * {
vertical-align: middle;
margin-bottom: 0;
}
}
&-container {
padding: 0; padding: 0;
margin: 0; margin: 0;
padding-bottom: $margin-5; padding-bottom: $margin-5;
} }
.maputnik-layer-list-item { &-item {
font-weight: 400; font-weight: 400;
color: $color-lowgray; color: $color-lowgray;
font-size: $font-size-6; font-size: $font-size-6;
@ -22,40 +40,41 @@
line-height: 1.3; line-height: 1.3;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.maputnik-icon-action svg { &-icon-action svg {
fill: $color-black; fill: $color-black;
} }
.maputnik-layer-list-item:hover, .maputnik-layer-list-item-selected { .maputnik-layer-list-item:hover, .maputnik-layer-list-item-selected {
background-color: lighten($color-black, 2); background-color: lighten($color-black, 2);
.maputnik-icon-action svg { .maputnik-layer-list-icon-action svg {
fill: $color-midgray; fill: darken($color-lowgray, 0.5);
&:hover { &:hover {
fill: $color-lowgray; fill: $color-white;
}
} }
} }
}
.maputnik-layer-list-item-selected { &-item-selected {
color: $color-white; color: $color-white;
} }
.maputnik-layer-list-item-id { &-item-id {
width: 115px; width: 115px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
}
} }
// FILTER EDITOR // FILTER EDITOR
.maputnik-layer-editor-group { .maputnik-layer-editor-group {
font-weight: bold; font-weight: bold;
font-size: $font-size-5; font-size: $font-size-5;
background-color: lighten($color-black, 2); background-color: lighten($color-black, 2);
color: $color-lowgray; color: $color-lowgray;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;