diff options
author | Vitaly Takmazov | 2018-12-07 13:51:02 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:54 +0300 |
commit | 6ecedec4983b00674089d07b55122b545d017688 (patch) | |
tree | 4907ab32d4f4f8b4436c4709f80c5e540be3e8d6 | |
parent | fc0900190541d478cbe1ba682f52893d949d0c29 (diff) |
Avatar spinner
-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> |