aboutsummaryrefslogtreecommitdiff
path: root/vnext/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-21 14:11:04 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commitd31df5b89de18dc58c6ec7694b1490be2c633387 (patch)
treeb8d89b66714f914f1904cdfabc227426b7a588f3 /vnext/src
parent2c433fec318f67efed0633bdb209243162503299 (diff)
custom link property for Avatar
Diffstat (limited to 'vnext/src')
-rw-r--r--vnext/src/components/Avatar.js6
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
}