mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-18 21:44:06 +01:00
feat: integrate Modal component for project details in Dashboard and Portfolio, enhance RecentFunds data mapping
This commit is contained in:
parent
8a95cf50db
commit
4f36f3f7fb
@ -17,6 +17,7 @@ import CountUp from "react-countup";
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { Modal } from "@/components/modal";
|
||||||
|
|
||||||
export default function Dashboard() {
|
export default function Dashboard() {
|
||||||
const supabase = createSupabaseClient();
|
const supabase = createSupabaseClient();
|
||||||
@ -296,11 +297,20 @@ export default function Dashboard() {
|
|||||||
};
|
};
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center mt-5">
|
||||||
{filteredProject && filteredProject.length > 6 ? (
|
{filteredProject && filteredProject.length > 1 ? (
|
||||||
<Button asChild>
|
<Modal
|
||||||
<Link href="/dashboard/deals/">View More</Link>
|
data={filteredProject.map((item) => {
|
||||||
</Button>
|
return {
|
||||||
|
date: item.created_time,
|
||||||
|
name: item.username,
|
||||||
|
amount: item.deal_amount,
|
||||||
|
status: item.deal_status,
|
||||||
|
logoURL: Array.isArray(item.avatar_url) ? item.avatar_url[0] : item.avatar_url,
|
||||||
|
profileURL: `/profile/${item.investor_id}`,
|
||||||
|
};
|
||||||
|
})}
|
||||||
|
/>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@ -189,8 +189,8 @@ export default async function Portfolio({ params }: { params: { uid: string } })
|
|||||||
</TabsContent>
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-cols-3 w-full gap-5 mt-5">
|
<div className="flex flex-cols-3 w-full gap-5 mt-5">
|
||||||
<Card className="w-1/3">
|
<Card className="w-1/3 h-fit">
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
<CardTitle className="text-md font-bold">Categories of Invested Projects</CardTitle>
|
<CardTitle className="text-md font-bold">Categories of Invested Projects</CardTitle>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
@ -215,7 +215,7 @@ export default async function Portfolio({ params }: { params: { uid: string } })
|
|||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
<Card className="w-1/3">
|
<Card className="w-1/3 h-fit">
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
<CardTitle className="text-md font-bold">Types of Businesses Invested In</CardTitle>
|
<CardTitle className="text-md font-bold">Types of Businesses Invested In</CardTitle>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
@ -245,7 +245,18 @@ export default async function Portfolio({ params }: { params: { uid: string } })
|
|||||||
<CardTitle className="text-md font-bold">Recent investment</CardTitle>
|
<CardTitle className="text-md font-bold">Recent investment</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="mt-5 grid grid-flow-row-dense">
|
<CardContent className="mt-5 grid grid-flow-row-dense">
|
||||||
<RecentFunds data={latestDeals} />
|
<RecentFunds
|
||||||
|
data={latestDeals.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
amount: item.amount,
|
||||||
|
avatar: item.logo_url,
|
||||||
|
date: new Date(item.date),
|
||||||
|
status: item.status,
|
||||||
|
profile_url: `/deals/${item.projectId}`,
|
||||||
|
};
|
||||||
|
})}
|
||||||
|
/>
|
||||||
<div className="mt-5 flex justify-center">
|
<div className="mt-5 flex justify-center">
|
||||||
{deals && deals.length > 5 ? (
|
{deals && deals.length > 5 ? (
|
||||||
<Modal
|
<Modal
|
||||||
@ -256,7 +267,7 @@ export default async function Portfolio({ params }: { params: { uid: string } })
|
|||||||
amount: item.deal_amount,
|
amount: item.deal_amount,
|
||||||
status: item.deal_status,
|
status: item.deal_status,
|
||||||
logoURL: Array.isArray(item.avatar_url) ? item.avatar_url[0] : item.avatar_url,
|
logoURL: Array.isArray(item.avatar_url) ? item.avatar_url[0] : item.avatar_url,
|
||||||
profileURL: `deals/${item.project_id}` as string,
|
profileURL: `/deals/${item.project_id}`,
|
||||||
};
|
};
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -70,13 +70,18 @@ export const columns: ColumnDef<ModalProps>[] = [
|
|||||||
},
|
},
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Link href={`/deals/${(row.getValue("profileURL") as string).split("/").pop()}`} className="flex items-center">
|
<Button
|
||||||
|
className="bg-transparent hover:bg-transparent text-current"
|
||||||
|
onClick={() => {
|
||||||
|
window.location.href = row.getValue("profileURL");
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Avatar className="h-9 w-9">
|
<Avatar className="h-9 w-9">
|
||||||
<AvatarImage src={row.getValue("logoURL")} />
|
<AvatarImage src={row.getValue("logoURL")} />
|
||||||
<AvatarFallback>{(row.getValue("name") as string).slice(0, 2)}</AvatarFallback>
|
<AvatarFallback>{(row.getValue("name") as string).slice(0, 2)}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<span className="ml-2">{row.getValue("name")}</span>
|
<span className="ml-2">{row.getValue("name")}</span>
|
||||||
</Link>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,6 +20,9 @@ export const getInvestmentByProjectsIds = (client: SupabaseClient, projectIds: s
|
|||||||
deal_status:value
|
deal_status:value
|
||||||
),
|
),
|
||||||
project_id,
|
project_id,
|
||||||
|
...project_id (
|
||||||
|
project_name
|
||||||
|
),
|
||||||
deal_amount,
|
deal_amount,
|
||||||
created_time,
|
created_time,
|
||||||
...profiles (
|
...profiles (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user