chart update 2, pre SSR changes

This commit is contained in:
2024-02-29 13:21:09 -05:00
parent 6a396953bf
commit e8a8c64e39
6 changed files with 184 additions and 8 deletions
+51
View File
@@ -680,3 +680,54 @@ export const heatmapData = {
}, },
], ],
}; };
export type newsDataType = {
headline: string;
subtitle: string;
dateTime: string;
outlet: string;
outletLogo: string;
};
export const newsData = [
{
"headline": "Tesla reports 0-60 under 1s available in latest Roadster",
"subtitle":
"Tesla CEO Elon Musk announced his latest engineering goals for the long awaited Roadster refresh. The new Roadster will be a collaboration between Musk's Tesla and SpaceX.",
"dateTime": "2024-02-27T11:30:59.123Z",
"outlet": "Bloomberg",
"outletLogo": "https://logo.here/bloomberg",
},
{
"headline": "Tesla reports 0-60 under 1s available in latest Roadster",
"subtitle":
"Tesla CEO Elon Musk announced his latest engineering goals for the long awaited Roadster refresh. The new Roadster will be a collaboration between Musk's Tesla and SpaceX.",
"dateTime": "2024-02-27T11:30:59.123Z",
"outlet": "Bloomberg",
"outletLogo": "https://logo.here/bloomberg",
},
{
"headline": "Tesla reports 0-60 under 1s available in latest Roadster",
"subtitle":
"Tesla CEO Elon Musk announced his latest engineering goals for the long awaited Roadster refresh. The new Roadster will be a collaboration between Musk's Tesla and SpaceX.",
"dateTime": "2024-02-27T11:30:59.123Z",
"outlet": "Bloomberg",
"outletLogo": "https://logo.here/bloomberg",
},
{
"headline": "Tesla reports 0-60 under 1s available in latest Roadster",
"subtitle":
"Tesla CEO Elon Musk announced his latest engineering goals for the long awaited Roadster refresh. The new Roadster will be a collaboration between Musk's Tesla and SpaceX.",
"dateTime": "2024-02-27T11:30:59.123Z",
"outlet": "Bloomberg",
"outletLogo": "https://logo.here/bloomberg",
},
{
"headline": "Tesla reports 0-60 under 1s available in latest Roadster",
"subtitle":
"Tesla CEO Elon Musk announced his latest engineering goals for the long awaited Roadster refresh. The new Roadster will be a collaboration between Musk's Tesla and SpaceX.",
"dateTime": "2024-02-27T11:30:59.123Z",
"outlet": "Bloomberg",
"outletLogo": "https://logo.here/bloomberg",
},
];
+7
View File
@@ -0,0 +1,7 @@
import React from "react";
const NewsTable = () => {
return <div>NewsTable</div>;
};
export default NewsTable;
+6 -2
View File
@@ -30,7 +30,7 @@ const PortfolioChart = (props: any) => {
textColor, textColor,
}, },
width: chartContainerRef.current.clientWidth * 0.95, width: chartContainerRef.current.clientWidth * 0.95,
height: 300, height: chartContainerRef.current.clientHeight * 0.95,
grid: { grid: {
vertLines: { vertLines: {
visible: false, visible: false,
@@ -59,7 +59,11 @@ const PortfolioChart = (props: any) => {
}, [data, backgroundColor, portfolioLineColor, indexLineColor, textColor]); }, [data, backgroundColor, portfolioLineColor, indexLineColor, textColor]);
return ( return (
<div className="flex justify-center" ref={chartContainerRef} id="chart" /> <div
className="flex justify-center h-3/4"
ref={chartContainerRef}
id="chart"
/>
); );
}; };
+2 -2
View File
@@ -24,10 +24,10 @@ function HomePageGrid() {
<HeatmapModule /> <HeatmapModule />
</div> </div>
<div className="col-span-4 sm:col-span-6"> <div className="col-span-4 sm:col-span-6">
<MarketsModule /> <MoversModule />
</div> </div>
<div className="col-span-4 sm:col-span-6"> <div className="col-span-4 sm:col-span-6">
<MoversModule /> <MarketsModule />
</div> </div>
<div className="col-span-4 sm:col-span-3"> <div className="col-span-4 sm:col-span-3">
<EarningsModule /> <EarningsModule />
@@ -12,11 +12,8 @@ const HomepageModule = ({ title, children }: HomepageModuleProps) => {
<div className="h-full bg-neutral-800 rounded-lg"> <div className="h-full bg-neutral-800 rounded-lg">
<div className="flex justify-between px-2 py-2 pb-0"> <div className="flex justify-between px-2 py-2 pb-0">
<div className="flex items-center text-lg px-2">{title}</div> <div className="flex items-center text-lg px-2">{title}</div>
<Button variant="linkNoUnderline" size="sm" className="text-white">
<Settings2Icon size={20} />
</Button>
</div> </div>
<div className="w-full">{children}</div> <div className="h-3/4 w-full">{children}</div>
</div> </div>
); );
}; };
+117
View File
@@ -0,0 +1,117 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Table = React.forwardRef<
HTMLTableElement,
React.HTMLAttributes<HTMLTableElement>
>(({ className, ...props }, ref) => (
<div className="relative w-full overflow-auto">
<table
ref={ref}
className={cn("w-full caption-bottom text-sm", className)}
{...props}
/>
</div>
))
Table.displayName = "Table"
const TableHeader = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
))
TableHeader.displayName = "TableHeader"
const TableBody = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<tbody
ref={ref}
className={cn("[&_tr:last-child]:border-0", className)}
{...props}
/>
))
TableBody.displayName = "TableBody"
const TableFooter = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<tfoot
ref={ref}
className={cn(
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
className
)}
{...props}
/>
))
TableFooter.displayName = "TableFooter"
const TableRow = React.forwardRef<
HTMLTableRowElement,
React.HTMLAttributes<HTMLTableRowElement>
>(({ className, ...props }, ref) => (
<tr
ref={ref}
className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
className
)}
{...props}
/>
))
TableRow.displayName = "TableRow"
const TableHead = React.forwardRef<
HTMLTableCellElement,
React.ThHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, ref) => (
<th
ref={ref}
className={cn(
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
className
)}
{...props}
/>
))
TableHead.displayName = "TableHead"
const TableCell = React.forwardRef<
HTMLTableCellElement,
React.TdHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, ref) => (
<td
ref={ref}
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
{...props}
/>
))
TableCell.displayName = "TableCell"
const TableCaption = React.forwardRef<
HTMLTableCaptionElement,
React.HTMLAttributes<HTMLTableCaptionElement>
>(({ className, ...props }, ref) => (
<caption
ref={ref}
className={cn("mt-4 text-sm text-muted-foreground", className)}
{...props}
/>
))
TableCaption.displayName = "TableCaption"
export {
Table,
TableHeader,
TableBody,
TableFooter,
TableHead,
TableRow,
TableCell,
TableCaption,
}