From e69497fab457df486b2a7068bdd0283505461f8b Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 2 May 2019 11:12:28 +0900 Subject: Types src/settings --- src/settings/components/ui/AddButton.tsx | 5 ++- src/settings/components/ui/DeleteButton.tsx | 5 ++- src/settings/components/ui/Input.tsx | 52 ++++++++++++++++++++--------- 3 files changed, 45 insertions(+), 17 deletions(-) (limited to 'src/settings/components/ui') diff --git a/src/settings/components/ui/AddButton.tsx b/src/settings/components/ui/AddButton.tsx index 185a03b..0577068 100644 --- a/src/settings/components/ui/AddButton.tsx +++ b/src/settings/components/ui/AddButton.tsx @@ -1,7 +1,10 @@ import './AddButton.scss'; import React from 'react'; -class AddButton extends React.Component { +interface Props extends React.AllHTMLAttributes { +} + +class AddButton extends React.Component { render() { return { +} + +class DeleteButton extends React.Component { render() { return { + name: string; + type: string; + error?: string; + label: string; + value: string; + onValueChange?: (name: string, value: string) => void; + onBlur?: (e: React.FocusEvent) => void; +} - renderText(props) { +class Input extends React.Component { + renderText(props: Props) { let inputClassName = props.error ? 'input-error' : ''; + let pp = { ...props }; + delete pp.onValueChange; return
- +
; } - renderRadio(props) { + renderRadio(props: Props) { let inputClassName = props.error ? 'input-error' : ''; + let pp = { ...props }; + delete pp.onValueChange; return
; } - renderTextArea(props) { + renderTextArea(props: Props) { let inputClassName = props.error ? 'input-error' : ''; + let pp = { ...props }; + delete pp.onValueChange; return
-