hamburger menu
This commit is contained in:
parent
40041f2e14
commit
98b6c2934e
@ -30,8 +30,8 @@ export default async function AboutPage({ params: { locale } }: Props) {
|
|||||||
{[1, 2, 3].map((index) => (
|
{[1, 2, 3].map((index) => (
|
||||||
<div key={index} className="pt-6">
|
<div key={index} className="pt-6">
|
||||||
<div className="flow-root bg-gray-50 dark:bg-gray-800 rounded-lg px-6 pb-8">
|
<div className="flow-root bg-gray-50 dark:bg-gray-800 rounded-lg px-6 pb-8">
|
||||||
<div className="-mt-6">
|
<div className="mt-6">
|
||||||
<div>
|
{/* <div>
|
||||||
<span className="inline-flex items-center justify-center p-3 bg-blue-500 rounded-md shadow-lg">
|
<span className="inline-flex items-center justify-center p-3 bg-blue-500 rounded-md shadow-lg">
|
||||||
<svg
|
<svg
|
||||||
className="h-6 w-6 text-white"
|
className="h-6 w-6 text-white"
|
||||||
@ -48,8 +48,8 @@ export default async function AboutPage({ params: { locale } }: Props) {
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
<h3 className="mt-8 text-lg font-medium text-gray-900 dark:text-white tracking-tight">
|
<h3 className="mt-8 text-lg p-3 font-medium text-gray-900 dark:text-white tracking-tight">
|
||||||
{t(`values.${index}.title`)}
|
{t(`values.${index}.title`)}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="mt-5 text-base text-gray-500 dark:text-gray-300">
|
<p className="mt-5 text-base text-gray-500 dark:text-gray-300">
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { getTranslations } from "next-intl/server";
|
import { getTranslations } from "next-intl/server";
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import Image from "next/image";
|
// import Image from "next/image";
|
||||||
|
|
||||||
export async function Hero() {
|
export async function Hero() {
|
||||||
const t = await getTranslations("hero");
|
const t = await getTranslations("hero");
|
||||||
@ -48,7 +48,7 @@ export async function Hero() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="mx-auto max-w-7xl px-6 pb-24 pt-10 sm:pb-32 lg:flex lg:px-8 lg:py-40">
|
<div className="mx-auto max-w-7xl min-h-screen px-6 pb-24 pt-10 sm:pb-32 lg:flex lg:px-8 lg:py-40">
|
||||||
<div className="mx-auto max-w-2xl flex-shrink-0 lg:mx-0 lg:max-w-xl lg:pt-8">
|
<div className="mx-auto max-w-2xl flex-shrink-0 lg:mx-0 lg:max-w-xl lg:pt-8">
|
||||||
<h1 className="mt-10 text-4xl font-bold tracking-tight text-white sm:text-6xl">
|
<h1 className="mt-10 text-4xl font-bold tracking-tight text-white sm:text-6xl">
|
||||||
{t("title")}{" "}
|
{t("title")}{" "}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import { useTheme } from "./theme-provider";
|
import { useTheme } from "./theme-provider";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { Sun, Moon } from "lucide-react";
|
import { Sun, Moon, Menu, X } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
const languages = [
|
const languages = [
|
||||||
@ -35,6 +35,7 @@ export function Navbar() {
|
|||||||
if (path !== "" && currentPath.startsWith(path)) return true;
|
if (path !== "" && currentPath.startsWith(path)) return true;
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="border-b border-gray-200 dark:border-gray-800">
|
<nav className="border-b border-gray-200 dark:border-gray-800">
|
||||||
@ -85,7 +86,6 @@ export function Navbar() {
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Dropdown for selecting languages */}
|
|
||||||
{showLanguages && (
|
{showLanguages && (
|
||||||
<div className="absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 z-10">
|
<div className="absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 z-10">
|
||||||
<div className="py-1">
|
<div className="py-1">
|
||||||
@ -121,8 +121,43 @@ export function Navbar() {
|
|||||||
<Sun className="h-5 w-5" />
|
<Sun className="h-5 w-5" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{/* Hamburger Menu Button */}
|
||||||
|
<button
|
||||||
|
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
||||||
|
className="md:hidden p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800"
|
||||||
|
aria-label="Menu"
|
||||||
|
>
|
||||||
|
{isMenuOpen ? (
|
||||||
|
<X className="h-6 w-6" />
|
||||||
|
) : (
|
||||||
|
<Menu className="h-6 w-6" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Mobile Menu */}
|
||||||
|
{isMenuOpen && (
|
||||||
|
<div className="md:hidden">
|
||||||
|
<div className="px-2 pt-2 pb-3 space-y-1">
|
||||||
|
{navLinks.map((link) => (
|
||||||
|
<Link
|
||||||
|
key={link.name}
|
||||||
|
href={`/${currentLang}/${link.path}`}
|
||||||
|
className={`block px-3 py-2 rounded-md text-base font-medium ${
|
||||||
|
isActive(link.path)
|
||||||
|
? "bg-blue-50 dark:bg-blue-900 text-blue-500 dark:text-blue-400"
|
||||||
|
: "hover:bg-gray-50 dark:hover:bg-gray-800"
|
||||||
|
}`}
|
||||||
|
onClick={() => setIsMenuOpen(false)}
|
||||||
|
>
|
||||||
|
{link.name}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user