Skip to content

Commit 606dfc8

Browse files
committed
feat: integrate BountyTags into CreatorBountyCard and ContributorProfile
Closes #487 Replaces inline tier/skill rendering with the reusable BountyTags component: - CreatorBountyCard: adds tier, skills, and category pills above the status/escrow/deadline line for visual consistency with BountyCard - ContributorProfile: replaces manual tierLabel() + TIER_COLORS inline spans with BountyTags tier pill in the recent bounties list Both components now use the same GitHub-label-colored pills as the bounty board, providing consistent visual language across the app. Wallet: HZV6YPdTeJPjPujWjzsFLLKja91K2Ze78XeY8MeFhfK8
1 parent d8998e7 commit 606dfc8

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

frontend/src/components/ContributorProfile.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import type { ContributorBadgeStats } from '../types/badges';
55
import { computeBadges } from '../types/badges';
66
import { BadgeGrid } from './badges';
77
import { TimeAgo } from './common/TimeAgo';
8+
import { BountyTags } from './bounties/BountyTags';
9+
import type { BountyTier } from '../types/bounty';
810

911
interface RecentBounty {
1012
title: string;
@@ -276,13 +278,18 @@ export const ContributorProfile: React.FC<ContributorProfileProps> = ({
276278
<div className="flex items-center justify-between gap-2">
277279
<div className="flex-1 min-w-0">
278280
<p className="text-sm text-white truncate">{bounty.title}</p>
279-
<p className="text-xs text-gray-500 mt-0.5">
280-
{tierLabel(bounty.tier)} · {bounty.earned.toLocaleString()} FNDRY · {new Date(bounty.completedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}
281-
</p>
281+
<div className="flex items-center gap-2 mt-1">
282+
<BountyTags
283+
tier={`T${bounty.tier}` as BountyTier}
284+
skills={[]}
285+
showTier
286+
className="inline-flex"
287+
/>
288+
<span className="text-xs text-gray-500">
289+
{bounty.earned.toLocaleString()} FNDRY · {new Date(bounty.completedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}
290+
</span>
291+
</div>
282292
</div>
283-
<span className={`text-xs font-medium ${TIER_COLORS[bounty.tier].text}`}>
284-
{tierLabel(bounty.tier)}
285-
</span>
286293
</div>
287294
</a>
288295
))}

frontend/src/components/bounties/CreatorBountyCard.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState } from 'react';
22
import { useToast } from '../../hooks/useToast';
3+
import { BountyTags } from './BountyTags';
34

45
interface Submission {
56
id: string;
@@ -139,6 +140,16 @@ export function CreatorBountyCard({ bounty, onUpdate }: CreatorBountyCardProps)
139140
)}
140141
</div>
141142

143+
<BountyTags
144+
tier={bounty.tier ?? 'T1'}
145+
skills={bounty.required_skills ?? bounty.skills ?? []}
146+
category={bounty.category}
147+
showTier
148+
maxSkills={4}
149+
className="mb-2"
150+
data-testid="creator-bounty"
151+
/>
152+
142153
<div className="flex flex-wrap items-center gap-x-6 gap-y-2 text-sm text-gray-400">
143154
<span className={`font-semibold ${getStatusColor(bounty.status)} uppercase tracking-wider text-xs`}>
144155
{bounty.status.replace(/_/g, ' ')}

0 commit comments

Comments
 (0)