fix: 首页出版效果
This commit is contained in:
@@ -8,44 +8,56 @@ import Image from 'next/legacy/image';
|
||||
import Link from 'next/link';
|
||||
import LanguageSwitch from '../language-switch';
|
||||
// import ThemeSwitch from '../theme-switch';
|
||||
import EmailAuthDialog, { EmailAuthDialogRef } from '@/app/auth/EmailAuthDialog/EmailAuthDialog';
|
||||
import { useRef } from 'react';
|
||||
import { UserNav } from '../user-nav';
|
||||
import ImageLogo from './image.png';
|
||||
|
||||
export default function Header() {
|
||||
export default function Header(props) {
|
||||
const t = useTranslations('common');
|
||||
|
||||
const { user } = useGlobalStore();
|
||||
const Logo = (
|
||||
<Link href='/' className='flex items-center gap-2 text-lg font-bold'>
|
||||
<Image src={ImageLogo} width={172} height={49} alt='logo' unoptimized />
|
||||
<Link href='/' className='-mt-2.5 flex items-center gap-2 font-bold'>
|
||||
<Image src={ImageLogo} width={102} height={49} alt='logo' unoptimized />
|
||||
</Link>
|
||||
);
|
||||
|
||||
const dialogRef = useRef<EmailAuthDialogRef>(null);
|
||||
|
||||
return (
|
||||
<header className='fixed top-10 z-50 w-full'>
|
||||
<div className='container flex h-[73px] items-center justify-between rounded-[50px] bg-white pl-7 pr-1'>
|
||||
<nav className='flex-col gap-6 text-lg font-medium md:flex md:flex-row md:items-center md:gap-5 md:text-sm lg:gap-6'>
|
||||
{Logo}
|
||||
</nav>
|
||||
<div className='flex h-full flex-1 items-center justify-end gap-2 py-1'>
|
||||
<LanguageSwitch />
|
||||
{/*<ThemeSwitch />*/}
|
||||
<UserNav />
|
||||
{!user && (
|
||||
<Link
|
||||
href='/auth'
|
||||
className={cn(
|
||||
buttonVariants({
|
||||
size: 'lg',
|
||||
variant: 'outline',
|
||||
}),
|
||||
'h-full rounded-[50px] border-2 border-[#0F2C53] bg-[#0F2C53] px-14 text-2xl font-bold text-white transition hover:bg-white hover:text-[#0F2C53]',
|
||||
<>
|
||||
<header className='fixed top-10 z-50 w-full'>
|
||||
<div className={'container'}>
|
||||
<div className='flex h-[73px] items-center justify-between rounded-[50px] bg-white pl-4 pr-1 md:pl-7'>
|
||||
<nav className='flex-col gap-6 font-medium md:flex md:flex-row md:items-center md:gap-5 md:text-sm lg:gap-6'>
|
||||
{Logo}
|
||||
</nav>
|
||||
<div className='flex h-full flex-1 items-center justify-end gap-2 py-1'>
|
||||
<LanguageSwitch />
|
||||
{/*<ThemeSwitch />*/}
|
||||
<UserNav />
|
||||
{!user && (
|
||||
<Link
|
||||
href='#'
|
||||
onClick={() => dialogRef.current?.show()}
|
||||
className={cn(
|
||||
buttonVariants({
|
||||
size: 'lg',
|
||||
variant: 'outline',
|
||||
}),
|
||||
'h-full rounded-[50px] border-0 border-[#0F2C53] bg-[#0F2C53] px-5 text-xl font-bold text-white transition hover:bg-[#225BA9] hover:text-white md:px-14 md:text-2xl',
|
||||
)}
|
||||
>
|
||||
{t('login')}
|
||||
</Link>
|
||||
)}
|
||||
>
|
||||
{t('login')}
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
{/* 登录注册弹窗 */}
|
||||
<EmailAuthDialog ref={dialogRef} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function Header() {
|
||||
<UserNav />
|
||||
{!user && (
|
||||
<Link
|
||||
href='/auth'
|
||||
href='/'
|
||||
className={buttonVariants({
|
||||
size: 'sm',
|
||||
})}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 3.9 KiB |
Reference in New Issue
Block a user