Skip to content

Commit a816b37

Browse files
Merge pull request #69 from Toromo7/main
feat: implement smart contract activity timeline UI #46
2 parents dd4f376 + 7f592e0 commit a816b37

2 files changed

Lines changed: 63 additions & 1 deletion

File tree

app/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@ import { Testimonials } from '@/components/testimonials'
66
import { CTA } from '@/components/cta'
77
import { Footer } from '@/components/footer'
88
import { Navbar } from '@/components/navbar'
9+
import ActivityTimeline from '@/components/ActivityTimeline';
910

1011
export default function Home() {
1112
return (
1213
<main className="min-h-screen">
1314
<Navbar />
1415
<Hero />
1516

17+
{/* This is the timeline section we added */}
18+
<section className="py-12 bg-gray-50">
19+
<ActivityTimeline />
20+
</section>
21+
1622
<Features />
1723
<HowItWorks />
1824
<Benefits />
1925
<Testimonials />
2026
<CTA />
2127
<Footer />
2228
</main>
23-
)
29+
);
2430
}

components/ActivityTimeline.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import React from 'react';
2+
3+
// This data array makes the component "Reusable" as per requirements
4+
const timelineEvents = [
5+
{ id: 1, label: 'Escrow Created', status: 'completed', date: 'Oct 24, 2025' },
6+
{ id: 2, label: 'Milestone Funded', status: 'completed', date: 'Oct 25, 2025' },
7+
{ id: 3, label: 'Payment Released', status: 'current', date: 'In Progress' },
8+
{ id: 4, label: 'Dispute Raised', status: 'upcoming', date: 'Pending' },
9+
];
10+
11+
const ActivityTimeline = () => {
12+
return (
13+
<div className="p-6 bg-white rounded-lg shadow-md max-w-lg mx-auto">
14+
<h2 className="text-xl font-bold mb-6 text-gray-800">Contract Activity Timeline</h2>
15+
16+
<div className="relative">
17+
{/* The Vertical Line */}
18+
<div className="absolute left-4 top-0 h-full w-0.5 bg-gray-200"></div>
19+
20+
<div className="space-y-8">
21+
{timelineEvents.map((event) => (
22+
<div key={event.id} className="relative flex items-center ml-1">
23+
24+
{/* Step Indicator Dot */}
25+
<div className={`z-10 w-7 h-7 rounded-full flex items-center justify-center border-2
26+
${event.status === 'completed' ? 'bg-green-500 border-green-500' :
27+
event.status === 'current' ? 'bg-white border-blue-500 animate-pulse' :
28+
'bg-white border-gray-300'}`}>
29+
30+
{event.status === 'completed' && (
31+
<span className="text-white text-xs"></span>
32+
)}
33+
{event.status === 'current' && (
34+
<div className="w-2 h-2 bg-blue-500 rounded-full"></div>
35+
)}
36+
</div>
37+
38+
{/* Event Content */}
39+
<div className="ml-6">
40+
<p className={`font-semibold ${event.status === 'upcoming' ? 'text-gray-400' : 'text-gray-900'}`}>
41+
{event.label}
42+
</p>
43+
<p className="text-xs text-gray-500 uppercase tracking-wide">
44+
{event.date}
45+
</p>
46+
</div>
47+
48+
</div>
49+
))}
50+
</div>
51+
</div>
52+
</div>
53+
);
54+
};
55+
56+
export default ActivityTimeline;

0 commit comments

Comments
 (0)