From d33b37cdb9d2956f5f2d23ab4e71e35db137b16e Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 19 Nov 2017 08:23:51 +0900 Subject: Use Preact for settings and show validation --- src/settings/components/ui/input.jsx | 50 +++++++++++++++++++++++++++++++++++ src/settings/components/ui/input.scss | 17 ++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/settings/components/ui/input.jsx create mode 100644 src/settings/components/ui/input.scss (limited to 'src/settings/components/ui') diff --git a/src/settings/components/ui/input.jsx b/src/settings/components/ui/input.jsx new file mode 100644 index 0000000..9b6c229 --- /dev/null +++ b/src/settings/components/ui/input.jsx @@ -0,0 +1,50 @@ +import { h, Component } from 'preact'; +import './input.scss'; + +class Input extends Component { + + renderRadio(props) { + let inputClasses = 'form-field-input'; + if (props.error) { + inputClasses += ' input-error'; + } + return
+ +
; + } + + renderTextArea(props) { + let inputClasses = 'form-field-input'; + if (props.error) { + inputClasses += ' input-error'; + } + return
+ +