aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/fields/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/fields/extensions')
-rw-r--r--frontend/src/components/fields/extensions/ColorField.js17
-rw-r--r--frontend/src/components/fields/extensions/NumericField.js6
2 files changed, 11 insertions, 12 deletions
diff --git a/frontend/src/components/fields/extensions/ColorField.js b/frontend/src/components/fields/extensions/ColorField.js
index f1c0caf..fd30988 100644
--- a/frontend/src/components/fields/extensions/ColorField.js
+++ b/frontend/src/components/fields/extensions/ColorField.js
@@ -15,22 +15,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import {OverlayTrigger, Popover} from "react-bootstrap";
-import './ColorField.scss';
-import InputField from "../InputField";
import validation from "../../../validation";
+import InputField from "../InputField";
+import "./ColorField.scss";
class ColorField extends Component {
constructor(props) {
super(props);
- this.state = {
- };
+ this.state = {};
- this.colors = ["#E53935", "#D81B60", "#8E24AA", "#5E35B1", "#3949AB", "#1E88E5", "#039BE5", "#00ACC1",
- "#00897B", "#43A047", "#7CB342", "#9E9D24", "#F9A825", "#FB8C00", "#F4511E", "#6D4C41"];
+ this.colors = ["#e53935", "#d81b60", "#8e24aa", "#5e35b1", "#3949ab", "#1e88e5", "#039be5", "#00acc1",
+ "#00897b", "#43a047", "#7cb342", "#9e9d24", "#f9a825", "#fb8c00", "#f4511e", "#6d4c41"];
}
componentDidUpdate(prevProps, prevState, snapshot) {
@@ -55,7 +54,7 @@ class ColorField extends Component {
this.props.onChange(color);
}
document.body.click(); // magic to close popup
- }} />);
+ }}/>);
const popover = (
<Popover id="popover-basic">
@@ -82,7 +81,7 @@ class ColorField extends Component {
<div className="field color-field">
<div className="color-input">
<InputField {...this.props} onChange={this.onChange} invalid={this.state.invalid} name="color"
- error={null} />
+ error={null}/>
<div className="color-picker">
<OverlayTrigger trigger="click" placement="top" overlay={popover} rootClose>
<button type="button" className="picker-button" style={buttonStyles}>pick</button>
diff --git a/frontend/src/components/fields/extensions/NumericField.js b/frontend/src/components/fields/extensions/NumericField.js
index d4d027d..a6cba26 100644
--- a/frontend/src/components/fields/extensions/NumericField.js
+++ b/frontend/src/components/fields/extensions/NumericField.js
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import InputField from "../InputField";
class NumericField extends Component {
@@ -35,7 +35,7 @@ class NumericField extends Component {
}
onChange = (value) => {
- value = value.toString().replace(/[^\d]/gi, '');
+ value = value.toString().replace(/[^\d]/gi, "");
let intValue = 0;
if (value !== "") {
intValue = parseInt(value, 10);
@@ -53,7 +53,7 @@ class NumericField extends Component {
render() {
return (
<InputField {...this.props} onChange={this.onChange} defaultValue={this.props.defaultValue || "0"}
- invalid={this.state.invalid} />
+ invalid={this.state.invalid}/>
);
}