diff options
Diffstat (limited to 'vnext/src/components/Avatar.js')
-rw-r--r-- | vnext/src/components/Avatar.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js index 9cb03267..4c3ac0b6 100644 --- a/vnext/src/components/Avatar.js +++ b/vnext/src/components/Avatar.js @@ -4,13 +4,19 @@ import { Link } from 'react-router-dom'; import { UserType } from './Types'; +import Icon from './Icon'; + const Avatar = React.memo(props => { return ( <div style={{ display: 'flex', padding: '12px' }}> <div className="msg-avatar"> - <Link to={{ pathname: props.link || `/${props.user.uname}/` }}> - <img src={props.user.avatar} alt={`${props.user.uname}`} /> - </Link> + { + props.user.uname ? + <Link to={{ pathname: props.link || `/${props.user.uname}/` }}> + <img src={props.user.avatar} alt={`${props.user.uname}`} /> + </Link> + : <Icon name="ei-spinner" size="m" /> + } </div> <div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}> <span> |