mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-22 15:34:05 +01:00
Refactor Invest page UI components, replace RecentSales with RecentFunds
This commit is contained in:
parent
c0d7a4b886
commit
8844efbeee
@ -9,7 +9,7 @@ import {
|
|||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import { Overview } from "@/components/ui/overview";
|
import { Overview } from "@/components/ui/overview";
|
||||||
import { RecentSales } from "@/components/recent-sales";
|
import { RecentFunds } from "@/components/recent-funds";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function Dashboard() {
|
export default function Dashboard() {
|
||||||
@ -40,22 +40,14 @@ export default function Dashboard() {
|
|||||||
<Tabs defaultValue="overview" className="space-y-4">
|
<Tabs defaultValue="overview" className="space-y-4">
|
||||||
<TabsList>
|
<TabsList>
|
||||||
<TabsTrigger value="overview">Overview</TabsTrigger>
|
<TabsTrigger value="overview">Overview</TabsTrigger>
|
||||||
<TabsTrigger value="analytics" disabled>
|
<TabsTrigger value="analytics">Analytics</TabsTrigger>
|
||||||
Analytics
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger value="reports" disabled>
|
|
||||||
Reports
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger value="notifications" disabled>
|
|
||||||
Notifications
|
|
||||||
</TabsTrigger>
|
|
||||||
</TabsList>
|
</TabsList>
|
||||||
<TabsContent value="overview" className="space-y-4">
|
<TabsContent value="overview" className="space-y-4">
|
||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||||
<Card>
|
<Card>
|
||||||
<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-sm font-medium">
|
<CardTitle className="text-sm font-medium">
|
||||||
Total Revenue
|
Total Funds Raised
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@ -80,7 +72,33 @@ export default function Dashboard() {
|
|||||||
<Card>
|
<Card>
|
||||||
<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-sm font-medium">
|
<CardTitle className="text-sm font-medium">
|
||||||
Subscriptions
|
Profile Views
|
||||||
|
</CardTitle>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
className="h-4 w-4 text-muted-foreground"
|
||||||
|
>
|
||||||
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
||||||
|
<circle cx="12" cy="12" r="3"></circle>
|
||||||
|
</svg>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<div className="text-2xl font-bold">+2350</div>
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
+180.1% from last month
|
||||||
|
</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
|
<CardTitle className="text-sm font-medium">
|
||||||
|
Total Followers
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@ -97,30 +115,6 @@ export default function Dashboard() {
|
|||||||
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
|
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
|
||||||
</svg>
|
</svg>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
|
||||||
<div className="text-2xl font-bold">+2350</div>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
+180.1% from last month
|
|
||||||
</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
<Card>
|
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
||||||
<CardTitle className="text-sm font-medium">Sales</CardTitle>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth="2"
|
|
||||||
className="h-4 w-4 text-muted-foreground"
|
|
||||||
>
|
|
||||||
<rect width="20" height="14" x="2" y="5" rx="2" />
|
|
||||||
<path d="M2 10h20" />
|
|
||||||
</svg>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="text-2xl font-bold">+12,234</div>
|
<div className="text-2xl font-bold">+12,234</div>
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
@ -128,7 +122,7 @@ export default function Dashboard() {
|
|||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
<Card>
|
{/* <Card>
|
||||||
<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-sm font-medium">
|
<CardTitle className="text-sm font-medium">
|
||||||
Active Now
|
Active Now
|
||||||
@ -152,7 +146,7 @@ export default function Dashboard() {
|
|||||||
+201 since last hour
|
+201 since last hour
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-7">
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-7">
|
||||||
<Card className="col-span-4">
|
<Card className="col-span-4">
|
||||||
@ -162,7 +156,10 @@ export default function Dashboard() {
|
|||||||
<CardContent className="pl-2">
|
<CardContent className="pl-2">
|
||||||
<Overview graphType={graphType} />
|
<Overview graphType={graphType} />
|
||||||
{/* tab to switch between line and bar graph */}
|
{/* tab to switch between line and bar graph */}
|
||||||
<Tabs defaultValue="line" className="space-y-4 ml-[50%]">
|
<Tabs
|
||||||
|
defaultValue="line"
|
||||||
|
className="space-y-4 ml-[50%] mt-2"
|
||||||
|
>
|
||||||
<TabsList>
|
<TabsList>
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value="line"
|
value="line"
|
||||||
@ -182,13 +179,13 @@ export default function Dashboard() {
|
|||||||
</Card>
|
</Card>
|
||||||
<Card className="col-span-3">
|
<Card className="col-span-3">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Recent Sales</CardTitle>
|
<CardTitle>Recent Funds</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
You made 265 sales this month.
|
You made 265 sales this month.
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<RecentSales />
|
<RecentFunds />
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
59
src/components/recent-funds.tsx
Normal file
59
src/components/recent-funds.tsx
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
|
||||||
|
const data = [
|
||||||
|
{
|
||||||
|
name: "Olivia Martin",
|
||||||
|
email: "olivia.martin@email.com",
|
||||||
|
amount: "1900.00",
|
||||||
|
avatar: "/avatars/01.png", // psuedo avatar image
|
||||||
|
initials: "OM",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Jackson Lee",
|
||||||
|
email: "jackson.lee@email.com",
|
||||||
|
amount: "39.00",
|
||||||
|
avatar: "/avatars/02.png",
|
||||||
|
initials: "JL",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Isabella Nguyen",
|
||||||
|
email: "isabella.nguyen@email.com",
|
||||||
|
amount: "299.00",
|
||||||
|
avatar: "/avatars/03.png",
|
||||||
|
initials: "IN",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "William Kim",
|
||||||
|
email: "will@email.com",
|
||||||
|
amount: "99.00",
|
||||||
|
avatar: "/avatars/04.png",
|
||||||
|
initials: "WK",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Sofia Davis",
|
||||||
|
email: "sofia.davis@email.com",
|
||||||
|
amount: "39.00",
|
||||||
|
avatar: "/avatars/05.png",
|
||||||
|
initials: "SD",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export function RecentFunds() {
|
||||||
|
return (
|
||||||
|
<div className="space-y-8">
|
||||||
|
{data.map((person, index) => (
|
||||||
|
<div className="flex items-center" key={index}>
|
||||||
|
<Avatar className="h-9 w-9">
|
||||||
|
<AvatarImage src={person.avatar} alt={person.name} />
|
||||||
|
<AvatarFallback>{person.initials}</AvatarFallback>
|
||||||
|
</Avatar>
|
||||||
|
<div className="ml-4 space-y-1">
|
||||||
|
<p className="text-sm font-medium leading-none">{person.name}</p>
|
||||||
|
<p className="text-sm text-muted-foreground">{person.email}</p>
|
||||||
|
</div>
|
||||||
|
<div className="ml-auto font-medium">+${person.amount}</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,67 +0,0 @@
|
|||||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
|
||||||
|
|
||||||
export function RecentSales() {
|
|
||||||
return (
|
|
||||||
<div className="space-y-8">
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Avatar className="h-9 w-9">
|
|
||||||
<AvatarImage src="/avatars/01.png" alt="Avatar" />
|
|
||||||
<AvatarFallback>OM</AvatarFallback>
|
|
||||||
</Avatar>
|
|
||||||
<div className="ml-4 space-y-1">
|
|
||||||
<p className="text-sm font-medium leading-none">Olivia Martin</p>
|
|
||||||
<p className="text-sm text-muted-foreground">
|
|
||||||
olivia.martin@email.com
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="ml-auto font-medium">+$1,999.00</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Avatar className="flex h-9 w-9 items-center justify-center space-y-0 border">
|
|
||||||
<AvatarImage src="/avatars/02.png" alt="Avatar" />
|
|
||||||
<AvatarFallback>JL</AvatarFallback>
|
|
||||||
</Avatar>
|
|
||||||
<div className="ml-4 space-y-1">
|
|
||||||
<p className="text-sm font-medium leading-none">Jackson Lee</p>
|
|
||||||
<p className="text-sm text-muted-foreground">jackson.lee@email.com</p>
|
|
||||||
</div>
|
|
||||||
<div className="ml-auto font-medium">+$39.00</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Avatar className="h-9 w-9">
|
|
||||||
<AvatarImage src="/avatars/03.png" alt="Avatar" />
|
|
||||||
<AvatarFallback>IN</AvatarFallback>
|
|
||||||
</Avatar>
|
|
||||||
<div className="ml-4 space-y-1">
|
|
||||||
<p className="text-sm font-medium leading-none">Isabella Nguyen</p>
|
|
||||||
<p className="text-sm text-muted-foreground">
|
|
||||||
isabella.nguyen@email.com
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="ml-auto font-medium">+$299.00</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Avatar className="h-9 w-9">
|
|
||||||
<AvatarImage src="/avatars/04.png" alt="Avatar" />
|
|
||||||
<AvatarFallback>WK</AvatarFallback>
|
|
||||||
</Avatar>
|
|
||||||
<div className="ml-4 space-y-1">
|
|
||||||
<p className="text-sm font-medium leading-none">William Kim</p>
|
|
||||||
<p className="text-sm text-muted-foreground">will@email.com</p>
|
|
||||||
</div>
|
|
||||||
<div className="ml-auto font-medium">+$99.00</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Avatar className="h-9 w-9">
|
|
||||||
<AvatarImage src="/avatars/05.png" alt="Avatar" />
|
|
||||||
<AvatarFallback>SD</AvatarFallback>
|
|
||||||
</Avatar>
|
|
||||||
<div className="ml-4 space-y-1">
|
|
||||||
<p className="text-sm font-medium leading-none">Sofia Davis</p>
|
|
||||||
<p className="text-sm text-muted-foreground">sofia.davis@email.com</p>
|
|
||||||
</div>
|
|
||||||
<div className="ml-auto font-medium">+$39.00</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user