diff options
author | Vitaly Takmazov | 2019-07-26 13:22:00 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | f707d3d524d8d16e2bb780764f029d85fc57ecc0 (patch) | |
tree | 1580074a665bd16c9744b5749c2a777700c5ae73 /vnext/src/ui/UploadButton.js | |
parent | 6016b0888e77497e15384f1cd024eb42672129a4 (diff) |
prop-types -> jsdoc
Diffstat (limited to 'vnext/src/ui/UploadButton.js')
-rw-r--r-- | vnext/src/ui/UploadButton.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/vnext/src/ui/UploadButton.js b/vnext/src/ui/UploadButton.js index 73cbbfcf..28a1f340 100644 --- a/vnext/src/ui/UploadButton.js +++ b/vnext/src/ui/UploadButton.js @@ -1,8 +1,18 @@ import React from 'react'; -import PropTypes from 'prop-types'; import Icon from './Icon'; +/** + * @typedef {Object} UploadButtonProps + * @property {string} value + * @property {React.MutableRefObject<HTMLInputElement>} inputRef + * @property {function} onChange + */ + +/** + * Upload button + * @param {UploadButtonProps} props + */ export default function UploadButton(props) { let openfile = () => { const input = props.inputRef.current; @@ -12,6 +22,10 @@ export default function UploadButton(props) { input.click(); } }; + + /** + * @param {React.ChangeEvent<HTMLInputElement>} event + */ let attachmentChanged = (event) => { props.onChange(event.target.value); }; @@ -26,12 +40,6 @@ export default function UploadButton(props) { ); } -UploadButton.propTypes = { - value: PropTypes.string.isRequired, - onChange: PropTypes.func.isRequired, - inputRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }) -}; - const inactiveStyle = { cursor: 'pointer', color: '#888' |