summaryrefslogtreecommitdiff
path: root/frontend/common
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-07 04:18:49 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-07 04:18:49 +0200
commit00a6735b02f62a1459d8bfc5c27eb2bc0d7084cd (patch)
tree9906dae75f1f1c6a3771f2e6d7b9e36f22cba43a /frontend/common
parentf5f22f7d77506ffe9c3723f4c958c1feabca6074 (diff)
font stylez!!!
Diffstat (limited to 'frontend/common')
-rw-r--r--frontend/common/form.component.js20
-rw-r--r--frontend/common/index.js2
2 files changed, 21 insertions, 1 deletions
diff --git a/frontend/common/form.component.js b/frontend/common/form.component.js
index fb5b26d..cc0607d 100644
--- a/frontend/common/form.component.js
+++ b/frontend/common/form.component.js
@@ -39,6 +39,26 @@ export const NumberInput = props => (
</label>
)
+export const ColorInput = props => (
+ <label className={props.error ? 'error color' : 'text color'}>
+ <span>{props.title}</span>
+ <input
+ type="color"
+ required={props.required}
+ onChange={props.onChange}
+ name={props.name}
+ value={props.data[props.name]}
+ />
+ <input
+ type="text"
+ required={props.required}
+ onChange={props.onChange}
+ name={props.name}
+ value={props.data[props.name]}
+ />
+ </label>
+)
+
export const TextArea = props => (
<label className={props.error ? 'textarea error' : 'textarea'}>
{props.title && <span>{props.title}</span>}
diff --git a/frontend/common/index.js b/frontend/common/index.js
index d33442a..6f9747a 100644
--- a/frontend/common/index.js
+++ b/frontend/common/index.js
@@ -5,7 +5,7 @@ export {
export {
Select, Checkbox, Radio, FileInput, FileInputField,
TextInput, NumberInput, TextArea, SubmitButton,
- LabelDescription,
+ LabelDescription, ColorInput,
} from './form.component'
export {
Loader, Swatch, Dot, Columns, Statistic, Detections, Progress