Skip to content

Commit 2542c10

Browse files
Merge pull request #19 from frontChapter/navigation
Implement Top Navigation
2 parents 99c9af5 + 8f64ef6 commit 2542c10

13 files changed

Lines changed: 492 additions & 2 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@radix-ui/react-accordion": "^1.2.2",
1414
"@radix-ui/react-icons": "^1.3.2",
15+
"@radix-ui/react-navigation-menu": "^1.2.5",
1516
"@radix-ui/react-slot": "^1.1.2",
1617
"class-variance-authority": "^0.7.1",
1718
"clsx": "^2.1.1",
@@ -38,4 +39,4 @@
3839
"typescript": "^5"
3940
},
4041
"packageManager": "pnpm@9.5.0"
41-
}
42+
}

pnpm-lock.yaml

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./top-navigation";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type NavigationDataType = { content: string; link: string };
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import FrontChapter from "@/components/logos/front-chapter";
2+
import { Button } from "@/components/ui/button";
3+
import {
4+
NavbarCenter,
5+
Navbar as NavbarComponent,
6+
NavbarLeft,
7+
NavbarRight,
8+
} from "@/components/ui/navbar";
9+
import Navigation from "@/components/ui/navigation";
10+
import { TicketIcon } from "lucide-react";
11+
import Link from "next/link";
12+
13+
export default function TopNavigation() {
14+
return (
15+
<header className="sticky top-0 z-50 -mb-4 px-4 pb-4">
16+
<div className="fade-bottom absolute left-0 h-24 w-full bg-background backdrop-blur-lg dark:bg-background-dark"></div>
17+
<div className="relative mx-auto max-w-container">
18+
<NavbarComponent>
19+
<NavbarLeft>
20+
<Link
21+
href="/"
22+
className="flex items-center gap-2 text-xl font-bold"
23+
>
24+
<FrontChapter />
25+
فرانت چپتر
26+
</Link>
27+
</NavbarLeft>
28+
<NavbarCenter className="hidden h-11 w-96 rounded-[12px] border border-[#09090B]/10 dark:border-white/10 md:flex">
29+
<Navigation />
30+
</NavbarCenter>
31+
32+
<NavbarRight>
33+
<Button variant="glow" size="lg" className="flex gap-2">
34+
<TicketIcon className="h-4 w-4" />
35+
<Link href="https://frontchapter.ir/product/conf1403/">
36+
خرید بلیت
37+
</Link>
38+
</Button>
39+
</NavbarRight>
40+
</NavbarComponent>
41+
</div>
42+
</header>
43+
);
44+
}

src/app/globals.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,28 @@
66
* {
77
@apply border-border;
88
}
9+
910
body {
1011
@apply bg-background text-foreground dark:bg-background-dark dark:text-foreground-dark;
1112
}
1213
}
14+
15+
@layer components {
16+
17+
.glass-1 {
18+
@apply border border-border/20 border-b-border/5 bg-gradient-to-b from-[#09090B]/5 to-[#09090B]/20 dark:border-b-0 dark:border-border/5 dark:border-t-border/20 dark:from-white/5 dark:to-white/20;
19+
}
20+
21+
.glass-2 {
22+
@apply border border-border/20 border-b-border/5 bg-gradient-to-b from-[#09090B]/20 to-[#09090B]/5 dark:border-b-0 dark:border-border/5 dark:border-t-border/20 dark:from-white/20 dark:to-white/5;
23+
}
24+
25+
26+
.dark-glass-1 {
27+
@apply border border-border/80 border-b-input/90 bg-gradient-to-b from-[#27272A]/60 to-[#27272A]/20 dark:border-b-0 dark:border-border/5 dark:border-t-border/20 dark:from-white/10 dark:to-white/5;
28+
}
29+
30+
.dark-glass-2 {
31+
@apply border border-border/100 border-b-input bg-gradient-to-b from-[#27272A]/100 to-[#27272A]/20 dark:border-b-0 dark:border-border/5 dark:border-t-border/20 dark:from-white/15 dark:to-white/5;
32+
}
33+
}

src/app/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import Sponsors from "./components/Sponsors/Sponsors";
2+
import TopNavigation from "./components/top-navigation/top-navigation";
23
import FAQ from "@/app/components/FAQ/FAQ";
34
import TweetSection from "@/app/components/TweetSection/TweetSection";
45
import Speakers from "@/app/components/speakers/Speakers";
56

67
export default function Home() {
78
return (
89
<>
10+
<TopNavigation />
911
<Speakers />
12+
<Sponsors />
1013
<TweetSection />
1114
<FAQ />
12-
<Sponsors />
1315
</>
1416
);
1517
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const FrontChapter = (props: React.SVGProps<SVGSVGElement>) => (
2+
<svg
3+
width={24}
4+
height={28}
5+
viewBox="0 0 24 28"
6+
fill="none"
7+
xmlns="http://www.w3.org/2000/svg"
8+
{...props}
9+
>
10+
<path
11+
d="M14.1694 7.875H9.6431C6.78437 7.875 5.355 7.875 4.74556 8.99768C4.13612 10.1204 4.71632 11.6847 5.87672 14.8132L8.70483 22.4382C10.0801 26.1461 10.7677 28 11.9062 28C12.4002 28 12.8093 27.6511 13.2264 26.9532C13.4528 26.5746 13.4533 26.0725 13.2731 25.6599L12.3016 23.4344C12.0901 22.9501 11.9844 22.708 12.0746 22.5296C12.1649 22.3512 12.393 22.3512 12.8494 22.3512H14.4032C14.8512 22.3512 15.2572 22.0352 15.439 21.5449L16.4801 18.7379C16.7337 18.0542 16.4774 17.2537 15.9071 16.9482L12.0738 14.8949C11.5665 14.6231 11.7284 13.7149 12.2842 13.7149H17.5998C18.0502 13.7149 18.4599 13.3961 18.6337 12.8985C19.2994 10.9922 19.537 9.86357 19.0669 8.99768C18.4575 7.875 17.0281 7.875 14.1694 7.875Z"
12+
fill="#F97316"
13+
/>
14+
<path
15+
d="M12.0071 6.9979C10.9641 7.00336 10.091 6.72656 9.3161 6.03821C8.64975 5.44622 8.25114 4.63913 8.03064 3.68827C7.92483 3.23209 7.8562 2.7675 7.87957 2.2878C7.88668 2.14175 7.92543 2.06432 8.05275 2.0681C8.86063 2.09149 9.62555 2.29073 10.2889 2.8931C10.3626 2.96002 10.3796 2.9183 10.397 2.85179C10.4292 2.72914 10.4528 2.60312 10.4834 2.47976C10.652 1.80151 10.9778 1.23611 11.3404 0.696754C11.496 0.465301 11.6663 0.251072 11.8434 0.0441239C11.8935 -0.0144043 11.9257 -0.0151045 11.9751 0.0444037C12.5826 0.778245 13.1229 1.56599 13.3608 2.59878C13.3686 2.63252 13.3737 2.66711 13.3794 2.70141C13.4208 2.95316 13.4428 2.96031 13.6086 2.81259C13.958 2.50146 14.3589 2.33428 14.7742 2.21582C15.0998 2.12285 15.4273 2.04262 15.7661 2.06614C15.8812 2.07412 15.9368 2.12635 15.9374 2.26987C15.9436 3.61043 15.6074 4.79387 14.8053 5.72808C14.269 6.35269 13.6162 6.73144 12.8795 6.88842C12.5575 6.95731 12.2366 7.0115 12.0071 6.9979Z"
16+
fill="#22C55E"
17+
/>
18+
</svg>
19+
);
20+
export default FrontChapter;

src/components/ui/button.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { cn } from "@/lib/utils";
2+
import { Slot } from "@radix-ui/react-slot";
3+
import { cva, type VariantProps } from "class-variance-authority";
4+
import * as React from "react";
5+
6+
const buttonVariants = cva(
7+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
8+
{
9+
variants: {
10+
variant: {
11+
default:
12+
"text-white -foreground shadow dark:hover:from-white/80 hover:from-white/70 dark:hover:to-white/70 hover:to-white/90 bg-gradient-to-b from-white/60 to-white/100 dark:from-white/100 dark:to-white/70 border-t-white",
13+
destructive:
14+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
15+
outline:
16+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent",
17+
glow: "glass-1 dark:dark-glass-1 hover:glass-2 dark:hover:dark-glass-2 shadow-md",
18+
secondary:
19+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20+
ghost: "hover:bg-accent hover:text-accent-foreground",
21+
link: "text-foreground underline-offset-4 hover:underline",
22+
},
23+
size: {
24+
default: "h-9 px-4 py-2",
25+
xs: "h-7 rounded-md px-2",
26+
sm: "h-8 rounded-md px-3 text-xs",
27+
lg: "h-10 rounded-md px-5",
28+
icon: "h-9 w-9",
29+
},
30+
},
31+
defaultVariants: {
32+
variant: "default",
33+
size: "default",
34+
},
35+
},
36+
);
37+
38+
export interface ButtonProps
39+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
40+
VariantProps<typeof buttonVariants> {
41+
asChild?: boolean;
42+
}
43+
44+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
45+
({ className, variant, size, asChild = false, ...props }, ref) => {
46+
const Comp = asChild ? Slot : "button";
47+
return (
48+
<Comp
49+
className={cn(buttonVariants({ variant, size, className }))}
50+
ref={ref}
51+
{...props}
52+
/>
53+
);
54+
},
55+
);
56+
Button.displayName = "Button";
57+
58+
export { Button, buttonVariants };

0 commit comments

Comments
 (0)