mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import React from 'react'
|
|
import { useGlobal } from '@/lib/global'
|
|
import CONFIG_MEDIUM from '../config_medium'
|
|
import BLOG from '@/blog.config'
|
|
import { MenuItemCollapse } from './MenuItemCollapse'
|
|
|
|
export const MenuBarMobile = (props) => {
|
|
const { customMenu, customNav } = props
|
|
const { locale } = useGlobal()
|
|
|
|
let links = [
|
|
// { name: locale.NAV.INDEX, to: '/' || '/', show: true },
|
|
{ name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_MEDIUM.MENU_CATEGORY },
|
|
{ name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_MEDIUM.MENU_TAG },
|
|
{ name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_MEDIUM.MENU_ARCHIVE }
|
|
// { name: locale.NAV.SEARCH, to: '/search', show: CONFIG_MEDIUM.MENU_SEARCH }
|
|
]
|
|
|
|
if (customNav) {
|
|
links = links.concat(customNav)
|
|
}
|
|
|
|
// 如果 开启自定义菜单,则不再使用 Page生成菜单。
|
|
if (BLOG.CUSTOM_MENU) {
|
|
links = customMenu
|
|
}
|
|
|
|
return (
|
|
<nav id='nav' className=' text-md'>
|
|
{/* {links.map(link => <NormalMenu key={link.id} link={link}/>)} */}
|
|
{links.map(link => <MenuItemCollapse onHeightChange={props.onHeightChange} key={link.id} link={link}/>)}
|
|
|
|
</nav>
|
|
)
|
|
}
|