Skip to content

Commit 448661c

Browse files
authored
Merge pull request #74 from Obiajulu-gif/codex/add-creator-share-supply-row
Add creator share supply stat row
2 parents 8d272f2 + 7e2318c commit 448661c

4 files changed

Lines changed: 76 additions & 1 deletion

File tree

src/components/common/CreatorCard.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import TransactionStatusIcon from '@/components/common/TransactionStatusIcon';
1616
import MiniStatChip from '@/components/common/MiniStatChip';
1717
import CreatorListRowDivider from '@/components/common/CreatorListRowDivider';
1818
import BuyActionHelperText from '@/components/common/BuyActionHelperText';
19+
import CreatorLabeledStatRow from '@/components/common/CreatorLabeledStatRow';
1920

2021
interface CreatorCardProps {
2122
creator: Course;
@@ -105,6 +106,17 @@ const CreatorCard: React.FC<CreatorCardProps> = ({ creator, className }) => {
105106
</div>
106107
<CreatorListRowDivider className="my-4" />
107108
<div className="mt-3 space-y-1.5">
109+
<CreatorLabeledStatRow
110+
label="Creator Share Supply"
111+
value={
112+
creator.creatorShareSupply
113+
? `${creator.creatorShareSupply} shares`
114+
: 'Supply pending'
115+
}
116+
className="px-3 py-3"
117+
labelClassName="text-[0.6rem]"
118+
valueClassName="text-sm md:text-sm"
119+
/>
108120
<CardMetaRow
109121
label={
110122
<span className="inline-flex items-center gap-1.5">
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import type { ReactNode } from 'react';
2+
import { cn } from '@/lib/utils';
3+
4+
interface CreatorLabeledStatRowProps {
5+
label: ReactNode;
6+
value: ReactNode;
7+
className?: string;
8+
labelClassName?: string;
9+
valueClassName?: string;
10+
}
11+
12+
const CreatorLabeledStatRow: React.FC<CreatorLabeledStatRowProps> = ({
13+
label,
14+
value,
15+
className,
16+
labelClassName,
17+
valueClassName,
18+
}) => {
19+
return (
20+
<div
21+
className={cn(
22+
'group relative overflow-hidden rounded-2xl border border-white/10 bg-white/[0.03] px-4 py-4 backdrop-blur-md transition-all duration-300 hover:border-amber-500/30 hover:bg-white/[0.06] hover:shadow-[0_8px_30px_rgb(0,0,0,0.12)]',
23+
className
24+
)}
25+
>
26+
<div className="absolute inset-0 bg-gradient-to-br from-white/[0.02] to-transparent opacity-0 transition-opacity duration-500 group-hover:opacity-100" />
27+
<div className="relative z-10 flex items-start justify-between gap-4">
28+
<div
29+
className={cn(
30+
'text-[0.65rem] font-bold uppercase tracking-[0.22em] text-white/40 transition-colors duration-300 group-hover:text-amber-200/50',
31+
labelClassName
32+
)}
33+
>
34+
{label}
35+
</div>
36+
<div
37+
className={cn(
38+
'text-right font-jakarta text-base font-bold text-white md:text-[1.05rem]',
39+
valueClassName
40+
)}
41+
>
42+
{value}
43+
</div>
44+
</div>
45+
</div>
46+
);
47+
};
48+
49+
export default CreatorLabeledStatRow;

src/pages/LandingPage.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { UnavailableAction } from '@/components/ui/unavailable-action';
1111
import SectionHeading from '@/components/common/SectionHeading';
1212
import CompactSectionSubtitle from '@/components/common/CompactSectionSubtitle';
1313
import CreatorProfileInfoGrid from '@/components/common/CreatorProfileInfoGrid';
14+
import CreatorLabeledStatRow from '@/components/common/CreatorLabeledStatRow';
1415
import MiniStatChip from '@/components/common/MiniStatChip';
1516
import MarketplaceSection from '@/components/common/MarketplaceSection';
1617

@@ -28,6 +29,7 @@ const DEMO_CREATORS: Course[] = [
2829
title: 'Alex Rivers',
2930
description: 'Digital Artist & Illustrator',
3031
price: 0.05,
32+
creatorShareSupply: 120,
3133
instructorId: 'arivers',
3234
category: 'Art',
3335
level: 'BEGINNER',
@@ -40,6 +42,7 @@ const DEMO_CREATORS: Course[] = [
4042
title: 'Sarah Chen',
4143
description: 'Solidity Developer',
4244
price: 0.12,
45+
creatorShareSupply: 64,
4346
instructorId: 'schen_dev',
4447
category: 'Tech',
4548
level: 'ADVANCED',
@@ -52,6 +55,7 @@ const DEMO_CREATORS: Course[] = [
5255
title: 'Marcus Thorne',
5356
description: 'Crypto Strategist',
5457
price: 0.08,
58+
creatorShareSupply: 88,
5559
instructorId: 'mthorne',
5660
category: 'Finance',
5761
level: 'INTERMEDIATE',
@@ -64,6 +68,7 @@ const DEMO_CREATORS: Course[] = [
6468
title: 'Elena Vance',
6569
description: 'UI/UX Designer',
6670
price: 0.04,
71+
creatorShareSupply: 150,
6772
instructorId: 'evance_design',
6873
category: 'Design',
6974
level: 'BEGINNER',
@@ -76,6 +81,7 @@ const DEMO_CREATORS: Course[] = [
7681
title: 'David Kojo',
7782
description: 'Music Producer',
7883
price: 0.15,
84+
creatorShareSupply: 42,
7985
instructorId: 'dkojo_beats',
8086
category: 'Music',
8187
level: 'ADVANCED',
@@ -88,6 +94,7 @@ const DEMO_CREATORS: Course[] = [
8894
title: 'Yuki Sato',
8995
description: 'Motion Designer',
9096
price: 0.07,
97+
creatorShareSupply: 96,
9198
instructorId: 'yuki_s',
9299
category: 'Design',
93100
level: 'INTERMEDIATE',
@@ -246,7 +253,13 @@ function LandingPage() {
246253
<MiniStatChip label="Access" value="Member-first drops" />
247254
</div>
248255
</div>
249-
<CreatorProfileInfoGrid items={FEATURED_CREATOR_FACTS} />
256+
<div className="space-y-3">
257+
<CreatorProfileInfoGrid items={FEATURED_CREATOR_FACTS} />
258+
<CreatorLabeledStatRow
259+
label="Creator Share Supply"
260+
value="250 shares available"
261+
/>
262+
</div>
250263
</MarketplaceSection>
251264
</div>
252265
</main>

src/services/course.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface Course {
66
title: string;
77
description: string;
88
price: number;
9+
creatorShareSupply?: number;
910
instructorId: string;
1011
thumbnail?: string;
1112
category: string;

0 commit comments

Comments
 (0)