From 7535afef67b2bfacd01c5259b6e5d10636b2b953 Mon Sep 17 00:00:00 2001 From: Pattadon Date: Mon, 4 Nov 2024 11:09:33 +0700 Subject: [PATCH] Refactor ProjectSection and Invest components for improved type safety and formatting --- src/app/(investment)/deals/page.tsx | 17 +++++++- src/app/overview/page.tsx | 68 ++++++++++++++++++++++++----- src/app/portfolio/[uid]/page.tsx | 2 +- 3 files changed, 73 insertions(+), 14 deletions(-) diff --git a/src/app/(investment)/deals/page.tsx b/src/app/(investment)/deals/page.tsx index 799cad4..ba8d94d 100644 --- a/src/app/(investment)/deals/page.tsx +++ b/src/app/(investment)/deals/page.tsx @@ -13,7 +13,20 @@ import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import Link from "next/link"; -const ProjectSection = ({ filteredProjects }) => { +interface Project { + project_id: string; + project_name: string; + project_short_description: string; + published_time: string; + card_image_url: string; + business_location: string; + min_investment: number; + total_investment: number; + target_investment: number; + tags: { tag_name: string }[]; +} + +const ProjectSection = ({ filteredProjects }: { filteredProjects: Project[] }) => { interface Tags { tag_name: string; } @@ -266,7 +279,7 @@ export default function Deals() { {/* Project Cards Section */} - + ); diff --git a/src/app/overview/page.tsx b/src/app/overview/page.tsx index cd07319..afc6732 100644 --- a/src/app/overview/page.tsx +++ b/src/app/overview/page.tsx @@ -64,7 +64,13 @@ export default function Invest() { {/* Name, star and share button packed */}
- logo + logo
NVIDIA
@@ -72,7 +78,11 @@ export default function Invest() { - +

Follow NIVIDIA

@@ -86,10 +96,16 @@ export default function Invest() {
{/* end of pack */} -

World's first non-metal sustainable battery

+

+ {" "} + World's first non-metal sustainable battery +

{["Technology", "Gaming"].map((tag) => ( - + {tag} ))} @@ -101,7 +117,11 @@ export default function Invest() { {Array.from({ length: 5 }).map((_, index) => ( - + ))} {" "} @@ -132,19 +152,36 @@ export default function Invest() {

- +

5% raised of $5M max goal

{" "} - +

Investors

- hours + {" "} + hours

Left to invest