mirror of
https://github.com/dylanbenzi/yellowbird.git
synced 2026-11-27 01:07:01 +00:00
updated home modules
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
"@nivo/line": "^0.84.0",
|
"@nivo/line": "^0.84.0",
|
||||||
"@nivo/treemap": "^0.84.0",
|
"@nivo/treemap": "^0.84.0",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-dialog": "^1.0.5",
|
||||||
|
"@radix-ui/react-scroll-area": "^1.0.5",
|
||||||
"@radix-ui/react-separator": "^1.0.3",
|
"@radix-ui/react-separator": "^1.0.3",
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
"@radix-ui/react-slot": "^1.0.2",
|
||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
|
|||||||
Generated
+38
@@ -35,6 +35,9 @@ dependencies:
|
|||||||
'@radix-ui/react-dialog':
|
'@radix-ui/react-dialog':
|
||||||
specifier: ^1.0.5
|
specifier: ^1.0.5
|
||||||
version: 1.0.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
version: 1.0.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
||||||
|
'@radix-ui/react-scroll-area':
|
||||||
|
specifier: ^1.0.5
|
||||||
|
version: 1.0.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
||||||
'@radix-ui/react-separator':
|
'@radix-ui/react-separator':
|
||||||
specifier: ^1.0.3
|
specifier: ^1.0.3
|
||||||
version: 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
version: 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
||||||
@@ -938,6 +941,12 @@ packages:
|
|||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
/@radix-ui/[email protected]:
|
||||||
|
resolution: {integrity: sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@radix-ui/[email protected]:
|
/@radix-ui/[email protected]:
|
||||||
resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}
|
resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -1265,6 +1274,35 @@ packages:
|
|||||||
react-dom: 18.2.0([email protected])
|
react-dom: 18.2.0([email protected])
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
|
||||||
|
resolution: {integrity: sha512-b6PAgH4GQf9QEn8zbT2XUHpW5z8BzqEc7Kl11TwDrvuTrxlkcjTD5qa/bxgKr+nmuXKu4L/W5UZ4mlP/VG/5Gw==}
|
||||||
|
peerDependencies:
|
||||||
|
'@types/react': '*'
|
||||||
|
'@types/react-dom': '*'
|
||||||
|
react: ^16.8 || ^17.0 || ^18.0
|
||||||
|
react-dom: ^16.8 || ^17.0 || ^18.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
'@types/react':
|
||||||
|
optional: true
|
||||||
|
'@types/react-dom':
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
'@radix-ui/number': 1.0.1
|
||||||
|
'@radix-ui/primitive': 1.0.1
|
||||||
|
'@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
|
||||||
|
'@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
|
||||||
|
'@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
|
||||||
|
'@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
||||||
|
'@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
|
||||||
|
'@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
|
||||||
|
'@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
|
||||||
|
'@types/react': 18.2.57
|
||||||
|
'@types/react-dom': 18.2.19
|
||||||
|
react: 18.2.0
|
||||||
|
react-dom: 18.2.0([email protected])
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
|
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
|
||||||
resolution: {integrity: sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==}
|
resolution: {integrity: sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<main className="flex h-full">
|
<main className="flex h-full">
|
||||||
<div className="grid grid-rows-3 grid-cols-12 gap-6 flex-1 ">
|
<div className="grid grid-rows-3 grid-cols-12 gap-4">
|
||||||
<div className="col-span-4 sm:col-span-4">
|
<div className="col-span-4 sm:col-span-4">
|
||||||
<PortfolioModule />
|
<PortfolioModule />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export function TableNoHeader<TData, TValue>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full">
|
<div>
|
||||||
<Table className="h-full no-scrollbar">
|
<Table className="h-full no-scrollbar">
|
||||||
{/* <TableHeader>
|
{/* <TableHeader>
|
||||||
{table.getHeaderGroups().map((headerGroup) => (
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
|||||||
@@ -45,6 +45,14 @@ import CalendarSquares from "../charts/CalendarSquares";
|
|||||||
import { DocumentsTable } from "../charts/documents/DocumentsTable";
|
import { DocumentsTable } from "../charts/documents/DocumentsTable";
|
||||||
import { documentsColumns } from "../charts/documents/documentsColumns";
|
import { documentsColumns } from "../charts/documents/documentsColumns";
|
||||||
import { TableNoHeader } from "../Table";
|
import { TableNoHeader } from "../Table";
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from "../ui/card";
|
||||||
|
import { ScrollArea } from "../ui/scroll-area";
|
||||||
|
|
||||||
export const PortfolioModule = () => {
|
export const PortfolioModule = () => {
|
||||||
const portfolioLine: LineSeriesPartialOptionsWithData = {
|
const portfolioLine: LineSeriesPartialOptionsWithData = {
|
||||||
@@ -62,91 +70,115 @@ export const PortfolioModule = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="Portfolio">
|
<Card className="flex flex-col">
|
||||||
<div className="flex justify-between px-4">
|
<CardHeader className="p-4">
|
||||||
<div>$34,120.87</div>
|
<CardTitle>Portfolio</CardTitle>
|
||||||
<div className="rounded-full bg-neutral-900 px-4">2W 1M YTD</div>
|
</CardHeader>
|
||||||
<div className="text-green-500">^10.0% $3,412.09</div>
|
<CardContent className="h-full p-4">
|
||||||
</div>
|
<div className="flex justify-between px-4">
|
||||||
<div className="h-3/4">
|
<div>$34,120.87</div>
|
||||||
<Chart
|
<div className="rounded-full bg-neutral-900 px-4">2W 1M YTD</div>
|
||||||
series={[portfolioLine, indexLine]}
|
<div className="text-green-500">^10.0% $3,412.09</div>
|
||||||
colors={{
|
</div>
|
||||||
backgroundColor: "transparent",
|
<div className="h-3/4">
|
||||||
textColor: "white",
|
<Chart
|
||||||
}}
|
series={[portfolioLine, indexLine]}
|
||||||
/>
|
colors={{
|
||||||
</div>
|
backgroundColor: "transparent",
|
||||||
<div className="flex justify-between">
|
textColor: "white",
|
||||||
<Button className="text-white" variant="link">
|
}}
|
||||||
Go to Portfolio
|
/>
|
||||||
<ArrowRight className="ml-1" size={16} />
|
</div>
|
||||||
</Button>
|
</CardContent>
|
||||||
</div>
|
<CardFooter className="p-4 pt-0">
|
||||||
</HomepageModule>
|
<div className="flex justify-between">
|
||||||
|
<Button className="text-white" variant="link">
|
||||||
|
Go to Portfolio
|
||||||
|
<ArrowRight className="ml-1" size={16} />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</CardFooter>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NewsModule = () => {
|
export const NewsModule = () => {
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="News">
|
<Card className="flex flex-col">
|
||||||
<NewsTable columns={newsColumns} data={newsData} />
|
<CardHeader className="border-b border-neutral-700 p-4">
|
||||||
</HomepageModule>
|
<CardTitle>News</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<ScrollArea>
|
||||||
|
<CardContent className="h-full p-0">
|
||||||
|
<DocumentsTable columns={documentsColumns} data={documentsList} />
|
||||||
|
</CardContent>
|
||||||
|
</ScrollArea>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const HeatmapModule = () => {
|
export const HeatmapModule = () => {
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="Heatmap">
|
<Card className="flex flex-col">
|
||||||
<MarketHeatmap data={heatmapData} />
|
<CardHeader className="p-4">
|
||||||
</HomepageModule>
|
<CardTitle>Market Heatmap</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className=" h-full p-0">
|
||||||
|
<MarketHeatmap data={heatmapData} />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MoversModule = () => {
|
export const MoversModule = () => {
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="Movers">
|
<Card>
|
||||||
<div className="flex justify-between 2xl:px-2">
|
<CardHeader className="p-4">
|
||||||
<div className="mt-4 px-4 2xl:mt-6">
|
<CardTitle>Movers</CardTitle>
|
||||||
<div className="text-lg">Gainers</div>
|
</CardHeader>
|
||||||
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-x-2 gap-y-4 2xl:gap-x-10 2xl:gap-y-6">
|
<CardContent className="h-full p-4">
|
||||||
{winnerMovers.map((item) => (
|
<div className="flex justify-between 2xl:px-2">
|
||||||
<div
|
<div className="mt-4 px-4 2xl:mt-6">
|
||||||
className="flex border-b border-neutral-400 pb-1 text-sm 2xl:text-base"
|
<div className="text-lg">Gainers</div>
|
||||||
key={item.symbol}
|
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-x-2 gap-y-4 2xl:gap-x-10 2xl:gap-y-6">
|
||||||
>
|
{winnerMovers.map((item) => (
|
||||||
<div className="w-32 font-bold 2xl:w-24">{item.symbol}</div>
|
<div
|
||||||
<div className="text-right text-xs text-neutral-400 2xl:w-20 2xl:text-base">
|
className="flex border-b border-neutral-400 pb-1 text-sm 2xl:text-base"
|
||||||
{item.stockPrice}
|
key={item.symbol}
|
||||||
|
>
|
||||||
|
<div className="w-32 font-bold 2xl:w-24">{item.symbol}</div>
|
||||||
|
<div className="text-right text-xs text-neutral-400 2xl:w-20 2xl:text-base">
|
||||||
|
{item.stockPrice}
|
||||||
|
</div>
|
||||||
|
<div className="ml-2 w-20 rounded-lg bg-green-500 bg-opacity-90 text-center text-xs 2xl:ml-4 2xl:text-base">
|
||||||
|
+{item.percentChange}%
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="ml-2 w-20 rounded-lg bg-green-500 bg-opacity-90 text-center text-xs 2xl:ml-4 2xl:text-base">
|
))}
|
||||||
+{item.percentChange}%
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="mt-4 h-full px-4 2xl:mt-6">
|
||||||
|
<div className="text-lg">Losers</div>
|
||||||
|
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-x-2 gap-y-4 2xl:gap-x-10 2xl:gap-y-6">
|
||||||
|
{loserMovers.map((item) => (
|
||||||
|
<div
|
||||||
|
className="flex border-b border-neutral-400 pb-1 text-sm 2xl:text-base"
|
||||||
|
key={item.symbol}
|
||||||
|
>
|
||||||
|
<div className="w-32 font-bold 2xl:w-24">{item.symbol}</div>
|
||||||
|
<div className="text-right text-xs text-neutral-400 2xl:w-20 2xl:text-base">
|
||||||
|
{item.stockPrice}
|
||||||
|
</div>
|
||||||
|
<div className="ml-2 w-20 rounded-lg bg-red-500 bg-opacity-90 text-center text-xs 2xl:ml-4 2xl:text-base">
|
||||||
|
{item.percentChange}%
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
))}
|
||||||
))}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 px-4 2xl:mt-6">
|
</CardContent>
|
||||||
<div className="text-lg">Losers</div>
|
</Card>
|
||||||
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-x-2 gap-y-4 2xl:gap-x-10 2xl:gap-y-6">
|
|
||||||
{loserMovers.map((item) => (
|
|
||||||
<div
|
|
||||||
className="flex border-b border-neutral-400 pb-1 text-sm 2xl:text-base"
|
|
||||||
key={item.symbol}
|
|
||||||
>
|
|
||||||
<div className="w-32 font-bold 2xl:w-24">{item.symbol}</div>
|
|
||||||
<div className="text-right text-xs text-neutral-400 2xl:w-20 2xl:text-base">
|
|
||||||
{item.stockPrice}
|
|
||||||
</div>
|
|
||||||
<div className="ml-2 w-20 rounded-lg bg-red-500 bg-opacity-90 text-center text-xs 2xl:ml-4 2xl:text-base">
|
|
||||||
{item.percentChange}%
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</HomepageModule>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -175,91 +207,119 @@ export const MarketsModule = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="Markets">
|
<Card className="flex flex-col">
|
||||||
<div className="flex h-full items-center py-2 2xl:py-4">
|
<CardHeader className="p-4">
|
||||||
<div className="flex h-full max-w-[40%] grow flex-col justify-between px-2">
|
<CardTitle>Markets</CardTitle>
|
||||||
{markets.map((marketItem) => (
|
</CardHeader>
|
||||||
<div
|
<CardContent className="p-4">
|
||||||
key={marketItem.symbol}
|
<div className="flex h-full items-center">
|
||||||
className="rounded-md hover:cursor-pointer hover:bg-neutral-700"
|
<div className="flex h-full grow flex-col justify-between px-2">
|
||||||
>
|
{markets.map((marketItem) => (
|
||||||
<div className="flex items-center justify-between border-b border-neutral-700 py-1 pl-2">
|
<div
|
||||||
<div className="text-sm font-semibold 2xl:text-base">
|
key={marketItem.symbol}
|
||||||
{marketItem.symbol}
|
className="rounded-md hover:cursor-pointer hover:bg-neutral-700"
|
||||||
</div>
|
>
|
||||||
<div className="flex justify-between space-x-4 pr-2 text-sm">
|
<div className="flex items-center justify-between border-b border-neutral-700 py-1 pl-2">
|
||||||
<div className="w-12 text-right text-sm">
|
<div className="text-sm font-semibold 2xl:text-base">
|
||||||
{getLastPrice(marketItem.chart)}
|
{marketItem.symbol}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className="flex justify-between space-x-4 pr-2 text-sm">
|
||||||
className={cn(
|
<div className="w-12 text-right text-sm">
|
||||||
getPriceDifference(marketItem.chart, 1) > 0
|
{getLastPrice(marketItem.chart)}
|
||||||
? "text-green-500"
|
</div>
|
||||||
: "text-red-500",
|
<div
|
||||||
"w-10 text-right text-sm 2xl:w-12",
|
className={cn(
|
||||||
)}
|
getPriceDifference(marketItem.chart, 1) > 0
|
||||||
>
|
? "text-green-500"
|
||||||
{getPriceDifference(marketItem.chart, 1)}
|
: "text-red-500",
|
||||||
|
"w-10 text-right text-sm 2xl:w-12",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{getPriceDifference(marketItem.chart, 1)}
|
||||||
|
</div>
|
||||||
|
<Badge
|
||||||
|
variant={
|
||||||
|
getPercentDifference(marketItem.chart, 1) > 0
|
||||||
|
? "positive"
|
||||||
|
: "negative"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
{getPercentDifference(marketItem.chart, 1) + "%"}
|
||||||
|
</div>
|
||||||
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
<Badge
|
|
||||||
variant={
|
|
||||||
getPercentDifference(marketItem.chart, 1) > 0
|
|
||||||
? "positive"
|
|
||||||
: "negative"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div>{getPercentDifference(marketItem.chart, 1) + "%"}</div>
|
|
||||||
</Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
))}
|
||||||
))}
|
</div>
|
||||||
</div>
|
<div className="relative h-full w-96 grow">
|
||||||
<div className="relative h-full max-w-[60%] grow">
|
<div className="absolute ml-4 mt-1">S&P 500</div>
|
||||||
<div className="absolute ml-4 mt-1">S&P 500</div>
|
<Chart
|
||||||
<Chart
|
series={[sp500IndexLine, sma5Line]}
|
||||||
series={[sp500IndexLine, sma5Line]}
|
colors={{
|
||||||
colors={{
|
backgroundColor: "transparent",
|
||||||
backgroundColor: "transparent",
|
textColor: "white",
|
||||||
textColor: "white",
|
}}
|
||||||
}}
|
options={{
|
||||||
options={{
|
grid: {
|
||||||
grid: {
|
horzLines: {
|
||||||
horzLines: {
|
visible: false,
|
||||||
visible: false,
|
},
|
||||||
|
vertLines: {
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
vertLines: {
|
}}
|
||||||
visible: false,
|
/>
|
||||||
},
|
</div>
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</CardContent>
|
||||||
</HomepageModule>
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EarningsModule = () => {
|
export const EarningsModule = () => {
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="Earnings">
|
<Card>
|
||||||
<CalendarSquares data={earningsCalendar} />
|
<CardHeader className="p-4">
|
||||||
</HomepageModule>
|
<CardTitle>Earnings</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DocumentsModule = () => {
|
export const DocumentsModule = () => {
|
||||||
return (
|
return (
|
||||||
<HomepageModule title="Documents">
|
<Card className="flex flex-col">
|
||||||
<TableNoHeader data={documentsList} columns={documentsColumns} />
|
<CardHeader className="border-b border-neutral-700 p-4">
|
||||||
</HomepageModule>
|
<CardTitle>Forex and Bonds</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<ScrollArea>
|
||||||
|
<CardContent className="h-full p-0">
|
||||||
|
<TableNoHeader data={documentsList} columns={documentsColumns} />
|
||||||
|
</CardContent>
|
||||||
|
</ScrollArea>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const IndicatorsModule = () => {
|
export const IndicatorsModule = () => {
|
||||||
return <HomepageModule title="Indicators"></HomepageModule>;
|
return (
|
||||||
|
<Card>
|
||||||
|
<CardHeader className="p-4">
|
||||||
|
<CardTitle>Indicators</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ForexAndBondsModule = () => {
|
export const ForexAndBondsModule = () => {
|
||||||
return <HomepageModule title="Forex and Bonds"></HomepageModule>;
|
return (
|
||||||
|
<Card>
|
||||||
|
<CardHeader className="p-4">
|
||||||
|
<CardTitle>Forex and Bonds</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import * as React from "react"
|
||||||
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const ScrollArea = React.forwardRef<
|
||||||
|
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
||||||
|
>(({ className, children, ...props }, ref) => (
|
||||||
|
<ScrollAreaPrimitive.Root
|
||||||
|
ref={ref}
|
||||||
|
className={cn("relative overflow-hidden", className)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
||||||
|
{children}
|
||||||
|
</ScrollAreaPrimitive.Viewport>
|
||||||
|
<ScrollBar />
|
||||||
|
<ScrollAreaPrimitive.Corner />
|
||||||
|
</ScrollAreaPrimitive.Root>
|
||||||
|
))
|
||||||
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
||||||
|
|
||||||
|
const ScrollBar = React.forwardRef<
|
||||||
|
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
||||||
|
>(({ className, orientation = "vertical", ...props }, ref) => (
|
||||||
|
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
||||||
|
ref={ref}
|
||||||
|
orientation={orientation}
|
||||||
|
className={cn(
|
||||||
|
"flex touch-none select-none transition-colors",
|
||||||
|
orientation === "vertical" &&
|
||||||
|
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
||||||
|
orientation === "horizontal" &&
|
||||||
|
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
||||||
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
||||||
|
))
|
||||||
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
||||||
|
|
||||||
|
export { ScrollArea, ScrollBar }
|
||||||
Reference in New Issue
Block a user