diff options
author | 2018-11-05 12:46:18 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:53 +0300 | |
commit | 94741fb25dd6c60571e78393c43355d8ddf8b64d (patch) | |
tree | 850eb48d49291f612be088cee22012cf64b3f1d1 /vnext/src/components/Avatar.js | |
parent | de266f3bf9c92c425a4050acd76106ccb48c5b37 (diff) |
AvatarLink
Diffstat (limited to 'vnext/src/components/Avatar.js')
-rw-r--r-- | vnext/src/components/Avatar.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js index 31d7dd34..c42a048a 100644 --- a/vnext/src/components/Avatar.js +++ b/vnext/src/components/Avatar.js @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom'; import { UserType } from './Types'; -const Avatar = React.memo(function AvatarComponent(props) { +const Avatar = React.memo(props => { return ( <div style={{ display: 'flex' }}> <div className="msg-avatar"> @@ -26,6 +26,15 @@ const Avatar = React.memo(function AvatarComponent(props) { export default Avatar; +export const AvatarLink = React.memo(props => { + return ( + <Link to={{ pathname: props.link || `/${props.user.uname}/` }}> + <img src={`//i.juick.com/a/${props.user.uid}.png`} alt={`${props.user.uname}`} /> + {props.user.uname} + </Link> + ); +}); + Avatar.propTypes = { user: UserType, link: PropTypes.string, |