mirror of
https://github.com/dylanbenzi/yellowbird.git
synced 2026-11-27 01:07:01 +00:00
command menu integration and misc changes
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { Metadata } from "next";
|
||||
import React from "react";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Calendar",
|
||||
};
|
||||
|
||||
const page = () => {
|
||||
return <div>Calendar</div>;
|
||||
};
|
||||
|
||||
@@ -12,13 +12,13 @@ import {
|
||||
import { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Dashboard :)",
|
||||
title: "Dashboard",
|
||||
};
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="flex h-full">
|
||||
<div className="pb-6 grid grid-rows-3 grid-cols-12 gap-6 flex-1 ">
|
||||
<div className="grid grid-rows-3 grid-cols-12 gap-6 flex-1 ">
|
||||
<div className="col-span-4 sm:col-span-4">
|
||||
<PortfolioModule />
|
||||
</div>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 4.2 KiB |
+4
-4
@@ -11,8 +11,8 @@ import { dark } from "@clerk/themes";
|
||||
const red_hat = Red_Hat_Display({ subsets: ["latin"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: "yellowbird",
|
||||
description: "yellowbird finance",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
@@ -40,9 +40,9 @@ export default function RootLayout({
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<Sidebar />
|
||||
<main className="w-full h-full overflow-y-scroll">
|
||||
<main className="w-full h-screen overflow-auto">
|
||||
<Navbar />
|
||||
<div className="w-full h-full p-4">{children}</div>
|
||||
<div className="w-full h-[calc(100vh-64px)] p-4">{children}</div>
|
||||
</main>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Metadata } from "next";
|
||||
import React from "react";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Portfolio",
|
||||
};
|
||||
|
||||
const page = () => {
|
||||
return <div>Portfolio</div>;
|
||||
};
|
||||
|
||||
+12
-8
@@ -1,12 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import InsiderTrading from "@/components/charts/InsiderTrading";
|
||||
import HomepageModule from "@/components/modules/HomepageModuleCard";
|
||||
import CommandKey from "@/components/nav/CommandKey";
|
||||
import CommandMenu from "@/components/nav/CommandMenu";
|
||||
import React from "react";
|
||||
import { insiderTransactions } from "../../../public/MockData/MockData";
|
||||
|
||||
const tests = () => {
|
||||
return <InsiderTrading data={insiderTransactions} />;
|
||||
const page = () => {
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<div className="w-1/2 h-96">
|
||||
<CommandMenu />
|
||||
</div>
|
||||
<CommandKey />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default tests;
|
||||
export default page;
|
||||
|
||||
@@ -12,7 +12,7 @@ const UserItem = ({ isCollapsed }: UserItemProps) => {
|
||||
const { user } = useUser();
|
||||
|
||||
if (!user) {
|
||||
return <div>No user</div>;
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(user.primaryEmailAddress);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Command,
|
||||
CommandEmpty,
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandList,
|
||||
CommandSeparator,
|
||||
CommandShortcut,
|
||||
CommandDialog,
|
||||
} from "@/components/ui/command";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const CommandKey = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const down = (e: KeyboardEvent) => {
|
||||
if (e.key === "/" && (e.metaKey || e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
setOpen((open) => !open);
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", down);
|
||||
return () => document.removeEventListener("keydown", down);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<CommandDialog open={open} onOpenChange={setOpen}>
|
||||
<CommandInput placeholder="Type a command or search..." />
|
||||
<CommandList>
|
||||
<CommandEmpty>No results found.</CommandEmpty>
|
||||
<CommandGroup heading="Suggestions">
|
||||
<CommandItem>Calendar</CommandItem>
|
||||
<CommandItem>Search Emoji</CommandItem>
|
||||
<CommandItem>Calculator</CommandItem>
|
||||
</CommandGroup>
|
||||
</CommandList>
|
||||
</CommandDialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default CommandKey;
|
||||
@@ -0,0 +1,84 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
Command,
|
||||
CommandEmpty,
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandList,
|
||||
CommandSeparator,
|
||||
CommandShortcut,
|
||||
} from "@/components/ui/command";
|
||||
import {
|
||||
CalendarIcon,
|
||||
CircleUserIcon,
|
||||
MailIcon,
|
||||
RocketIcon,
|
||||
SettingsIcon,
|
||||
UserIcon,
|
||||
} from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Badge } from "../ui/badge";
|
||||
|
||||
const CommandMenu = () => {
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
|
||||
const handleFocus = () => {
|
||||
setOpen(!open);
|
||||
};
|
||||
|
||||
return (
|
||||
<Command
|
||||
className={cn(
|
||||
open ? "h-full shadow-2xl" : "h-11 shadow-none",
|
||||
"rounded-lg border border-neutral-700"
|
||||
)}
|
||||
>
|
||||
<CommandInput
|
||||
placeholder={"Type or Ctl / to search"}
|
||||
onFocus={handleFocus}
|
||||
/>
|
||||
{open && (
|
||||
<CommandList>
|
||||
<CommandEmpty>No results found.</CommandEmpty>
|
||||
<CommandGroup heading="Suggestions">
|
||||
<CommandItem>
|
||||
<CalendarIcon className="mr-2 h-4 w-4" />
|
||||
<span>Calendar</span>
|
||||
</CommandItem>
|
||||
<CommandItem>
|
||||
<CircleUserIcon className="mr-2 h-4 w-4" />
|
||||
<span>Search Emoji</span>
|
||||
</CommandItem>
|
||||
<CommandItem>
|
||||
<RocketIcon className="mr-2 h-4 w-4" />
|
||||
<span>Launch</span>
|
||||
</CommandItem>
|
||||
</CommandGroup>
|
||||
<CommandSeparator />
|
||||
<CommandGroup heading="Settings">
|
||||
<CommandItem>
|
||||
<UserIcon className="mr-2 h-4 w-4" />
|
||||
<span>Profile</span>
|
||||
<CommandShortcut>⌘P</CommandShortcut>
|
||||
</CommandItem>
|
||||
<CommandItem>
|
||||
<MailIcon className="mr-2 h-4 w-4" />
|
||||
<span>Mail</span>
|
||||
<CommandShortcut>⌘B</CommandShortcut>
|
||||
</CommandItem>
|
||||
<CommandItem>
|
||||
<SettingsIcon className="mr-2 h-4 w-4" />
|
||||
<span>Settings</span>
|
||||
<CommandShortcut>⌘S</CommandShortcut>
|
||||
</CommandItem>
|
||||
</CommandGroup>
|
||||
</CommandList>
|
||||
)}
|
||||
</Command>
|
||||
);
|
||||
};
|
||||
|
||||
export default CommandMenu;
|
||||
@@ -7,6 +7,7 @@ import { Input } from "../ui/input";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Image from "next/image";
|
||||
import CommandMenu from "./CommandMenu";
|
||||
|
||||
const Navbar = () => {
|
||||
const [inputValue, setInputvalue] = useState("");
|
||||
@@ -24,8 +25,9 @@ const Navbar = () => {
|
||||
return (
|
||||
<div className="h-16 border-b border-neutral-700 flex items-center justify-between w-full p-4 sticky top-0 bg-background z-10">
|
||||
<div className="font-bold text-2xl">Dashboard</div>
|
||||
<div className="flex items-center">
|
||||
<Input
|
||||
<div className="flex items-center w-1/4">
|
||||
<CommandMenu />
|
||||
{/* <Input
|
||||
className="rounded-lg rounded-r-none w-96 bg-inherit border-neutral-700 hidden lg:block"
|
||||
type="text"
|
||||
placeholder="Search"
|
||||
@@ -37,7 +39,7 @@ const Navbar = () => {
|
||||
className="w-12 rounded-lg lg:rounded-l-none bg-transparent border-neutral-700 border lg:border-l-0 text-primary hover:text-neutral-700"
|
||||
>
|
||||
<Search size={16} />
|
||||
</Button>
|
||||
</Button> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
RocketIcon,
|
||||
Settings,
|
||||
SettingsIcon,
|
||||
TestTube,
|
||||
} from "lucide-react";
|
||||
import {
|
||||
Command,
|
||||
@@ -70,6 +71,11 @@ function Sidebar() {
|
||||
icon: <LineChartIcon height={20} />,
|
||||
text: "Portfolio",
|
||||
},
|
||||
{
|
||||
link: "/tests",
|
||||
icon: <TestTube height={20} />,
|
||||
text: "Test",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Search } from "lucide-react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Dialog, DialogContent } from "@/components/ui/dialog";
|
||||
import CommandMenu from "../nav/CommandMenu";
|
||||
|
||||
const Command = React.forwardRef<
|
||||
React.ElementRef<typeof CommandPrimitive>,
|
||||
@@ -28,10 +29,11 @@ interface CommandDialogProps extends DialogProps {}
|
||||
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
||||
return (
|
||||
<Dialog {...props}>
|
||||
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
||||
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
||||
<DialogContent className="overflow-hidden p-0 shadow-lg border-neutral-700">
|
||||
<CommandMenu />
|
||||
{/* <Command className=" [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
||||
{children}
|
||||
</Command>
|
||||
</Command> */}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
@@ -41,7 +43,10 @@ const CommandInput = React.forwardRef<
|
||||
React.ElementRef<typeof CommandPrimitive.Input>,
|
||||
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
|
||||
<div
|
||||
className="flex items-center border-b border-b-neutral-700 px-3"
|
||||
cmdk-input-wrapper=""
|
||||
>
|
||||
<Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
|
||||
<CommandPrimitive.Input
|
||||
ref={ref}
|
||||
|
||||
Reference in New Issue
Block a user