From dc39f2b96cf38a8b0cf6c170ddbf38586d3b20f6 Mon Sep 17 00:00:00 2001 From: Jovert Lota Palonpon Date: Thu, 4 Apr 2019 14:03:59 +0800 Subject: [PATCH] Utilized avatar pictures, closes #30 --- .../js/views/__backoffice/partials/Header.js | 36 +++++++++++++--- resources/js/views/__backoffice/users/List.js | 43 +++++++++++-------- 2 files changed, 55 insertions(+), 24 deletions(-) diff --git a/resources/js/views/__backoffice/partials/Header.js b/resources/js/views/__backoffice/partials/Header.js index 6880dfb..8561339 100644 --- a/resources/js/views/__backoffice/partials/Header.js +++ b/resources/js/views/__backoffice/partials/Header.js @@ -37,6 +37,7 @@ import { Settings as SettingsIcon, } from '@material-ui/icons'; +import * as RandomUtils from '../../../utils/Random'; import { LightbulbOff as LightbulbOffIcon, LightbulbOn as LightbulbOnIcon, @@ -507,13 +508,34 @@ const Header = props => { } color="inherit" > - - - {`${user.firstname.charAt( - 0, - )}${user.lastname.charAt(0)}`} - - + {user.hasOwnProperty('thumbnail_url') && + user.thumbnail_url !== null ? ( + + ) : ( + + + {`${user.firstname.charAt( + 0, + )}${user.lastname.charAt( + 0, + )}`} + + + )} diff --git a/resources/js/views/__backoffice/users/List.js b/resources/js/views/__backoffice/users/List.js index 126607b..1b9e2e5 100755 --- a/resources/js/views/__backoffice/users/List.js +++ b/resources/js/views/__backoffice/users/List.js @@ -403,23 +403,32 @@ class List extends Component { wrap="nowrap" > - - - {`${user.firstname.charAt( - 0, - )}${user.lastname.charAt(0)}`} - - + {user.hasOwnProperty('thumbnail_url') && + user.thumbnail_url !== null ? ( + + ) : ( + + + {`${user.firstname.charAt( + 0, + )}${user.lastname.charAt(0)}`} + + + )} {user.name}