Skip to content

Commit fe9247f

Browse files
committed
Navbar completed static design
1 parent e613092 commit fe9247f

9 files changed

Lines changed: 265 additions & 13 deletions

File tree

Client/package-lock.json

Lines changed: 121 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"type-check": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@radix-ui/react-slot": "^1.2.3",
14+
"@radix-ui/react-avatar": "^1.1.11",
15+
"@radix-ui/react-slot": "^1.2.4",
1516
"@tailwindcss/vite": "^4.1.16",
1617
"class-variance-authority": "^0.7.1",
1718
"clsx": "^2.1.1",

Client/src/assets/doc_10389487.png

26.7 KB
Loading

Client/src/assets/images.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import logo1 from "./doc_10389487.png";
2+
3+
export const navLogo = {
4+
logo1,
5+
};

Client/src/components/Layout/AppLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import SideBar from "./SideBar";
44

55
const AppLayout = () => {
66
return (
7-
<div className="flex gap-1 flex-col min-h-screen text-foreground bg-background lg:ml-[120px] md:ml-[60px] ml-5 mt-1.5 lg:mr-[120px] md:mr-[60px] mr-5">
7+
<div className="flex gap-1 flex-col min-h-screen text-foreground bg-accent lg:ml-40 md:ml-[60px] lg:mr-40 ml-5 md:mr-[60px] mr-5 mt-6">
88
<Navbar />
99
<div className="flex flex-1 w-full">
1010
<SideBar />
11-
<main className="bg-amber-800 w-full md:w-[75%]">
11+
<main className=" w-full md:w-[75%]">
1212
<Outlet />
1313
<h1>Hello</h1>
1414
</main>

Client/src/components/Layout/Navbar.tsx

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,42 @@
1+
import { navLogo } from "../../assets/images";
2+
import { Moon, Bell } from "lucide-react";
3+
import { Avatar, AvatarImage, AvatarFallback } from "../ui/avatar";
4+
15
const Navbar = () => {
26
return (
3-
<div className=" min-w-full h-[77px] bg-red-500 flex justify-between items-center px-4 py-2 border-b ">
4-
<div>logo</div>
5-
<div>button</div>
6-
</div>
7+
<nav className="w-full h-16 md:h-[77px] bg-gray-500/15 border-b flex items-center justify-between px-4 py-2 rounded-2xl">
8+
{/* Logo Section */}
9+
<div className="flex items-center gap-2">
10+
<img
11+
src={navLogo.logo1}
12+
alt="BrainVector Logo"
13+
className="h-7 md:h-9 object-contain"
14+
/>
15+
<h1 className="flex items-end gap-1 text-xl md:text-2xl font-semibold">
16+
<span>Brain</span>
17+
<span className="italic font-normal">Vector</span>
18+
</h1>
19+
</div>
20+
21+
{/* Right Section */}
22+
<div className="flex items-center gap-3">
23+
{/* Responsive Icon Sizes */}
24+
<Moon
25+
size={20}
26+
className="md:size-5 cursor-pointer transition hover:opacity-70"
27+
/>
28+
<Bell
29+
size={20}
30+
className="md:size-5 cursor-pointer transition hover:opacity-70"
31+
/>
32+
33+
{/* Avatar */}
34+
<Avatar className="ml-2 cursor-pointer">
35+
<AvatarImage src="https://github.com/shadcn.png" alt="User Avatar" />
36+
<AvatarFallback>CN</AvatarFallback>
37+
</Avatar>
38+
</div>
39+
</nav>
740
);
841
};
942

Client/src/components/Layout/SideBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const SideBar = () => {
22
return (
3-
<div className="hidden md:block bg-amber-100 w-[25%] min-h-dvh">
3+
<div className="hidden md:block w-[25%] min-h-dvh">
44
<h1 className="">sideBars</h1>
55
</div>
66
);
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import * as React from "react"
2+
import * as AvatarPrimitive from "@radix-ui/react-avatar"
3+
4+
import { cn } from "@/lib/utils"
5+
6+
function Avatar({
7+
className,
8+
...props
9+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
10+
return (
11+
<AvatarPrimitive.Root
12+
data-slot="avatar"
13+
className={cn(
14+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
15+
className
16+
)}
17+
{...props}
18+
/>
19+
)
20+
}
21+
22+
function AvatarImage({
23+
className,
24+
...props
25+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
26+
return (
27+
<AvatarPrimitive.Image
28+
data-slot="avatar-image"
29+
className={cn("aspect-square size-full", className)}
30+
{...props}
31+
/>
32+
)
33+
}
34+
35+
function AvatarFallback({
36+
className,
37+
...props
38+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
39+
return (
40+
<AvatarPrimitive.Fallback
41+
data-slot="avatar-fallback"
42+
className={cn(
43+
"bg-muted flex size-full items-center justify-center rounded-full",
44+
className
45+
)}
46+
{...props}
47+
/>
48+
)
49+
}
50+
51+
export { Avatar, AvatarImage, AvatarFallback }

Client/src/components/ui/badge.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import * as React from "react"
2+
import { Slot } from "@radix-ui/react-slot"
3+
import { cva, type VariantProps } from "class-variance-authority"
4+
5+
import { cn } from "@/lib/utils"
6+
7+
const badgeVariants = cva(
8+
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
9+
{
10+
variants: {
11+
variant: {
12+
default:
13+
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
14+
secondary:
15+
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
16+
destructive:
17+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
18+
outline:
19+
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
20+
},
21+
},
22+
defaultVariants: {
23+
variant: "default",
24+
},
25+
}
26+
)
27+
28+
function Badge({
29+
className,
30+
variant,
31+
asChild = false,
32+
...props
33+
}: React.ComponentProps<"span"> &
34+
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35+
const Comp = asChild ? Slot : "span"
36+
37+
return (
38+
<Comp
39+
data-slot="badge"
40+
className={cn(badgeVariants({ variant }), className)}
41+
{...props}
42+
/>
43+
)
44+
}
45+
46+
export { Badge, badgeVariants }

0 commit comments

Comments
 (0)