mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-20 06:24:06 +01:00
connect image carousel to database
This commit is contained in:
parent
71d1d3c1fc
commit
b25895e5ad
@ -35,13 +35,13 @@ export default async function ProjectDealPage({ params }: { params: { id: number
|
|||||||
// timeDiff, if negative convert to zero
|
// timeDiff, if negative convert to zero
|
||||||
const timeDiff = Math.max((new Date(projectData.investment_deadline)).getTime() - new Date().getTime(), 0)
|
const timeDiff = Math.max((new Date(projectData.investment_deadline)).getTime() - new Date().getTime(), 0)
|
||||||
const hourLeft = Math.floor(timeDiff / (1000 * 60 * 60));
|
const hourLeft = Math.floor(timeDiff / (1000 * 60 * 60));
|
||||||
console.log(hourLeft)
|
|
||||||
const carouselData = [
|
const carouselData = [
|
||||||
{ src: "/boiler1.jpg", alt: "Boiler 1" },
|
{ src: projectData.card_image_url, alt: `${projectData.project_name} Image` },
|
||||||
{ src: "/boiler1.jpg", alt: "Boiler 1" },
|
{ src: projectData.card_image_url, alt: `${projectData.project_name} Image` },
|
||||||
{ src: "/boiler1.jpg", alt: "Boiler 1" },
|
{ src: projectData.card_image_url, alt: `${projectData.project_name} Image` },
|
||||||
{ src: "/boiler1.jpg", alt: "Boiler 1" },
|
{ src: projectData.card_image_url, alt: `${projectData.project_name} Image` },
|
||||||
{ src: "/boiler1.jpg", alt: "Boiler 1" },
|
{ src: projectData.card_image_url, alt: `${projectData.project_name} Image` },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -95,7 +95,6 @@ export default async function ProjectDealPage({ params }: { params: { id: number
|
|||||||
<div id="stats" className="flex flex-col w-full mt-4 pl-12">
|
<div id="stats" className="flex flex-col w-full mt-4 pl-12">
|
||||||
<div className="pl-5">
|
<div className="pl-5">
|
||||||
<span>
|
<span>
|
||||||
{/* #TODO use sum() instead of storing total in database */}
|
|
||||||
<h1 className="font-semibold text-xl md:text-4xl mt-8">${totalDealAmount}</h1>
|
<h1 className="font-semibold text-xl md:text-4xl mt-8">${totalDealAmount}</h1>
|
||||||
<p className="text-sm md:text-lg">
|
<p className="text-sm md:text-lg">
|
||||||
{toPercentage(totalDealAmount, projectData?.target_investment)}%
|
{toPercentage(totalDealAmount, projectData?.target_investment)}%
|
||||||
|
|||||||
@ -79,6 +79,7 @@ async function getProjectData(client: SupabaseClient, projectId: number) {
|
|||||||
project_short_description,
|
project_short_description,
|
||||||
project_description,
|
project_description,
|
||||||
published_time,
|
published_time,
|
||||||
|
card_image_url,
|
||||||
...project_investment_detail!inner (
|
...project_investment_detail!inner (
|
||||||
min_investment,
|
min_investment,
|
||||||
total_investment,
|
total_investment,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user