navbar, homepage init, first nivo chart

This commit is contained in:
2024-02-25 01:15:49 -05:00
parent 5aac68b937
commit 8960e3a247
20 changed files with 1104 additions and 273 deletions
+63
View File
@@ -0,0 +1,63 @@
"use client";
import React from "react";
import { ResponsiveLine } from "@nivo/line";
function PortfolioChart({ data }: any) {
return (
<ResponsiveLine
data={data}
margin={{ top: 50, right: 110, bottom: 50, left: 60 }}
xScale={{ type: "point" }}
yScale={{
type: "linear",
min: "auto",
max: "auto",
stacked: true,
reverse: false,
}}
yFormat=" >-.2f"
curve="monotoneX"
axisTop={null}
axisRight={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: "",
legendOffset: 0,
truncateTickAt: 0,
}}
axisBottom={{
tickSize: 0,
tickPadding: 0,
tickRotation: -1,
legend: "",
legendOffset: 36,
legendPosition: "middle",
truncateTickAt: 0,
}}
axisLeft={null}
enableGridX={false}
colors={{ scheme: "yellow_orange_brown" }}
enablePoints={false}
pointSize={10}
pointColor={{ theme: "background" }}
pointBorderWidth={2}
pointBorderColor={{ from: "serieColor" }}
pointLabelYOffset={-12}
crosshairType="cross"
useMesh={true}
legends={[]}
motionConfig={{
mass: 1,
tension: 250,
friction: 1,
clamp: true,
precision: 0.01,
velocity: 0,
}}
/>
);
}
export default PortfolioChart;
+23
View File
@@ -0,0 +1,23 @@
import React from "react";
import PortfolioChart from "../charts/PortfolioChart";
import Portfolio from "../modules/Portfolio";
function HomePageGrid() {
return (
<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">
<Portfolio />
</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>
);
}
export default HomePageGrid;
View File
+15
View File
@@ -0,0 +1,15 @@
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;
+123
View File
@@ -0,0 +1,123 @@
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;
+21
View File
@@ -0,0 +1,21 @@
import React from "react";
import { Button } from "../ui/button";
import { link } from "fs";
function 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;
+27
View File
@@ -0,0 +1,27 @@
import React from "react";
import { Button } from "../ui/button";
import NavbarSearch from "./NavbarSearch";
import { Circle, icons } from "lucide-react";
import NavPages from "./NavPages";
function Navbar() {
return (
<div className="h-16 p-4 w-screen flex flex-row justify-between items-center">
<div className="flex">
<Button variant="linkNoUnderline" className="text-3xl font-bold">
YellowBird
</Button>
<NavPages />
</div>
<div className="flex">
<NavbarSearch />
<Button className="rounded-full" size="icon">
ME
</Button>
</div>
</div>
);
}
export default Navbar;
+25
View File
@@ -0,0 +1,25 @@
import React from "react";
import { Input } from "../ui/input";
import { Button } from "../ui/button";
import { Search } from "lucide-react";
function NavbarSearch() {
return (
<div className="flex items-center px-4">
<div className="">
<Input
className="rounded-full rounded-r-none min-w-80 bg-inherit border-primary p-4"
type="search"
placeholder="Search"
/>
</div>
<div className="">
<Button type="submit" className="w-14 rounded-full rounded-l-none">
<Search size={16} />
</Button>
</div>
</div>
);
}
export default NavbarSearch;
+9
View File
@@ -0,0 +1,9 @@
"use client";
import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types";
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
+57
View File
@@ -0,0 +1,57 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline:
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
linkNoUnderline: "text-primary",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = "Button";
export { Button, buttonVariants };
+25
View File
@@ -0,0 +1,25 @@
import * as React from "react";
import { cn } from "@/lib/utils";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
/>
);
}
);
Input.displayName = "Input";
export { Input };