Declare types on settings

jh-changes
Shin'ya Ueoka 6 years ago
parent be900aa25c
commit ee078c677b
  1. 6
      src/settings/components/form/BlacklistForm.jsx
  2. 6
      src/settings/components/form/KeymapsForm.jsx
  3. 6
      src/settings/components/form/PropertiesForm.jsx
  4. 10
      src/settings/components/form/SearchForm.jsx
  5. 8
      src/settings/components/ui/Input.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;

@ -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;

@ -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;

@ -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;

@ -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;