Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: created super admin nav #223

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions app/components/SuperAdminNavBar/SuperAdminNavbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { Button } from "~/components/ui/button";
import { Input } from "~/components/ui/input";
import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar";

import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "~/components/ui/dropdown-menu";

export default function SuperAdminNavBar() {
return (
<div className="font-sans p-4">
<nav className="py-[13.5px] w-full bg-[#FDFDFD] border-b border-b-[#DCDCDC] flex items-center justify-between max-w-[1142px] px-4">
<div className="relative flex-1">
<Input
type="text"
placeholder="Search option..."
className="w-full pr-10 pl-8 py-2 border rounded"
/>
<img
src="/images/magnifying-glass.png"
alt="search"
className="absolute top-[12px] left-[14px] w-[11.73px]"
/>
</div>

<div className="flex items-center gap-4">
<div className="relative bg-inherit">
<Button className=" px-0 bg-inherit relative">
<img
src="/images/notification-icon.png"
alt="notification-icon"
className="md:w-6 md:h-6 w-5 h-5 hidden md:block"
/>
<div className="w-[6px] h-[6px] left-[13px] bg-[#F81404] absolute top-[8px] rounded-[50%] hidden md:block"></div>
</Button>
</div>

{/* Question dropdown */}
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button className="bg-transparent px-0 ">
<img
src="/images/question-icon.png"
alt="question-icon"
className="md:w-6 md:h-6 w-5 h-5 hidden md:block"
/>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="md:w-32 mt-3 w-20">
<DropdownMenuItem>Customer care</DropdownMenuItem>
<DropdownMenuItem>FAQ</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>

{/* profile dropdown */}
<div className="flex items-center gap-1">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button className="bg-transparent px-0 ">
<Avatar>
<AvatarImage src="/images/avatar.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-20 md:w-32 mt-3">
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem>Logout</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>

<img
src="/images/dropdown-icon.png"
alt="dropdown-icon"
className="w-2 md:w-3"
/>
</div>
</div>
</nav>
</div>
);
}
50 changes: 50 additions & 0 deletions app/components/ui/avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"use client"

import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"

import { cn } from "app/lib/utils/cn"

const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Root
ref={ref}
className={cn(
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
className
)}
{...props}
/>
))
Avatar.displayName = AvatarPrimitive.Root.displayName

const AvatarImage = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Image>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Image
ref={ref}
className={cn("aspect-square h-full w-full", className)}
{...props}
/>
))
AvatarImage.displayName = AvatarPrimitive.Image.displayName

const AvatarFallback = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Fallback>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Fallback
ref={ref}
className={cn(
"flex h-full w-full items-center justify-center rounded-full bg-muted",
className
)}
{...props}
/>
))
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName

export { Avatar, AvatarImage, AvatarFallback }
40 changes: 21 additions & 19 deletions app/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Slot } from "@radix-ui/react-slot";
import { cn } from "app/lib/utils/cn";
import { cva, type VariantProps } from "class-variance-authority";
import { forwardRef, type ButtonHTMLAttributes } from "react";

import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "app/lib/utils/cn"

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",
Expand Down Expand Up @@ -29,27 +31,27 @@ const buttonVariants = cva(
variant: "default",
size: "default",
},
},
);
}
)

export interface ButtonProperties
extends ButtonHTMLAttributes<HTMLButtonElement>,
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
asChild?: boolean
}

const Button = forwardRef<HTMLButtonElement, ButtonProperties>(
({ className, variant, size, asChild = false, ...properties }, reference) => {
const Comp = asChild ? Slot : "button";
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={reference}
{...properties}
ref={ref}
{...props}
/>
);
},
);
Button.displayName = "Button";
)
}
)
Button.displayName = "Button"

export { Button, buttonVariants };
export { Button, buttonVariants }
Loading