@@ -2,7 +2,16 @@ import { useRef, useState } from 'react';
22import { useAccount } from 'wagmi' ;
33import type { Course } from '@/services/course.service' ;
44import { cn } from '@/lib/utils' ;
5- import { ShoppingCart , Link as LinkIcon , TrendingUp } from 'lucide-react' ;
5+ import { ShoppingCart , Link as LinkIcon , TrendingUp , MoreVertical , Copy , Share2 , ExternalLink } from 'lucide-react' ;
6+ import {
7+ DropdownMenu ,
8+ DropdownMenuContent ,
9+ DropdownMenuItem ,
10+ DropdownMenuLabel ,
11+ DropdownMenuSeparator ,
12+ DropdownMenuTrigger ,
13+ } from '@/components/ui/dropdown-menu' ;
14+ import RecentActivityBadge from '@/components/common/RecentActivityBadge' ;
615import toast from 'react-hot-toast' ;
716import showToast from '@/utils/toast.util' ;
817import { formatCompactNumber , formatNumber } from '@/utils/numberFormat.utils' ;
@@ -27,6 +36,7 @@ import CreatorListRowDivider from '@/components/common/CreatorListRowDivider';
2736import BuyActionHelperText from '@/components/common/BuyActionHelperText' ;
2837import NetworkFeeHint from '@/components/common/NetworkFeeHint' ;
2938import CreatorBio from '@/components/common/CreatorBio' ;
39+ import { CREATOR_CARD_MEDIA_RADIUS_CLASS } from '@/utils/creatorCardTokens' ;
3040
3141interface CreatorCardProps {
3242 creator : Course ;
@@ -105,6 +115,28 @@ const CreatorCard: React.FC<CreatorCardProps> = ({
105115 } , 1500 ) ;
106116 } ;
107117
118+ const isRecentlyActive = ( creator . volume24h ?? 0 ) > 0 ;
119+
120+ const handleCopyLink = ( ) => {
121+ const url = `${ window . location . origin } /creator/${ creator . id } ` ;
122+ navigator . clipboard
123+ . writeText ( url )
124+ . then ( ( ) => toast . success ( 'Profile link copied' ) )
125+ . catch ( ( ) => toast . error ( 'Could not copy link' ) ) ;
126+ } ;
127+
128+ const handleShare = ( ) => {
129+ const url = `${ window . location . origin } /creator/${ creator . id } ` ;
130+ if ( navigator . share ) {
131+ navigator . share ( { title : creator . title , url } ) . catch ( ( ) => { } ) ;
132+ } else {
133+ navigator . clipboard
134+ . writeText ( url )
135+ . then ( ( ) => toast . success ( 'Link copied to clipboard' ) )
136+ . catch ( ( ) => toast . error ( 'Could not share' ) ) ;
137+ }
138+ } ;
139+
108140 const handleBuy = ( ) => {
109141 if ( ! isConnected ) {
110142 toast . error ( 'Please connect your wallet to purchase keys' , {
@@ -134,8 +166,51 @@ const CreatorCard: React.FC<CreatorCardProps> = ({
134166 className
135167 ) }
136168 >
169+ < div className = "absolute right-3 top-3 z-20" >
170+ < DropdownMenu >
171+ < DropdownMenuTrigger
172+ aria-label = { `More actions for ${ creator . title } ` }
173+ className = "flex size-8 items-center justify-center rounded-full text-white/40 transition-colors hover:bg-white/10 hover:text-white/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60"
174+ >
175+ < MoreVertical className = "size-4" aria-hidden = "true" />
176+ </ DropdownMenuTrigger >
177+ < DropdownMenuContent
178+ align = "end"
179+ className = "w-48 border-white/10 bg-slate-900/95 backdrop-blur-xl"
180+ >
181+ < DropdownMenuLabel className = "text-xs text-white/50" >
182+ { creator . title }
183+ </ DropdownMenuLabel >
184+ < DropdownMenuSeparator className = "bg-white/10" />
185+ < DropdownMenuItem
186+ onSelect = { handleCopyLink }
187+ className = "cursor-pointer gap-2 text-white/70 focus:bg-white/10 focus:text-white"
188+ >
189+ < Copy className = "size-3.5" aria-hidden = "true" />
190+ Copy profile link
191+ </ DropdownMenuItem >
192+ < DropdownMenuItem
193+ onSelect = { handleShare }
194+ className = "cursor-pointer gap-2 text-white/70 focus:bg-white/10 focus:text-white"
195+ >
196+ < Share2 className = "size-3.5" aria-hidden = "true" />
197+ Share creator
198+ </ DropdownMenuItem >
199+ < DropdownMenuItem
200+ onSelect = { ( ) => { } }
201+ className = "cursor-pointer gap-2 text-white/70 focus:bg-white/10 focus:text-white"
202+ >
203+ < ExternalLink className = "size-3.5" aria-hidden = "true" />
204+ View profile
205+ </ DropdownMenuItem >
206+ </ DropdownMenuContent >
207+ </ DropdownMenu >
208+ </ div >
137209 < div
138- className = "relative mb-4 aspect-square overflow-hidden rounded-xl"
210+ className = { cn (
211+ 'relative mb-4 aspect-square overflow-hidden' ,
212+ CREATOR_CARD_MEDIA_RADIUS_CLASS
213+ ) }
139214 role = "img"
140215 aria-labelledby = { `creator-name-${ creator . id } ` }
141216 >
@@ -176,6 +251,7 @@ const CreatorCard: React.FC<CreatorCardProps> = ({
176251 />
177252 < Change24hBadge change = { creator . change24h } />
178253 < KeySupplyBadge supply = { creator . creatorShareSupply } />
254+ { isRecentlyActive && < RecentActivityBadge /> }
179255 </ div >
180256 < p className = "marketplace-label-muted font-jakarta text-sm" >
181257 { displayInstructorHandle }
0 commit comments