mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-20 14:34:05 +01:00
refactor: link to real deals data
This commit is contained in:
parent
e78e62dbe5
commit
5bdeef67e0
@ -102,7 +102,7 @@ export default async function ProjectDealPage({ params }: { params: { id: number
|
|||||||
<p> Left to invest</p>
|
<p> Left to invest</p>
|
||||||
</span>
|
</span>
|
||||||
<Button className="mt-5 w-3/4 h-12">
|
<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>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { useQuery } from "@supabase-cache-helpers/postgrest-react-query";
|
|||||||
import { searchProjectsQuery, FilterParams, FilterProjectQueryParams } from "@/lib/data/projectQuery";
|
import { searchProjectsQuery, FilterParams, FilterProjectQueryParams } from "@/lib/data/projectQuery";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
const ProjectSection = ({ filteredProjects }) => {
|
const ProjectSection = ({ filteredProjects }) => {
|
||||||
interface Tags {
|
interface Tags {
|
||||||
@ -31,6 +32,7 @@ const ProjectSection = ({ filteredProjects }) => {
|
|||||||
{/* Block for all the deals */}
|
{/* Block for all the deals */}
|
||||||
<div className="mt-10 grid grid-cols-3 gap-4">
|
<div className="mt-10 grid grid-cols-3 gap-4">
|
||||||
{filteredProjects.map((item, index) => (
|
{filteredProjects.map((item, index) => (
|
||||||
|
<Link key={index} href={`/deals/${item.project_id}`}>
|
||||||
<ProjectCard
|
<ProjectCard
|
||||||
key={index}
|
key={index}
|
||||||
name={item.project_name}
|
name={item.project_name}
|
||||||
@ -43,6 +45,7 @@ const ProjectSection = ({ filteredProjects }) => {
|
|||||||
totalRaised={item.target_investment}
|
totalRaised={item.target_investment}
|
||||||
tags={item.tags.map((tag: Tags) => tag.tag_name)}
|
tags={item.tags.map((tag: Tags) => tag.tag_name)}
|
||||||
/>
|
/>
|
||||||
|
</Link>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -23,7 +23,7 @@ const TopProjects = async () => {
|
|||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
||||||
{topProjectsData.map((project) => (
|
{topProjectsData.map((project) => (
|
||||||
<Link href={`/overview/${project.id}`} key={project.id}>
|
<Link href={`/deals/${project.id}`} key={project.id}>
|
||||||
<ProjectCard
|
<ProjectCard
|
||||||
name={project.projectName}
|
name={project.projectName}
|
||||||
description={project.projectShortDescription}
|
description={project.projectShortDescription}
|
||||||
|
|||||||
@ -89,7 +89,7 @@ function searchProjectsQuery(client: SupabaseClient, {searchTerm, tagsFilter, pr
|
|||||||
|
|
||||||
let query = client.from("Project").select(
|
let query = client.from("Project").select(
|
||||||
`
|
`
|
||||||
id,
|
project_id:id,
|
||||||
project_name:projectName,
|
project_name:projectName,
|
||||||
published_time:publishedTime,
|
published_time:publishedTime,
|
||||||
project_short_description:projectShortDescription,
|
project_short_description:projectShortDescription,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user