+
+ {errors.description ? (
+
{errors.description.join('; ')}
+ ) : null}
diff --git a/src/js/components/Select.js b/src/js/components/Select.js
index 195c6fe..77678af 100644
--- a/src/js/components/Select.js
+++ b/src/js/components/Select.js
@@ -12,6 +12,7 @@ import {
flatMap,
pathEq
} from "lodash/fp"
+import { trace } from "utils"
const customTheme = theme => ({
...theme,
@@ -23,7 +24,11 @@ const customTheme = theme => ({
}
})
-const customStyles = {
+const customStyles = props => ({
+ control: (base, _state) => ({
+ ...base,
+ borderColor: props.hasError ? "#FB3A2F" : base.borderColor
+ }),
groupHeading: (base, _state) => ({
...base,
color: "black",
@@ -31,7 +36,7 @@ const customStyles = {
fontWeight: "bold",
fontSize: "100%"
})
-}
+})
const filterOption = createFilter({
stringify: compose(
@@ -47,10 +52,10 @@ export default class Select extends Component {
name: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
options: PropTypes.array,
+ hasError: PropTypes.bool,
onChange: PropTypes.func.isRequired
};
-
static findOptionByValue = (selectOptions, value) => {
const options = flatMap(
option => (option.options ? option.options : option),
@@ -58,7 +63,7 @@ export default class Select extends Component {
)
return options.find(pathEq("value", value))
- }
+ };
handleChange = option => {
const { name, onChange } = this.props
@@ -67,7 +72,7 @@ export default class Select extends Component {
};
render() {
- const { value, ...passThroughProps } = this.props
+ const { value, hasError, ...passThroughProps } = this.props
return (
)
}
diff --git a/yarn.lock b/yarn.lock
index 807073b..7d383b1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1709,7 +1709,7 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"
-classnames@^2.2.5:
+classnames@^2.2.5, classnames@^2.2.6:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==