From 7f4cc5d3f3f92338a464853c182b9d6a3ea850eb Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Sun, 27 Sep 2020 18:43:27 +0200 Subject: Replaced the old fields with the new ones --- frontend/src/components/fields/extensions/ColorField.js | 17 +++++++++-------- .../src/components/fields/extensions/ColorField.scss | 9 ++++----- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'frontend/src/components/fields/extensions') diff --git a/frontend/src/components/fields/extensions/ColorField.js b/frontend/src/components/fields/extensions/ColorField.js index edcb720..c1c210f 100644 --- a/frontend/src/components/fields/extensions/ColorField.js +++ b/frontend/src/components/fields/extensions/ColorField.js @@ -1,5 +1,5 @@ import React, {Component} from 'react'; -import {Button, ButtonGroup, Form, OverlayTrigger, Popover} from "react-bootstrap"; +import {OverlayTrigger, Popover} from "react-bootstrap"; import './ColorField.scss'; import InputField from "../InputField"; @@ -9,7 +9,6 @@ class ColorField extends Component { super(props); this.state = { - invalid: false }; this.colors = ["#E53935", "#D81B60", "#8E24AA", "#5E35B1", "#3949AB", "#1E88E5", "#039BE5", "#00ACC1", @@ -18,8 +17,7 @@ class ColorField extends Component { render() { const colorButtons = this.colors.map((color) => - { this.setState({color: color}); if (typeof this.props.onChange === "function") { @@ -44,16 +42,19 @@ class ColorField extends Component { ); + let buttonStyles = {}; + if (this.state.color) { + buttonStyles["backgroundColor"] = this.state.color; + } + return ( -
+
-
- +
-
); } diff --git a/frontend/src/components/fields/extensions/ColorField.scss b/frontend/src/components/fields/extensions/ColorField.scss index c8f617c..1c3931f 100644 --- a/frontend/src/components/fields/extensions/ColorField.scss +++ b/frontend/src/components/fields/extensions/ColorField.scss @@ -16,15 +16,14 @@ .color-picker { margin-bottom: 5.5px; - .btn-picker { - padding: 8.5px 15px; + .picker-button { + font-size: 0.8em; + padding: 8px 15px; border-bottom-right-radius: 5px; border-top-right-radius: 5px; - background-color: $color-indigo; + background-color: $color-primary-1; } } - - } .colors-container { -- cgit v1.2.3-70-g09d2