news table update, market movers added, colors changed, borders changed, navbar changed

This commit is contained in:
2024-03-02 01:05:46 -05:00
parent 813d5ee5c5
commit bfef1e177b
10 changed files with 158 additions and 101 deletions
+26
View File
@@ -859,3 +859,29 @@ export const newsData: newsDataType[] = [
"outletLogo": "https://logo.here/bloomberg", "outletLogo": "https://logo.here/bloomberg",
}, },
]; ];
export const winnerMovers = [
{ symbol: "AAPL", stockPrice: 150.25, percentChange: 8.3 },
{ symbol: "MSFT", stockPrice: 300.89, percentChange: 7.6 },
{ symbol: "GOOGL", stockPrice: 2700.45, percentChange: 9.2 },
{ symbol: "AMZN", stockPrice: 3300.75, percentChange: 6.8 },
{ symbol: "FB", stockPrice: 330.57, percentChange: 10.1 },
{ symbol: "TSLA", stockPrice: 900.67, percentChange: 12.5 },
{ symbol: "JPM", stockPrice: 150.75, percentChange: 6.9 },
{ symbol: "NVDA", stockPrice: 350.64, percentChange: 13.5 },
{ symbol: "DIS", stockPrice: 170.88, percentChange: 8.7 },
{ symbol: "BABA", stockPrice: 180.45, percentChange: 9.8 },
];
export const loserMovers = [
{ symbol: "GE", stockPrice: 10.25, percentChange: -7.8 },
{ symbol: "WFC", stockPrice: 25.63, percentChange: -6.3 },
{ symbol: "XOM", stockPrice: 50.45, percentChange: -8.5 },
{ symbol: "CCL", stockPrice: 15.75, percentChange: -9.1 },
{ symbol: "UAL", stockPrice: 35.85, percentChange: -7.2 },
{ symbol: "UAA", stockPrice: 18.54, percentChange: -6.9 },
{ symbol: "BA", stockPrice: 160.44, percentChange: -10.3 },
{ symbol: "MRO", stockPrice: 12.35, percentChange: -8.9 },
{ symbol: "OXY", stockPrice: 18.22, percentChange: -7.6 },
{ symbol: "WYNN", stockPrice: 80.75, percentChange: -11.2 },
];
+1 -1
View File
@@ -28,7 +28,7 @@
} }
.dark { .dark {
--background: 20 14.3% 4.1%; --background: 230 10.3% 11.4%;
--foreground: 60 9.1% 97.8%; --foreground: 60 9.1% 97.8%;
--card: 20 14.3% 4.1%; --card: 20 14.3% 4.1%;
--card-foreground: 60 9.1% 97.8%; --card-foreground: 60 9.1% 97.8%;
+4 -2
View File
@@ -19,10 +19,12 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang="en"> <html lang="en">
<body className={cn("min-h-screen antialiased", red_hat.className)}> <body
className={cn("h-[calc(100vh-64px)] antialiased", red_hat.className)}
>
<ThemeProvider <ThemeProvider
attribute="class" attribute="class"
defaultTheme="system" defaultTheme="dark"
enableSystem enableSystem
disableTransitionOnChange disableTransitionOnChange
> >
+41 -3
View File
@@ -1,9 +1,47 @@
import HomePageGrid from "@/components/grid/HomePageGrid"; import {
PortfolioModule,
NewsModule,
HeatmapModule,
MarketsModule,
MoversModule,
EarningsModule,
DocumentsModule,
IndicatorsModule,
ForexAndBondsModule,
} from "@/components/modules/HomepageModules";
export default function Home() { export default function Home() {
return ( return (
<main className="h-screen"> <main className="h-full flex bg-[rgb(26,27,32)]">
<HomePageGrid /> <div className="flex-1 px-6 pb-6 grid grid-rows-3 grid-cols-12 gap-6">
<div className="col-span-4 sm:col-span-4">
<PortfolioModule />
</div>
<div className="col-span-4 sm:col-span-4">
<NewsModule />
</div>
<div className="col-span-4 sm:col-span-4">
<HeatmapModule />
</div>
<div className="col-span-4 sm:col-span-6">
<MoversModule />
</div>
<div className="col-span-4 sm:col-span-6">
<MarketsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<EarningsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<DocumentsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<IndicatorsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<ForexAndBondsModule />
</div>
</div>
</main> </main>
); );
} }
-48
View File
@@ -1,48 +0,0 @@
import React from "react";
import {
PortfolioModule,
NewsModule,
HeatmapModule,
MarketsModule,
MoversModule,
EarningsModule,
DocumentsModule,
IndicatorsModule,
ForexAndBondsModule,
} from "../modules/HomepageModules";
function HomePageGrid() {
return (
<div className="h-screen px-4 grid grid-rows-3 grid-cols-12 gap-4">
<div className="col-span-4 sm:col-span-4">
<PortfolioModule />
</div>
<div className="col-span-4 sm:col-span-4">
<NewsModule />
</div>
<div className="col-span-4 sm:col-span-4">
<HeatmapModule />
</div>
<div className="col-span-4 sm:col-span-6">
<MoversModule />
</div>
<div className="col-span-4 sm:col-span-6">
<MarketsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<EarningsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<DocumentsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<IndicatorsModule />
</div>
<div className="col-span-4 sm:col-span-3">
<ForexAndBondsModule />
</div>
</div>
);
}
export default HomePageGrid;
@@ -9,11 +9,13 @@ interface HomepageModuleProps {
const HomepageModule = ({ title, children }: HomepageModuleProps) => { const HomepageModule = ({ title, children }: HomepageModuleProps) => {
return ( return (
<div className="flex flex-col h-full bg-neutral-800 rounded-lg"> <div className="flex flex-col h-full bg-[rgb(19,20,25)] 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 font-semibold">
{title}
</div> </div>
<div className="flex-grow w-full overflow-hidden mt-2 border-t-2 border-neutral-700"> </div>
<div className="flex-grow w-full overflow-hidden mt-2 border-t border-neutral-400">
{children} {children}
</div> </div>
</div> </div>
+55 -6
View File
@@ -1,9 +1,15 @@
import { heatmapData, newsData, portfolioData } from "@/app/MockData/MockData"; import {
heatmapData,
newsData,
portfolioData,
winnerMovers,
loserMovers,
} from "@/app/MockData/MockData";
import HomepageModule from "./HomepageModuleCard"; import HomepageModule from "./HomepageModuleCard";
import PortfolioChart from "../charts/PortfolioChart"; import PortfolioChart from "../charts/PortfolioChart";
import MarketHeatmap from "../charts/MarketHeatmap"; import MarketHeatmap from "../charts/MarketHeatmap";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { ArrowRight } from "lucide-react"; import { ArrowRight, Divide } from "lucide-react";
import { NewsTable } from "../charts/news/NewsTable"; import { NewsTable } from "../charts/news/NewsTable";
import { newsColumns } from "../charts/news/newsColumns"; import { newsColumns } from "../charts/news/newsColumns";
@@ -42,14 +48,57 @@ export const HeatmapModule = () => {
); );
}; };
export const MarketsModule = () => {
return <HomepageModule title="Markets"></HomepageModule>;
};
export const MoversModule = () => { export const MoversModule = () => {
return <HomepageModule title="Movers"></HomepageModule>; return <HomepageModule title="Movers"></HomepageModule>;
}; };
export const MarketsModule = () => {
return (
<HomepageModule title="Markets">
<div className="flex justify-between px-8">
<div className="mt-6">
<div className="text-lg">Gainers</div>
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-y-6 gap-x-10">
{winnerMovers.map((item) => (
<div
className="flex border-b border-neutral-400 pb-1"
key={item.symbol}
>
<div className="w-24 font-bold">{item.symbol}</div>
<div className="w-20 text-right text-neutral-400">
{item.stockPrice}
</div>
<div className="ml-4 rounded-lg bg-green-700 bg-opacity-90 w-16 text-center">
+{item.percentChange}%
</div>
</div>
))}
</div>
</div>
<div className="mt-6">
<div className="text-lg">Losers</div>
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-y-6 gap-x-10">
{loserMovers.map((item) => (
<div
className="flex border-b border-neutral-400 pb-1"
key={item.symbol}
>
<div className="w-24 font-bold">{item.symbol}</div>
<div className="w-20 text-right text-neutral-400">
{item.stockPrice}
</div>
<div className="ml-4 rounded-lg bg-red-700 bg-opacity-90 w-16 text-center">
{item.percentChange}%
</div>
</div>
))}
</div>
</div>
</div>
</HomepageModule>
);
};
export const EarningsModule = () => { export const EarningsModule = () => {
return <HomepageModule title="Earnings"></HomepageModule>; return <HomepageModule title="Earnings"></HomepageModule>;
}; };
-20
View File
@@ -1,20 +0,0 @@
import React from "react";
import { Button } from "../ui/button";
const NavPages = () => {
return (
<div className="flex justify-between gap-8 px-8">
<Button variant="link" className="text-white font-bold">
HOME
</Button>
<Button variant="link" className="text-white font-bold">
PORTFOLIO
</Button>
<Button variant="link" className="text-white font-bold">
RESEARCH
</Button>
</div>
);
};
export default NavPages;
+26 -18
View File
@@ -1,35 +1,43 @@
import React from "react"; import React from "react";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { Circle, Search, icons } from "lucide-react"; import { Search } from "lucide-react";
import NavPages from "./NavPages";
import { Input } from "../ui/input"; import { Input } from "../ui/input";
const Navbar = () => { const Navbar = () => {
return ( return (
<div className="h-16 p-4 w-screen flex flex-row justify-between items-center"> <div className="h-16 p-6 w-screen flex flex-row justify-between items-center bg-[rgb(26,27,32)]">
<div className="flex"> <div className="flex">
<Button variant="linkNoUnderline" className="text-3xl font-bold"> <Button variant="linkNoUnderline" className="text-3xl font-bold">
YellowBird YellowBird
</Button> </Button>
<NavPages /> <div className="flex justify-between gap-8 px-8">
</div> <Button variant="link" className="text-white font-bold">
<div className="flex"> HOME
<div className="flex items-center px-4"> </Button>
<div className=""> <Button variant="link" className="text-white font-bold">
<Input PORTFOLIO
className="rounded-full rounded-r-none min-w-80 bg-inherit border-primary p-4" </Button>
type="search" <Button variant="link" className="text-white font-bold">
placeholder="Search" RESEARCH
/>
</div>
<div className="">
<Button type="submit" className="w-14 rounded-full rounded-l-none">
<Search size={16} />
</Button> </Button>
</div> </div>
</div> </div>
<div className="flex">
<div className="flex items-center px-4">
<Input
className="rounded-lg rounded-r-none w-96 bg-inherit border-neutral-700 p-4"
type="search"
placeholder="Search"
/>
<Button
type="submit"
className="w-14 rounded-lg rounded-l-none bg-transparent border-neutral-700 border border-l-0 text-primary hover:text-neutral-700"
>
<Search size={16} />
</Button>
</div>
<Button className="rounded-full" size="icon"> <Button className="rounded-lg" size="icon">
ME ME
</Button> </Button>
</div> </div>
+1 -1
View File
@@ -58,7 +58,7 @@ const TableRow = React.forwardRef<
<tr <tr
ref={ref} ref={ref}
className={cn( className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", "border-b border-neutral-400 transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
className className
)} )}
{...props} {...props}