|
@@ -4,10 +4,12 @@ import { useState } from 'react'
|
|
|
import Link from 'next/link'
|
|
import Link from 'next/link'
|
|
|
import { useAuth } from '@/hooks/useAuth'
|
|
import { useAuth } from '@/hooks/useAuth'
|
|
|
import LoginModal from './LoginModal'
|
|
import LoginModal from './LoginModal'
|
|
|
|
|
+import RegisterModal from './RegisterModal'
|
|
|
|
|
|
|
|
export default function Header() {
|
|
export default function Header() {
|
|
|
const { user, isLoading, logout } = useAuth()
|
|
const { user, isLoading, logout } = useAuth()
|
|
|
const [showLogin, setShowLogin] = useState(false)
|
|
const [showLogin, setShowLogin] = useState(false)
|
|
|
|
|
+ const [showRegister, setShowRegister] = useState(false)
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<header className="absolute left-0 right-0 top-0 z-30 flex items-center justify-between px-4 py-3">
|
|
<header className="absolute left-0 right-0 top-0 z-30 flex items-center justify-between px-4 py-3">
|
|
@@ -29,18 +31,19 @@ export default function Header() {
|
|
|
) : (
|
|
) : (
|
|
|
<>
|
|
<>
|
|
|
{showLogin && <LoginModal onClose={() => setShowLogin(false)} />}
|
|
{showLogin && <LoginModal onClose={() => setShowLogin(false)} />}
|
|
|
|
|
+ {showRegister && <RegisterModal onClose={() => setShowRegister(false)} />}
|
|
|
<button
|
|
<button
|
|
|
onClick={() => setShowLogin(true)}
|
|
onClick={() => setShowLogin(true)}
|
|
|
className="rounded-lg bg-white/10 backdrop-blur-md px-4 py-2 text-sm text-white hover:bg-white/20 transition"
|
|
className="rounded-lg bg-white/10 backdrop-blur-md px-4 py-2 text-sm text-white hover:bg-white/20 transition"
|
|
|
>
|
|
>
|
|
|
Войти
|
|
Войти
|
|
|
</button>
|
|
</button>
|
|
|
- <Link
|
|
|
|
|
- href="/auth/register"
|
|
|
|
|
|
|
+ <button
|
|
|
|
|
+ onClick={() => setShowRegister(true)}
|
|
|
className="rounded-lg bg-green-600 px-4 py-2 text-sm text-white hover:bg-green-500 transition"
|
|
className="rounded-lg bg-green-600 px-4 py-2 text-sm text-white hover:bg-green-500 transition"
|
|
|
>
|
|
>
|
|
|
Регистрация
|
|
Регистрация
|
|
|
- </Link>
|
|
|
|
|
|
|
+ </button>
|
|
|
</>
|
|
</>
|
|
|
)}
|
|
)}
|
|
|
</nav>
|
|
</nav>
|