mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
nobelium nav config
This commit is contained in:
@@ -2,8 +2,10 @@ import { useEffect, useRef } from 'react'
|
||||
import Link from 'next/link'
|
||||
import BLOG from '@/blog.config'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import CONFIG_NOBELIUM from '../config_nobelium'
|
||||
|
||||
const Nav = ({ navBarTitle, fullWidth }) => {
|
||||
const Nav = props => {
|
||||
const { navBarTitle, fullWidth } = props
|
||||
const useSticky = !BLOG.autoCollapsedNavBar
|
||||
const navRef = useRef(null)
|
||||
const sentinalRef = useRef([])
|
||||
@@ -83,25 +85,26 @@ const Nav = ({ navBarTitle, fullWidth }) => {
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<NavBar />
|
||||
<NavBar {...props}/>
|
||||
</div>
|
||||
</>;
|
||||
</>
|
||||
}
|
||||
|
||||
const NavBar = (props) => {
|
||||
const NavBar = props => {
|
||||
const { customNav } = props
|
||||
|
||||
const { locale } = useGlobal()
|
||||
let links = [
|
||||
{ id: 2, name: locale.NAV.RSS, to: '/feed', show: true },
|
||||
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: true },
|
||||
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: true },
|
||||
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: false },
|
||||
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: true }
|
||||
{ id: 2, name: locale.NAV.RSS, to: '/feed', show: CONFIG_NOBELIUM.MENU_RSS, target: '_blank' },
|
||||
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_NOBELIUM.MENU_SEARCH },
|
||||
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_NOBELIUM.MENU_ARCHIVE },
|
||||
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NOBELIUM.MENU_CATEGORY },
|
||||
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NOBELIUM.MENU_TAG }
|
||||
]
|
||||
if (customNav) {
|
||||
links = links.concat(customNav)
|
||||
}
|
||||
console.log(links)
|
||||
return (
|
||||
<div className="flex-shrink-0">
|
||||
<ul className="flex flex-row">
|
||||
@@ -112,7 +115,7 @@ const NavBar = (props) => {
|
||||
key={link.id}
|
||||
className="block ml-4 text-black dark:text-gray-50 nav"
|
||||
>
|
||||
<Link href={link.to}>
|
||||
<Link href={link.to} target={link.target}>
|
||||
{link.name}
|
||||
</Link>
|
||||
</li>
|
||||
@@ -120,7 +123,7 @@ const NavBar = (props) => {
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export default Nav
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
const CONFIG_NOBELIUM = {
|
||||
TEST_CONFIG: 'TEST'
|
||||
|
||||
// 菜单配置
|
||||
MENU_CATEGORY: false, // 显示分类
|
||||
MENU_TAG: true, // 显示标签
|
||||
MENU_ARCHIVE: false, // 显示归档
|
||||
MENU_SEARCH: true, // 显示搜索
|
||||
MENU_RSS: false // 显示订阅
|
||||
}
|
||||
export default CONFIG_NOBELIUM
|
||||
|
||||
Reference in New Issue
Block a user