Nobelium主题菜单调整

This commit is contained in:
tangly1024.com
2023-08-07 14:22:23 +08:00
parent 70cc96d8f1
commit aa284a5041
9 changed files with 136 additions and 69 deletions

View File

@@ -0,0 +1,28 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'
import { useNobeliumGlobal } from '..'
/**
* 搜索按钮
* @returns
*/
export default function SearchButton(props) {
const { locale } = useGlobal()
const { searchModal } = useNobeliumGlobal()
const router = useRouter()
function handleSearch() {
if (BLOG.ALGOLIA_APP_ID) {
searchModal.current.openSearch()
} else {
router.push('/search')
}
}
return <>
<div onClick={handleSearch} title={locale.NAV.SEARCH} alt={locale.NAV.SEARCH} className='cursor-pointer hover:bg-black hover:bg-opacity-10 rounded-full w-10 h-10 flex justify-center items-center duration-200 transition-all'>
<i title={locale.NAV.SEARCH} className="fa-solid fa-magnifying-glass" />
</div>
</>
}