navbar 작업중
This commit is contained in:
parent
f83eb9af29
commit
f9ff6b72cb
image-ai
Binary file not shown.
47
image-ai/src/components/hint.tsx
Normal file
47
image-ai/src/components/hint.tsx
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
} from "@/components/ui/tooltip";
|
||||||
|
|
||||||
|
export interface HintProps {
|
||||||
|
label: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
side?: "top" | "bottom" | "left" | "right";
|
||||||
|
align?: "start" | "center" | "end";
|
||||||
|
sideOffset?: number;
|
||||||
|
alightOffset?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const Hint = ({
|
||||||
|
label,
|
||||||
|
children,
|
||||||
|
side,
|
||||||
|
align,
|
||||||
|
sideOffset,
|
||||||
|
alightOffset,
|
||||||
|
}: HintProps) => {
|
||||||
|
return (
|
||||||
|
<TooltipProvider>
|
||||||
|
<Tooltip delayDuration={100}>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
{/* asChild는 기능은 그대로 children 태그를 대신 렌더링.*/}
|
||||||
|
{children}
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent
|
||||||
|
className="text-white bg-slate-800 border-slate-800"
|
||||||
|
side={side}
|
||||||
|
align={align}
|
||||||
|
sideOffset={sideOffset}
|
||||||
|
alignOffset={alightOffset}
|
||||||
|
>
|
||||||
|
<p className="font-semibold capitalize">
|
||||||
|
{label}
|
||||||
|
</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
|
||||||
|
)
|
||||||
|
};
|
@ -1,10 +1,12 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
import {ChevronDown, MousePointerClick, Undo2} from "lucide-react";
|
||||||
|
import {CiFileOn} from "react-icons/ci";
|
||||||
|
|
||||||
import {Logo} from "./logo";
|
import {Logo} from "./logo";
|
||||||
|
import {Hint} from "@/components/hint";
|
||||||
|
|
||||||
import {ChevronDown} from "lucide-react";
|
|
||||||
import {CiFileOn} from "react-icons/ci";
|
|
||||||
import {Button} from "@/components/ui/button";
|
import {Button} from "@/components/ui/button";
|
||||||
|
import {Separator} from "@/components/ui/separator";
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
@ -12,6 +14,7 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
|
||||||
export const Navbar = () => {
|
export const Navbar = () => {
|
||||||
return (
|
return (
|
||||||
<nav className="w-full flex items-center p-4 h-[68px]
|
<nav className="w-full flex items-center p-4 h-[68px]
|
||||||
@ -39,6 +42,27 @@ export const Navbar = () => {
|
|||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
<Separator orientation="vertical" className="mx-2"/>
|
||||||
|
<Hint label="select" side="bottom" sideOffset={10}>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={()=>{}} //TODO: Add functionality
|
||||||
|
className="" //TODO: Add dynamic class
|
||||||
|
>
|
||||||
|
<MousePointerClick className="size-4"/>
|
||||||
|
</Button>
|
||||||
|
</Hint>
|
||||||
|
<Hint label="Undo" side="bottom" sideOffset={10}>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={()=>{}} //TODO: Add functionality
|
||||||
|
className="" //TODO: Add dynamic class
|
||||||
|
>
|
||||||
|
<Undo2 className="size-4"/>
|
||||||
|
</Button>
|
||||||
|
</Hint>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user