File tree Expand file tree Collapse file tree 2 files changed +55
-24
lines changed
resources/js/views/__backoffice Expand file tree Collapse file tree 2 files changed +55
-24
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
37
37
Settings as SettingsIcon ,
38
38
} from '@material-ui/icons' ;
39
39
40
+ import * as RandomUtils from '../../../utils/Random' ;
40
41
import {
41
42
LightbulbOff as LightbulbOffIcon ,
42
43
LightbulbOn as LightbulbOnIcon ,
@@ -507,13 +508,34 @@ const Header = props => {
507
508
}
508
509
color = "inherit"
509
510
>
510
- < Avatar className = { classes . avatar } >
511
- < Typography >
512
- { `${ user . firstname . charAt (
513
- 0 ,
514
- ) } ${ user . lastname . charAt ( 0 ) } `}
515
- </ Typography >
516
- </ Avatar >
511
+ { user . hasOwnProperty ( 'thumbnail_url' ) &&
512
+ user . thumbnail_url !== null ? (
513
+ < Avatar
514
+ alt = { user . name }
515
+ src = { user . thumbnail_url }
516
+ />
517
+ ) : (
518
+ < Avatar
519
+ style = { {
520
+ fontSize : 17 ,
521
+ backgroundColor : RandomUtils . _color (
522
+ user . firstname . length -
523
+ user . created_at . charAt (
524
+ user . created_at
525
+ . length - 2 ,
526
+ ) ,
527
+ ) ,
528
+ } }
529
+ >
530
+ < Typography >
531
+ { `${ user . firstname . charAt (
532
+ 0 ,
533
+ ) } ${ user . lastname . charAt (
534
+ 0 ,
535
+ ) } `}
536
+ </ Typography >
537
+ </ Avatar >
538
+ ) }
517
539
</ IconButton >
518
540
519
541
< AccountMenu { ...props } />
Original file line number Diff line number Diff line change @@ -403,23 +403,32 @@ class List extends Component {
403
403
wrap = "nowrap"
404
404
>
405
405
< Grid item style = { { marginRight : 10 } } >
406
- < Avatar
407
- style = { {
408
- fontSize : 17 ,
409
- backgroundColor : RandomUtils . _color (
410
- user . firstname . length -
411
- user . created_at . charAt (
412
- user . created_at . length - 2 ,
413
- ) ,
414
- ) ,
415
- } }
416
- >
417
- < Typography >
418
- { `${ user . firstname . charAt (
419
- 0 ,
420
- ) } ${ user . lastname . charAt ( 0 ) } `}
421
- </ Typography >
422
- </ Avatar >
406
+ { user . hasOwnProperty ( 'thumbnail_url' ) &&
407
+ user . thumbnail_url !== null ? (
408
+ < Avatar
409
+ alt = { user . name }
410
+ src = { user . thumbnail_url }
411
+ />
412
+ ) : (
413
+ < Avatar
414
+ style = { {
415
+ fontSize : 17 ,
416
+ backgroundColor : RandomUtils . _color (
417
+ user . firstname . length -
418
+ user . created_at . charAt (
419
+ user . created_at . length -
420
+ 2 ,
421
+ ) ,
422
+ ) ,
423
+ } }
424
+ >
425
+ < Typography >
426
+ { `${ user . firstname . charAt (
427
+ 0 ,
428
+ ) } ${ user . lastname . charAt ( 0 ) } `}
429
+ </ Typography >
430
+ </ Avatar >
431
+ ) }
423
432
</ Grid >
424
433
425
434
< Grid item > { user . name } </ Grid >
You can’t perform that action at this time.
0 commit comments