fix-build

This commit is contained in:
tangly1024
2023-03-26 12:02:31 +08:00
parent cdcf7b5f0b
commit e2e93c2a3f
10 changed files with 45 additions and 29 deletions

View File

@@ -1,8 +1,5 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'
import { useState } from 'react'
import CONFIG_SIMPLE from '../config_simple'
import { MenuList } from './MenuList'
/**
@@ -11,8 +8,6 @@ import { MenuList } from './MenuList'
* @returns
*/
export const NavBar = (props) => {
const { customNav, customMenu } = props
const { locale } = useGlobal()
const [showSearchInput, changeShowSearchInput] = useState(false)
const router = useRouter()
@@ -29,24 +24,6 @@ export const NavBar = (props) => {
}
}
let links = [
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_SIMPLE.MENU_SEARCH },
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_SIMPLE.MENU_ARCHIVE },
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_SIMPLE.MENU_CATEGORY },
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_SIMPLE.MENU_TAG }
]
if (customNav) {
links = links.concat(customNav)
}
if (BLOG.CUSTOM_MENU) {
links = customMenu
}
if (!links || links.length === 0) {
return null
}
return (
<nav className="w-full bg-white md:pt-0 relative z-20 shadow border-t border-gray-100 dark:border-hexo-black-gray dark:bg-black">
<div id="nav-bar-inner" className="h-12 mx-auto max-w-9/10 justify-between items-center text-sm md:text-md md:justify-start">
@@ -56,9 +33,9 @@ export const NavBar = (props) => {
{!showSearchInput && (<MenuList {...props}/>)}
</div>
<div className="absolute right-12 h-full text-center px-2 flex items-center text-blue-400">
<div className="absolute right-12 h-full text-center px-2 flex items-center text-blue-400 cursor-pointer">
{/* <!-- extra links --> */}
<i className={showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass' + ' align-middle cursor-pointer'} onClick={toggleShowSearchInput}></i>
<i className={showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass' + ' align-middle'} onClick={toggleShowSearchInput}></i>
</div>
</div>
</nav>