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/Avatar.js | |
parent | 6016b0888e77497e15384f1cd024eb42672129a4 (diff) |
prop-types -> jsdoc
Diffstat (limited to 'vnext/src/ui/Avatar.js')
-rw-r--r-- | vnext/src/ui/Avatar.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/vnext/src/ui/Avatar.js b/vnext/src/ui/Avatar.js index ecce4e9f..e08c1ba4 100644 --- a/vnext/src/ui/Avatar.js +++ b/vnext/src/ui/Avatar.js @@ -1,14 +1,23 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; -import { UserType } from './Types'; - import Icon from './Icon'; import './Avatar.css'; -function Avatar({ user, style, link, children}) { +/** + * @typedef {Object} AvatarProps + * @property {import('../api').User} user + * @property {React.CSSProperties=} style + * @property {string=} link + * @property {React.ReactNode=} children + */ + +/** + * Avatar component + * @param {AvatarProps} props + */ +function Avatar({ user, style, link, children }) { return ( <div className="Avatar" style={style}> <div className="msg-avatar"> @@ -35,10 +44,3 @@ function Avatar({ user, style, link, children}) { } export default memo(Avatar); - -Avatar.propTypes = { - user: UserType, - link: PropTypes.string, - style: PropTypes.object, - children: PropTypes.node -}; |