From ee078c677bbb7756636898830f766465d426f68b Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 29 Apr 2019 15:47:42 +0900 Subject: [PATCH] Declare types on settings --- src/settings/components/form/BlacklistForm.jsx | 6 ++++++ src/settings/components/form/KeymapsForm.jsx | 6 ++++++ src/settings/components/form/PropertiesForm.jsx | 6 ++++++ src/settings/components/form/SearchForm.jsx | 10 ++++++++++ src/settings/components/ui/Input.jsx | 8 ++++++++ 5 files changed, 36 insertions(+) diff --git a/src/settings/components/form/BlacklistForm.jsx b/src/settings/components/form/BlacklistForm.jsx index 13571f1..7dad9ee 100644 --- a/src/settings/components/form/BlacklistForm.jsx +++ b/src/settings/components/form/BlacklistForm.jsx @@ -2,6 +2,7 @@ import './BlacklistForm.scss'; import AddButton from '../ui/AddButton'; import DeleteButton from '../ui/DeleteButton'; import React from 'react'; +import PropTypes from 'prop-types'; class BlacklistForm extends React.Component { @@ -49,4 +50,9 @@ class BlacklistForm extends React.Component { } } +BlacklistForm.propTypes = { + value: PropTypes.arrayOf(PropTypes.string), + onChange: PropTypes.func, +}; + export default BlacklistForm; diff --git a/src/settings/components/form/KeymapsForm.jsx b/src/settings/components/form/KeymapsForm.jsx index 25a3710..f5444fc 100644 --- a/src/settings/components/form/KeymapsForm.jsx +++ b/src/settings/components/form/KeymapsForm.jsx @@ -1,5 +1,6 @@ import './KeymapsForm.scss'; import React from 'react'; +import PropTypes from 'prop-types'; import Input from '../ui/Input'; import keymaps from '../../keymaps'; @@ -44,4 +45,9 @@ class KeymapsForm extends React.Component { } } +KeymapsForm.propTypes = { + value: PropTypes.objectOf(PropTypes.string), + onChange: PropTypes.func, +}; + export default KeymapsForm; diff --git a/src/settings/components/form/PropertiesForm.jsx b/src/settings/components/form/PropertiesForm.jsx index 77991fc..9143a7a 100644 --- a/src/settings/components/form/PropertiesForm.jsx +++ b/src/settings/components/form/PropertiesForm.jsx @@ -1,5 +1,6 @@ import './PropertiesForm.scss'; import React from 'react'; +import PropTypes from 'prop-types'; class PropertiesForm extends React.Component { @@ -57,4 +58,9 @@ class PropertiesForm extends React.Component { } } +PropertiesForm.propTypes = { + value: PropTypes.objectOf(PropTypes.any), + onChange: PropTypes.func, +}; + export default PropertiesForm; diff --git a/src/settings/components/form/SearchForm.jsx b/src/settings/components/form/SearchForm.jsx index f52fd5f..718cca1 100644 --- a/src/settings/components/form/SearchForm.jsx +++ b/src/settings/components/form/SearchForm.jsx @@ -1,5 +1,6 @@ import './SearchForm.scss'; import React from 'react'; +import PropTypes from 'prop-types'; import AddButton from '../ui/AddButton'; import DeleteButton from '../ui/DeleteButton'; @@ -75,4 +76,13 @@ class SearchForm extends React.Component { } } +SearchForm.propTypes = { + value: PropTypes.shape({ + default: PropTypes.string, + engines: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string)), + }), + onChange: PropTypes.func, + +}; + export default SearchForm; diff --git a/src/settings/components/ui/Input.jsx b/src/settings/components/ui/Input.jsx index d090f5b..13a246b 100644 --- a/src/settings/components/ui/Input.jsx +++ b/src/settings/components/ui/Input.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import './Input.scss'; class Input extends React.Component { @@ -49,4 +50,11 @@ class Input extends React.Component { } } +Input.propTypes = { + type: PropTypes.string, + error: PropTypes.string, + label: PropTypes.string, + value: PropTypes.string, +}; + export default Input;