@@ -8,6 +8,7 @@ import { Helmet } from 'react-helmet';
8
8
import { PROD_URL , BACKEND_URL } from '../../constants' ;
9
9
import ReactMarkdown from 'react-markdown' ;
10
10
import SubmitList from '../submit/list' ;
11
+ import _get from 'lodash/get' ;
11
12
12
13
class ProfileComponent extends React . Component {
13
14
static propTypes = {
@@ -25,9 +26,9 @@ class ProfileComponent extends React.Component {
25
26
< meta property = "og:type" content = "profile" />
26
27
< meta property = "og:title" content = { `Check ${ profile . name } 's developer profile in codecorgi` } />
27
28
< meta property = "og:url" content = { `${ PROD_URL } /${ profile . profile_url } ` } />
28
- < meta property = "og:image" content = { `${ profile . avatar . url || corgiImg } ` } />
29
+ < meta property = "og:image" content = { `${ _get ( profile , ' avatar.url' , undefined ) || corgiImg } ` } />
29
30
< meta name = "twitter:title" content = { `codecorgi - ${ profile . name } 's developer profile` } />
30
- < meta name = "twitter:image" content = { `${ profile . avatar . url || corgiImg } ` } />
31
+ < meta name = "twitter:image" content = { `${ _get ( profile , ' avatar.url' , undefined ) || corgiImg } ` } />
31
32
</ Helmet >
32
33
< section className = "tint-bg img-bg-softer" style = { { backgroundImage : `url(${ bgImage } )` } } >
33
34
< div className = "container header-container" >
@@ -40,13 +41,13 @@ class ProfileComponent extends React.Component {
40
41
< header >
41
42
< h1 >
42
43
< div className = "profile-image" >
43
- { ! profile . avatar . url && < img src = { corgiImg } alt = { profile . name } /> }
44
- { profile . avatar . url && < img src = { profile . avatar . url } alt = { profile . name } /> }
44
+ { ! _get ( profile , ' avatar.url' , undefined ) && < img src = { corgiImg } alt = { profile . name } /> }
45
+ { _get ( profile , ' avatar.url' , undefined ) && < img src = { _get ( profile , ' avatar.url' , '' ) } alt = { profile . name } /> }
45
46
</ div >
46
- < span > { profile . name } </ span >
47
+ < span > { profile . name } </ span >
47
48
</ h1 >
48
- < p > { profile . profile . tagline } </ p >
49
- < p > < i className = "icon-___location" /> { profile . profile . ___location } </ p >
49
+ < p > { _get ( profile , ' profile.tagline' , '' ) } </ p >
50
+ < p > < i className = "icon-___location" /> { _get ( profile , ' profile.___location' , '' ) } </ p >
50
51
</ header >
51
52
</ div >
52
53
</ div >
@@ -55,7 +56,7 @@ class ProfileComponent extends React.Component {
55
56
< section className = "container profile-body" style = { { margin : '30px auto' } } >
56
57
< div className = "row" >
57
58
< div className = "col-xs-12" >
58
- < ReactMarkdown source = { profile . profile . bio } />
59
+ < ReactMarkdown source = { _get ( profile , ' profile.bio' , '' ) } />
59
60
</ div >
60
61
</ div >
61
62
{ submits && submits . length > 0 &&
0 commit comments