diff --git a/shared/libs/shadcn/ui/avatar.tsx b/shared/libs/shadcn/ui/avatar.tsx new file mode 100644 index 0000000..ed0dcf1 --- /dev/null +++ b/shared/libs/shadcn/ui/avatar.tsx @@ -0,0 +1,109 @@ +"use client" + +import * as React from "react" +import { Avatar as AvatarPrimitive } from "radix-ui" + +import { cn } from "@/shared/libs/shadcn/lib/utils" + +function Avatar({ + className, + size = "default", + ...props +}: React.ComponentProps & { + size?: "default" | "sm" | "lg" +}) { + return ( + + ) +} + +function AvatarImage({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarFallback({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) { + return ( + svg]:hidden", + "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", + "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", + className + )} + {...props} + /> + ) +} + +function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AvatarGroupCount({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2", className)} + {...props} + /> + ) +} + +export { + Avatar, + AvatarImage, + AvatarFallback, + AvatarGroup, + AvatarGroupCount, + AvatarBadge, +} diff --git a/shared/libs/shadcn/ui/dropdown-menu.tsx b/shared/libs/shadcn/ui/dropdown-menu.tsx new file mode 100644 index 0000000..359401c --- /dev/null +++ b/shared/libs/shadcn/ui/dropdown-menu.tsx @@ -0,0 +1,255 @@ +"use client" + +import * as React from "react" +import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui" + +import { cn } from "@/shared/libs/shadcn/lib/utils" +import { CheckIcon, ChevronRightIcon } from "lucide-react" + +function DropdownMenu({ + ...props +}: React.ComponentProps) { + return +} + +function DropdownMenuPortal({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuTrigger({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuContent({ + className, + align = "start", + sideOffset = 4, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +function DropdownMenuGroup({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuItem({ + className, + inset, + variant = "default", + ...props +}: React.ComponentProps & { + inset?: boolean + variant?: "default" | "destructive" +}) { + return ( + + ) +} + +function DropdownMenuCheckboxItem({ + className, + children, + checked, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ) +} + +function DropdownMenuRadioGroup({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuRadioItem({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ) +} + +function DropdownMenuLabel({ + className, + inset, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + ) +} + +function DropdownMenuSeparator({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuShortcut({ + className, + ...props +}: React.ComponentProps<"span">) { + return ( + + ) +} + +function DropdownMenuSub({ + ...props +}: React.ComponentProps) { + return +} + +function DropdownMenuSubTrigger({ + className, + inset, + children, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + {children} + + + ) +} + +function DropdownMenuSubContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { + DropdownMenu, + DropdownMenuPortal, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuLabel, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, +} diff --git a/shared/widgets/navbar/components/Navbar.tsx b/shared/widgets/navbar/components/Navbar.tsx index bb314d9..bafd908 100644 --- a/shared/widgets/navbar/components/Navbar.tsx +++ b/shared/widgets/navbar/components/Navbar.tsx @@ -2,8 +2,12 @@ import Image from "next/image"; import NavigationLink from "./NavigationLink"; import SignIn from "./SignIn"; +import { useAuth } from "@/shared/contexts/AuthContext"; +import UserProfile from "./UserProfile"; const Navbar = () => { + const { session } = useAuth(); + return (
@@ -16,9 +20,7 @@ const Navbar = () => { />
-
- -
+
{session?.user ? : }
); }; diff --git a/shared/widgets/navbar/components/UserProfile.tsx b/shared/widgets/navbar/components/UserProfile.tsx new file mode 100644 index 0000000..809242f --- /dev/null +++ b/shared/widgets/navbar/components/UserProfile.tsx @@ -0,0 +1,85 @@ +import { useAuth } from "@/shared/contexts/AuthContext"; +import { Avatar, AvatarImage } from "@/shared/libs/shadcn/ui/avatar"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "@/shared/libs/shadcn/ui/dropdown-menu"; +import { + Bookmark, + CircleUserRound, + ClockFading, + LifeBuoy, + LogOut, + MessagesSquare, + Settings, + Webhook, +} from "lucide-react"; + +const UserProfile = () => { + const { session } = useAuth(); + return ( +
+ + + + + + + + + Account + + + My Profile + + + + Activity + + + + Bookmark + + + + Settings + + + + + + + Forum + + + + Help + + + + API + + + + + + + Log Out + + + + +
+ ); +}; + +export default UserProfile;