diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-04-29 15:47:42 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-04-29 16:06:51 +0900 |
commit | ee078c677bbb7756636898830f766465d426f68b (patch) | |
tree | 5087193dab11ad05950f6015d82b6e1749f58c0b /src/settings | |
parent | be900aa25ca205c467dcbbab9c284ef680441996 (diff) |
Declare types on settings
Diffstat (limited to 'src/settings')
-rw-r--r-- | src/settings/components/form/BlacklistForm.jsx | 6 | ||||
-rw-r--r-- | src/settings/components/form/KeymapsForm.jsx | 6 | ||||
-rw-r--r-- | src/settings/components/form/PropertiesForm.jsx | 6 | ||||
-rw-r--r-- | src/settings/components/form/SearchForm.jsx | 10 | ||||
-rw-r--r-- | src/settings/components/ui/Input.jsx | 8 |
5 files changed, 36 insertions, 0 deletions
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; |