added multi language features
This commit is contained in:
@@ -11,16 +11,19 @@ import {
|
||||
import SubMenuLink from './SubMenuLink';
|
||||
import { ChangeLang } from './ChangeLang';
|
||||
import { useLoginModal, useRegisterModal } from '@/shared/zustand/auth';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
function AuthButtons() {
|
||||
const t = useTranslations('Navbar');
|
||||
|
||||
const auth = {
|
||||
login: { title: 'Login', url: '#' },
|
||||
signup: { title: 'Sign up', url: '#' },
|
||||
login: { title: t('login'), url: '#' },
|
||||
signup: { title: t('signup'), url: '#' },
|
||||
};
|
||||
|
||||
const userItem = [
|
||||
{ title: 'Profile', url: '/profile' },
|
||||
{ title: 'Logout', url: '#' },
|
||||
{ title: t('profile'), url: '/profile' },
|
||||
{ title: t('logout'), url: '#' },
|
||||
];
|
||||
|
||||
const toggleLoginModal = useLoginModal((state) => state.toggleLoginModal);
|
||||
|
||||
@@ -8,13 +8,17 @@ import {
|
||||
SheetTrigger,
|
||||
} from '@/shared/ui/sheet';
|
||||
import { Menu } from 'lucide-react';
|
||||
import { menu } from '../lib/data';
|
||||
import { getMenu } from '../lib/data';
|
||||
import RenderMobileMenuItem from './RenderMobileMenuItem';
|
||||
import { ChangeLang } from './ChangeLang';
|
||||
import Link from 'next/link';
|
||||
import { AuthButtons } from './authButtons';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
const Navbar = () => {
|
||||
const t = useTranslations('Navbar');
|
||||
const menu = getMenu(t);
|
||||
|
||||
return (
|
||||
<section className="py-4">
|
||||
<div className="custom-container">
|
||||
@@ -26,7 +30,7 @@ const Navbar = () => {
|
||||
href={'/'}
|
||||
className="flex items-center gap-2 text-2xl font-bold "
|
||||
>
|
||||
Plagat
|
||||
{t('logo')}
|
||||
</Link>
|
||||
{/* <div className="flex items-center">
|
||||
<NavigationMenu>
|
||||
@@ -44,7 +48,7 @@ const Navbar = () => {
|
||||
<div className="flex items-center justify-between">
|
||||
{/* Logo */}
|
||||
<Link href={'/'} className="flex items-center gap-2">
|
||||
Plagat
|
||||
{t('logo')}
|
||||
</Link>
|
||||
<Sheet>
|
||||
<div className="space-x-2">
|
||||
@@ -59,7 +63,7 @@ const Navbar = () => {
|
||||
<SheetHeader>
|
||||
<SheetTitle>
|
||||
<Link href={'/'} className="flex items-center gap-2">
|
||||
Plagat
|
||||
{t('logo')}
|
||||
</Link>
|
||||
</SheetTitle>
|
||||
</SheetHeader>
|
||||
|
||||
Reference in New Issue
Block a user