Skip to content

Commit 27e8f52

Browse files
author
David Silva
committed
Merge branch 'hotfix/0.10.3' into dev
2 parents 54cf4c0 + 6932295 commit 27e8f52

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
## 0.10.3
4+
- HOTFIX: Error in profile page
35
## 0.10.0
46

5-
- displaying projects and submissions in profile page
7+
- Displaying projects and submissions in profile page

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/profile/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Helmet } from 'react-helmet';
88
import { PROD_URL, BACKEND_URL } from '../../constants';
99
import ReactMarkdown from 'react-markdown';
1010
import SubmitList from '../submit/list';
11+
import _get from 'lodash/get';
1112

1213
class ProfileComponent extends React.Component {
1314
static propTypes = {
@@ -25,9 +26,9 @@ class ProfileComponent extends React.Component {
2526
<meta property="og:type" content="profile" />
2627
<meta property="og:title" content={ `Check ${profile.name}'s developer profile in codecorgi` } />
2728
<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}` } />
2930
<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}` } />
3132
</Helmet>
3233
<section className="tint-bg img-bg-softer" style={{ backgroundImage: `url(${bgImage})` }}>
3334
<div className="container header-container">
@@ -40,13 +41,13 @@ class ProfileComponent extends React.Component {
4041
<header>
4142
<h1>
4243
<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 } />}
4546
</div>
46-
<span>{profile.name}</span>
47+
<span>{ profile.name }</span>
4748
</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>
5051
</header>
5152
</div>
5253
</div>
@@ -55,7 +56,7 @@ class ProfileComponent extends React.Component {
5556
<section className="container profile-body" style={{ margin: '30px auto' }}>
5657
<div className="row">
5758
<div className="col-xs-12">
58-
<ReactMarkdown source={ profile.profile.bio } />
59+
<ReactMarkdown source={ _get(profile, 'profile.bio', '') } />
5960
</div>
6061
</div>
6162
{submits && submits.length > 0 &&

0 commit comments

Comments
 (0)