Skip to content

Commit

Permalink
Fix badges rendering in user profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
chimpdev committed May 26, 2024
1 parent 01a5aab commit 8401daa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/app/(profiles)/profile/u/[user_id]/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function Content({ user }) {

<div className='grid grid-cols-3 grid-rows-2 gap-y-2 gap-x-4'>
{(user.profile?.badges || []).map(badge => (
<Tooltip content={badge.tooltip} key={badge.name}>
<Tooltip content={badge.tooltip || badge.name} key={badge.name}>
<Image
src={`/profile-badges/${badge.name.toLowerCase()}.svg`}
alt={`${badge.name} Badge`}
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/users/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
const profile = await Profile.findOne({ 'user.id': id });
if (profile) {
const premium = await Premium.findOne({ 'user.id': id });
const profileBadges = profile ? getBadges(profile, premium ? premium.createdAt : null).map(badgeName => ({ name: badgeName, tooltip: badgeName })) : [];
const profileBadges = profile ? getBadges(profile, premium ? premium.createdAt : null) : [];

Object.assign(responseData, {
profile: {
Expand Down

0 comments on commit 8401daa

Please sign in to comment.