Commit 65612ae0 authored by Jason Salyers's avatar Jason Salyers
Browse files

Merge branch 'jsalyers-check-badge-type' into 'develop'

[JES] Add a check for proper badge type. Apparently the new hivefest badge...

See merge request !191
parents acfafe93 10eb9657
......@@ -40,42 +40,58 @@ class SubscriptionsList extends React.Component {
if (hivebuzzBadges) {
hivebuzzBadges.forEach(badge => {
const type = badge.get('type');
badgesTypes[type].push(
<a
className="BadgesAchievements__badge_image"
key={badge.get('id')}
href={`https://hivebuzz.me/@${username}`}
target="_blank"
rel="noopener noreferrer"
>
<img
src={badge.get('url')}
alt={badge.get('title')}
title={badge.get('title')}
/>
</a>
);
let valid = true;
if (
badgesTypes[type] === undefined ||
badgesTypes[type] === null
)
valid = false;
if (valid) {
badgesTypes[type].push(
<a
className="BadgesAchievements__badge_image"
key={badge.get('id')}
href={`https://hivebuzz.me/@${username}`}
target="_blank"
rel="noopener noreferrer"
>
<img
src={badge.get('url')}
alt={badge.get('title')}
title={badge.get('title')}
/>
</a>
);
}
});
}
if (peakdBadges) {
peakdBadges.forEach(badge => {
const type = badge.get('type');
badgesTypes[type].push(
<a
className="BadgesAchievements__badge_image"
key={badge.get('id')}
href={`https://peakd.com/b/${badge.get('name')}`}
target="_blank"
rel="noopener noreferrer"
>
<img
src={badge.get('url')}
alt={badge.get('title')}
title={badge.get('title')}
className="UserProfile__badge_image"
/>
</a>
);
let valid = true;
if (
badgesTypes[type] === undefined ||
badgesTypes[type] === null
)
valid = false;
if (valid) {
badgesTypes[type].push(
<a
className="BadgesAchievements__badge_image"
key={badge.get('id')}
href={`https://peakd.com/b/${badge.get('name')}`}
target="_blank"
rel="noopener noreferrer"
>
<img
src={badge.get('url')}
alt={badge.get('title')}
title={badge.get('title')}
className="UserProfile__badge_image"
/>
</a>
);
}
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment