rafce rewrite

This commit is contained in:
2024-02-25 19:37:30 -05:00
parent 8960e3a247
commit 650f84be2a
18 changed files with 257 additions and 160 deletions
+110
View File
@@ -0,0 +1,110 @@
export const PortfolioData = [
{
"id": "japan",
"color": "hsl(173, 70%, 50%)",
"data": [
{
"x": "plane",
"y": 274,
},
{
"x": "helicopter",
"y": 197,
},
{
"x": "boat",
"y": 175,
},
{
"x": "train",
"y": 181,
},
{
"x": "subway",
"y": 54,
},
{
"x": "bus",
"y": 91,
},
{
"x": "car",
"y": 68,
},
{
"x": "moto",
"y": 244,
},
{
"x": "bicycle",
"y": 298,
},
{
"x": "horse",
"y": 286,
},
{
"x": "skateboard",
"y": 0,
},
{
"x": "others",
"y": 214,
},
],
},
{
"id": "france",
"color": "hsl(346, 70%, 50%)",
"data": [
{
"x": "plane",
"y": 166,
},
{
"x": "helicopter",
"y": 147,
},
{
"x": "boat",
"y": 276,
},
{
"x": "train",
"y": 132,
},
{
"x": "subway",
"y": 165,
},
{
"x": "bus",
"y": 47,
},
{
"x": "car",
"y": 27,
},
{
"x": "moto",
"y": 40,
},
{
"x": "bicycle",
"y": 80,
},
{
"x": "horse",
"y": 274,
},
{
"x": "skateboard",
"y": 109,
},
{
"x": "others",
"y": 211,
},
],
},
];
+35 -12
View File
@@ -1,21 +1,44 @@
import React from "react"; import React from "react";
import PortfolioChart from "../charts/PortfolioChart"; import PortfolioModule from "../modules/PortfolioModule";
import Portfolio from "../modules/Portfolio"; import NewsModule from "../modules/NewsModule";
import HeatmapModule from "../modules/HeadmapModule";
import MarketsModule from "../modules/MarketsModule";
import MoversModule from "../modules/MoversModule";
import EarningsModule from "../modules/EarningsModule";
import DocumentsModule from "../modules/DocumentsModule";
import IndicatorsModule from "../modules/IndicatorsModule";
import ForexAndBondsModule from "../modules/ForexAndBondsModule";
function HomePageGrid() { function HomePageGrid() {
return ( return (
<div className="h-screen px-4 grid grid-rows-3 grid-cols-12 gap-4"> <div className="h-screen px-4 grid grid-rows-3 grid-cols-12 gap-4">
<div className="rounded-2xl col-span-4 sm:col-span-4 bg-gray-900"> <div className="col-span-4 sm:col-span-4">
<Portfolio /> <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">
<MarketsModule />
</div>
<div className="col-span-4 sm:col-span-6">
<MoversModule />
</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>
<div className="rounded-2xl col-span-4 sm:col-span-4 bg-gray-900">2</div>
<div className="rounded-2xl col-span-4 sm:col-span-4 bg-gray-900">3</div>
<div className="rounded-2xl col-span-4 sm:col-span-6 bg-gray-900">1</div>
<div className="rounded-2xl col-span-4 sm:col-span-6 bg-gray-900">2</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">1</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">2</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">3</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">4</div>
</div> </div>
); );
} }
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const DocumentsModule = () => {
return <HomepageModule title="Documents"></HomepageModule>;
};
export default DocumentsModule;
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const EarningsModule = () => {
return <HomepageModule title="Earnings"></HomepageModule>;
};
export default EarningsModule;
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const ForexAndBondsModule = () => {
return <HomepageModule title="Forex and Bonds"></HomepageModule>;
};
export default ForexAndBondsModule;
View File
+8
View File
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const HeatmapModule = () => {
return <HomepageModule title="Heatmap"></HomepageModule>;
};
export default HeatmapModule;
+24
View File
@@ -0,0 +1,24 @@
import { Settings2Icon } from "lucide-react";
import React, { ReactNode } from "react";
import { Button } from "../ui/button";
interface HomepageModuleProps {
title: string;
children?: ReactNode;
}
const HomepageModule = ({ title, children }: HomepageModuleProps) => {
return (
<div className="h-full bg-popover-foreground rounded-lg">
<div className="flex flex-row justify-between px-4 py-4 pb-0">
<div className="flex items-center h-10 text-lg px-2">{title}</div>
<Button variant="ghost" size="sm" className="flex items-center">
<Settings2Icon size={20} />
</Button>
</div>
<div className="h-full w-full">{children}</div>
</div>
);
};
export default HomepageModule;
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const IndicatorsModule = () => {
return <HomepageModule title="Indicators"></HomepageModule>;
};
export default IndicatorsModule;
+8
View File
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const MarketsModule = () => {
return <HomepageModule title="Markets"></HomepageModule>;
};
export default MarketsModule;
-15
View File
@@ -1,15 +0,0 @@
import React from "react";
interface ModuleProps {
title: string;
}
function Module({ title }: ModuleProps) {
return (
<div className="h-full w-full flex flex-row">
<div className="h-10 text-xl">{title}</div>
</div>
);
}
export default Module;
+8
View File
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const MoversModule = () => {
return <HomepageModule title="Movers"></HomepageModule>;
};
export default MoversModule;
+8
View File
@@ -0,0 +1,8 @@
import React from "react";
import HomepageModule from "./HomepageModule";
const NewsModule = () => {
return <HomepageModule title="News"></HomepageModule>;
};
export default NewsModule;
-123
View File
@@ -1,123 +0,0 @@
import React from "react";
import PortfolioChart from "../charts/PortfolioChart";
import Module from "./Module";
function Portfolio() {
const data = [
{
"id": "japan",
"color": "hsl(173, 70%, 50%)",
"data": [
{
"x": "plane",
"y": 274,
},
{
"x": "helicopter",
"y": 197,
},
{
"x": "boat",
"y": 175,
},
{
"x": "train",
"y": 181,
},
{
"x": "subway",
"y": 54,
},
{
"x": "bus",
"y": 91,
},
{
"x": "car",
"y": 68,
},
{
"x": "moto",
"y": 244,
},
{
"x": "bicycle",
"y": 298,
},
{
"x": "horse",
"y": 286,
},
{
"x": "skateboard",
"y": 0,
},
{
"x": "others",
"y": 214,
},
],
},
{
"id": "france",
"color": "hsl(346, 70%, 50%)",
"data": [
{
"x": "plane",
"y": 166,
},
{
"x": "helicopter",
"y": 147,
},
{
"x": "boat",
"y": 276,
},
{
"x": "train",
"y": 132,
},
{
"x": "subway",
"y": 165,
},
{
"x": "bus",
"y": 47,
},
{
"x": "car",
"y": 27,
},
{
"x": "moto",
"y": 40,
},
{
"x": "bicycle",
"y": 80,
},
{
"x": "horse",
"y": 274,
},
{
"x": "skateboard",
"y": 109,
},
{
"x": "others",
"y": 211,
},
],
},
];
return (
// ADD MODULE
<PortfolioChart data={data} />
);
}
export default Portfolio;
@@ -0,0 +1,15 @@
import React from "react";
import PortfolioChart from "../charts/PortfolioChart";
import HomepageModule from "./HomepageModule";
import { PortfolioData } from "@/app/MockData/MockData";
const PortfolioModule = () => {
return (
<HomepageModule title="Portfolio">
<PortfolioChart data={PortfolioData} />
</HomepageModule>
);
};
export default PortfolioModule;
+5 -6
View File
@@ -1,21 +1,20 @@
import React from "react"; import React from "react";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { link } from "fs";
function NavPages() { const NavPages = () => {
return ( return (
<div className="flex justify-between gap-8 px-8"> <div className="flex justify-between gap-8 px-8">
<Button variant="link" className="text-white font-bold"> <Button variant="link" className="text-secondary font-bold">
HOME HOME
</Button> </Button>
<Button variant="link" className="text-white font-bold"> <Button variant="link" className="text-secondary font-bold">
PORTFOLIO PORTFOLIO
</Button> </Button>
<Button variant="link" className="text-white font-bold"> <Button variant="link" className="text-secondary font-bold">
RESEARCH RESEARCH
</Button> </Button>
</div> </div>
); );
} };
export default NavPages; export default NavPages;
+2 -2
View File
@@ -4,7 +4,7 @@ import NavbarSearch from "./NavbarSearch";
import { Circle, icons } from "lucide-react"; import { Circle, icons } from "lucide-react";
import NavPages from "./NavPages"; import NavPages from "./NavPages";
function 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-4 w-screen flex flex-row justify-between items-center">
<div className="flex"> <div className="flex">
@@ -22,6 +22,6 @@ function Navbar() {
</div> </div>
</div> </div>
); );
} };
export default Navbar; export default Navbar;
+2 -2
View File
@@ -3,7 +3,7 @@ import { Input } from "../ui/input";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { Search } from "lucide-react"; import { Search } from "lucide-react";
function NavbarSearch() { const NavbarSearch = () => {
return ( return (
<div className="flex items-center px-4"> <div className="flex items-center px-4">
<div className=""> <div className="">
@@ -20,6 +20,6 @@ function NavbarSearch() {
</div> </div>
</div> </div>
); );
} };
export default NavbarSearch; export default NavbarSearch;