Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useShowcaseAchievements } from '../../hooks/profile/useShowcaseAchievem
import { useProfileAchievements } from '../../hooks/profile/useProfileAchievements';
import { useToastNotification } from '../../hooks/useToastNotification';

const MAX_SHOWCASE = 3;
const MAX_SHOWCASE = 5;

export interface AchievementShowcaseModalProps extends ModalProps {
user: PublicProfile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ReactElement } from 'react';
import React from 'react';
import classNames from 'classnames';
import type { PublicProfile } from '../../../../lib/user';
import { useShowcaseAchievements } from '../../../../hooks/profile/useShowcaseAchievements';
import { useProfilePreview } from '../../../../hooks/profile/useProfilePreview';
Expand All @@ -21,7 +22,9 @@ import { formatDate, TimeFormatType } from '../../../../lib/dateFormat';
import {
getAchievementRarityTier,
AchievementRarityTier,
rarityGlowClasses,
} from './achievementRarity';
import { RaritySparkles } from './RaritySparkles';
import { useLazyModal } from '../../../../hooks/useLazyModal';
import { LazyModal } from '../../../../components/modals/common/types';

Expand Down Expand Up @@ -97,12 +100,23 @@ export function ProfileAchievementShowcase({
trigger={
<button
type="button"
className="flex size-16 shrink-0 items-center justify-center rounded-14"
className={classNames(
'relative flex size-16 shrink-0 items-center justify-center rounded-14',
rarityTier
? [
'overflow-visible border',
rarityGlowClasses[rarityTier],
]
: 'overflow-hidden',
)}
>
{rarityTier && (
<RaritySparkles tier={rarityTier} size="compact" />
)}
<LazyImage
imgSrc={achievement.image}
imgAlt={achievement.name}
className="size-16 rounded-14 object-cover"
className="size-full rounded-14 object-cover"
fallbackSrc="https://daily.dev/default-achievement.png"
/>
</button>
Expand Down