refactor: link to real deals data

This commit is contained in:
sirin 2024-10-09 07:47:12 +07:00
parent e78e62dbe5
commit 5bdeef67e0
4 changed files with 18 additions and 15 deletions

View File

@ -102,7 +102,7 @@ export default async function ProjectDealPage({ params }: { params: { id: number
<p> Left to invest</p>
</span>
<Button className="mt-5 w-3/4 h-12">
<Link href="/invest">Invest in NVIDIA</Link>
<Link href={`/invest/${params.id}`}>Invest in {projectData?.project_name}</Link>
</Button>
</div>
</div>

View File

@ -11,6 +11,7 @@ import { useQuery } from "@supabase-cache-helpers/postgrest-react-query";
import { searchProjectsQuery, FilterParams, FilterProjectQueryParams } from "@/lib/data/projectQuery";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import Link from "next/link";
const ProjectSection = ({ filteredProjects }) => {
interface Tags {
@ -31,18 +32,20 @@ const ProjectSection = ({ filteredProjects }) => {
{/* Block for all the deals */}
<div className="mt-10 grid grid-cols-3 gap-4">
{filteredProjects.map((item, index) => (
<ProjectCard
key={index}
name={item.project_name}
description={item.project_short_description}
joinDate={item.published_time}
imageUri={item.card_image_url}
location={item.business_location}
minInvestment={item.min_investment}
totalInvestor={item.total_investment}
totalRaised={item.target_investment}
tags={item.tags.map((tag: Tags) => tag.tag_name)}
/>
<Link key={index} href={`/deals/${item.project_id}`}>
<ProjectCard
key={index}
name={item.project_name}
description={item.project_short_description}
joinDate={item.published_time}
imageUri={item.card_image_url}
location={item.business_location}
minInvestment={item.min_investment}
totalInvestor={item.total_investment}
totalRaised={item.target_investment}
tags={item.tags.map((tag: Tags) => tag.tag_name)}
/>
</Link>
))}
</div>
</div>

View File

@ -23,7 +23,7 @@ const TopProjects = async () => {
return (
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
{topProjectsData.map((project) => (
<Link href={`/overview/${project.id}`} key={project.id}>
<Link href={`/deals/${project.id}`} key={project.id}>
<ProjectCard
name={project.projectName}
description={project.projectShortDescription}

View File

@ -89,7 +89,7 @@ function searchProjectsQuery(client: SupabaseClient, {searchTerm, tagsFilter, pr
let query = client.from("Project").select(
`
id,
project_id:id,
project_name:projectName,
published_time:publishedTime,
project_short_description:projectShortDescription,