1
- import BLOG from '@/blog.config'
2
- import { useGlobal } from '@/lib/global'
3
1
import { useRouter } from 'next/router'
4
2
import { useState } from 'react'
5
- import CONFIG_SIMPLE from '../config_simple'
6
3
import { MenuList } from './MenuList'
7
4
8
5
/**
@@ -11,8 +8,6 @@ import { MenuList } from './MenuList'
11
8
* @returns
12
9
*/
13
10
export const NavBar = ( props ) => {
14
- const { customNav, customMenu } = props
15
- const { locale } = useGlobal ( )
16
11
const [ showSearchInput , changeShowSearchInput ] = useState ( false )
17
12
const router = useRouter ( )
18
13
@@ -29,24 +24,6 @@ export const NavBar = (props) => {
29
24
}
30
25
}
31
26
32
- let links = [
33
- { icon : 'fas fa-search' , name : locale . NAV . SEARCH , to : '/search' , show : CONFIG_SIMPLE . MENU_SEARCH } ,
34
- { icon : 'fas fa-archive' , name : locale . NAV . ARCHIVE , to : '/archive' , show : CONFIG_SIMPLE . MENU_ARCHIVE } ,
35
- { icon : 'fas fa-folder' , name : locale . COMMON . CATEGORY , to : '/category' , show : CONFIG_SIMPLE . MENU_CATEGORY } ,
36
- { icon : 'fas fa-tag' , name : locale . COMMON . TAGS , to : '/tag' , show : CONFIG_SIMPLE . MENU_TAG }
37
- ]
38
-
39
- if ( customNav ) {
40
- links = links . concat ( customNav )
41
- }
42
-
43
- if ( BLOG . CUSTOM_MENU ) {
44
- links = customMenu
45
- }
46
- if ( ! links || links . length === 0 ) {
47
- return null
48
- }
49
-
50
27
return (
51
28
< 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" >
52
29
< 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) => {
56
33
{ ! showSearchInput && ( < MenuList { ...props } /> ) }
57
34
</ div >
58
35
59
- < div className = "absolute right-12 h-full text-center px-2 flex items-center text-blue-400" >
36
+ < div className = "absolute right-12 h-full text-center px-2 flex items-center text-blue-400 cursor-pointer " >
60
37
{ /* <!-- extra links --> */ }
61
- < i className = { showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass' + ' align-middle cursor-pointer ' } onClick = { toggleShowSearchInput } > </ i >
38
+ < i className = { showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass' + ' align-middle' } onClick = { toggleShowSearchInput } > </ i >
62
39
</ div >
63
40
</ div >
64
41
</ nav >
0 commit comments