mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-30 23:16:52 +00:00
登录结合OpenWrite
This commit is contained in:
@@ -2,6 +2,7 @@ import Collapse from '@/components/Collapse'
|
||||
import DarkModeButton from '@/components/DarkModeButton'
|
||||
import { siteConfig } from '@/lib/config'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import { SignInButton, SignedOut, UserButton } from '@clerk/nextjs'
|
||||
import { useRef, useState } from 'react'
|
||||
import CONFIG from '../config'
|
||||
import LogoBar from './LogoBar'
|
||||
@@ -59,6 +60,8 @@ export default function Header(props) {
|
||||
links = customMenu
|
||||
}
|
||||
|
||||
const enableClerk = process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
|
||||
|
||||
return (
|
||||
<div id='top-nav' className={'fixed top-0 w-full z-20 ' + className}>
|
||||
{/* PC端菜单 */}
|
||||
@@ -79,6 +82,19 @@ export default function Header(props) {
|
||||
|
||||
{/* 右侧 */}
|
||||
<div className='flex items-center gap-4'>
|
||||
{/* 登录相关 */}
|
||||
{enableClerk && (
|
||||
<>
|
||||
<SignedOut>
|
||||
<SignInButton mode='modal'>
|
||||
<button className='bg-green-500 hover:bg-green-600 text-white rounded-lg px-3 py-2'>
|
||||
{locale.COMMON.SIGN_IN}
|
||||
</button>
|
||||
</SignInButton>
|
||||
</SignedOut>
|
||||
<UserButton />
|
||||
</>
|
||||
)}
|
||||
<DarkModeButton className='text-sm items-center h-full hidden md:flex' />
|
||||
<SearchInput className='hidden md:flex md:w-52 lg:w-72' />
|
||||
{/* 折叠按钮、仅移动端显示 */}
|
||||
|
||||
Reference in New Issue
Block a user