diff options
author | Vitaly Takmazov | 2018-06-21 14:11:04 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:53 +0300 |
commit | d31df5b89de18dc58c6ec7694b1490be2c633387 (patch) | |
tree | b8d89b66714f914f1904cdfabc227426b7a588f3 /vnext/src/components | |
parent | 2c433fec318f67efed0633bdb209243162503299 (diff) |
custom link property for Avatar
Diffstat (limited to 'vnext/src/components')
-rw-r--r-- | vnext/src/components/Avatar.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js index c6dc71ec..73b885ad 100644 --- a/vnext/src/components/Avatar.js +++ b/vnext/src/components/Avatar.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { UserType } from './Types'; @@ -6,7 +7,7 @@ import { UserType } from './Types'; export default function Avatar(props) { return ( <div className="msg-avatar"> - <Link to={{ pathname: `/${props.user.uname}/`}}> + <Link to={{ pathname: props.link || `/${props.user.uname}/`}}> <img src={`//i.juick.com/a/${props.user.uid}.png`} alt={`${props.user.uname}`} /> </Link> </div> @@ -14,5 +15,6 @@ export default function Avatar(props) { } Avatar.propTypes = { - user: UserType + user: UserType, + link: PropTypes.string } |