File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export default function ExplorePage() {
2626 yesPercent : Math . round ( ( m . yesPrice || 0.5 ) * 100 ) ,
2727 noPercent : Math . round ( ( m . noPrice || 0.5 ) * 100 ) ,
2828 isHot : m . volume > 100 ,
29+ href : `/markets/${ m . id } ` ,
2930 } ) ) ;
3031
3132 return (
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export default async function HomePage() {
6060 yesPercent : Math . round ( ( m . yesPrice || 0.5 ) * 100 ) ,
6161 noPercent : Math . round ( ( m . noPrice || 0.5 ) * 100 ) ,
6262 isHot : m . volume > 100 ,
63+ href : `/markets/${ m . id } ` ,
6364 } ) ) ;
6465 const quickPoll = markets [ 1 ] || markets [ 0 ] || null ;
6566 const resolvedCard = resolved [ 0 ] || null ;
@@ -87,6 +88,7 @@ export default async function HomePage() {
8788 noPercent = { Math . round ( ( hero . noPrice || 0.5 ) * 100 ) }
8889 volume = { hero . volume > 0 ? `$${ hero . volume } ` : '$0' }
8990 isLive = { hero . status === 'open' }
91+ href = { `/markets/${ hero . id } ` }
9092 />
9193 ) : (
9294 < div className = "rounded-xl border border-[var(--border)] p-6 text-center text-[var(--muted)] text-sm" >
Original file line number Diff line number Diff line change 11'use client' ;
22
3+ import Link from 'next/link' ;
4+
35interface HeroCardProps {
46 title : string ;
57 category : string ;
@@ -9,6 +11,7 @@ interface HeroCardProps {
911 isLive ?: boolean ;
1012 viewerCount ?: string ;
1113 imageUrl ?: string ;
14+ href ?: string ;
1215}
1316
1417export function HeroCard ( {
@@ -20,9 +23,12 @@ export function HeroCard({
2023 isLive,
2124 viewerCount,
2225 imageUrl,
26+ href,
2327} : HeroCardProps ) {
28+ const Wrapper = href ? Link : 'div' ;
29+ const wrapperProps = href ? { href } : { } ;
2430 return (
25- < div className = "rounded-2xl overflow-hidden bg-[var(--card)]" >
31+ < Wrapper { ... wrapperProps as any } className = "block rounded-2xl overflow-hidden bg-[var(--card)] hover:ring-1 hover:ring-[var(--accent)]/30 transition-all " >
2632 < div
2733 className = "relative h-40 flex items-end p-4"
2834 style = { {
@@ -60,6 +66,6 @@ export function HeroCard({
6066 < span > ${ volume } vol</ span >
6167 </ div >
6268 </ div >
63- </ div >
69+ </ Wrapper >
6470 ) ;
6571}
Original file line number Diff line number Diff line change 11'use client' ;
22
3+ import Link from 'next/link' ;
4+
35interface NewsPredictionCardProps {
46 title : string ;
57 category : string ;
68 yesPercent : number ;
79 noPercent : number ;
810 isHot ?: boolean ;
911 imageUrl ?: string ;
12+ href ?: string ;
1013}
1114
1215export function NewsPredictionCard ( {
@@ -16,9 +19,12 @@ export function NewsPredictionCard({
1619 noPercent,
1720 isHot,
1821 imageUrl,
22+ href,
1923} : NewsPredictionCardProps ) {
24+ const Wrapper = href ? Link : 'div' ;
25+ const wrapperProps = href ? { href } : { } ;
2026 return (
21- < div className = "flex gap-3 bg-[var(--card)] rounded-xl p-3" >
27+ < Wrapper { ... wrapperProps as any } className = "flex gap-3 bg-[var(--card)] rounded-xl p-3 hover:bg-[var(--card-hover)] transition-colors block " >
2228 < div
2329 className = "w-[72px] h-[72px] rounded-lg shrink-0"
2430 style = { {
@@ -39,6 +45,6 @@ export function NewsPredictionCard({
3945 { isHot && < span className = "text-xs ml-auto" > Hot</ span > }
4046 </ div >
4147 </ div >
42- </ div >
48+ </ Wrapper >
4349 ) ;
4450}
You can’t perform that action at this time.
0 commit comments