Skip to content

Commit 2659771

Browse files
authored
Merge pull request #84 from K1NGD4VID/creator-card-volume
feat: implement CreatorCard component and CourseService for key purch…
2 parents 618462d + 89185e8 commit 2659771

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/components/common/CreatorCard.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useAccount } from 'wagmi';
33
import { Button } from '@/components/ui/button';
44
import type { Course } from '@/services/course.service';
55
import { cn } from '@/lib/utils';
6-
import { ShoppingCart, Link as LinkIcon } from 'lucide-react';
6+
import { ShoppingCart, Link as LinkIcon, TrendingUp } from 'lucide-react';
77
import toast from 'react-hot-toast';
88
import showToast from '@/utils/toast.util';
99
import TransactionRetryNotice from '@/components/common/TransactionRetryNotice';
@@ -81,6 +81,14 @@ const CreatorCard: React.FC<CreatorCardProps> = ({ creator, className }) => {
8181
imageClassName="transition-transform duration-500 md:group-hover:scale-[1.03]"
8282
/>
8383
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/80 via-transparent to-transparent opacity-0 transition-opacity duration-300 md:group-hover:opacity-100" />
84+
{creator.volume24h !== undefined && (
85+
<div className="absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded-full bg-slate-950/75 border border-white/10 px-2.5 py-1 backdrop-blur-md">
86+
<TrendingUp className="size-3 text-emerald-400" />
87+
<span className="text-xs font-bold text-white/90">
88+
{creator.volume24h > 0 ? `${creator.volume24h} ETH` : 'New'}
89+
</span>
90+
</div>
91+
)}
8492
</div>
8593

8694
<div className="mb-4">

src/services/course.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface Course {
1313
level: 'BEGINNER' | 'INTERMEDIATE' | 'ADVANCED';
1414
socialHandle?: string;
1515
isVerified?: boolean;
16+
volume24h?: number;
1617
}
1718

1819
export interface GetCoursesParams {

0 commit comments

Comments
 (0)