diff --git a/components/MenuButtonGroup.js b/components/MenuButtonGroup.js index 38df8131..2ef9b09a 100644 --- a/components/MenuButtonGroup.js +++ b/components/MenuButtonGroup.js @@ -9,7 +9,7 @@ import BLOG from 'blog.config' const MenuButtonGroup = ({ allowCollapse = false, postCount }) => { const { locale } = useGlobal() const router = useRouter() - const archiveSlot =
{postCount}
+ const archiveSlot =
{postCount}
const links = [ { id: 0, icon: faHome, name: locale.NAV.INDEX, to: '/' || '/', show: true }, diff --git a/components/SearchDrawer.js b/components/SearchDrawer.js index 680b0537..3d107e0f 100644 --- a/components/SearchDrawer.js +++ b/components/SearchDrawer.js @@ -1,7 +1,7 @@ import { Router } from 'next/router' import { useImperativeHandle, useRef } from 'react' import SearchInput from './SearchInput' -const SearchDrawer = ({ cRef }) => { +const SearchDrawer = ({ cRef, slot }) => { const searchDrawer = useRef() const searchInputRef = useRef() useImperativeHandle(cRef, () => { @@ -20,14 +20,15 @@ const SearchDrawer = ({ cRef }) => { }) return (
-
+
- + + {slot}
{/* 背景蒙版 */} -
+
) } diff --git a/components/TagItemMini.js b/components/TagItemMini.js index 2e79e403..9fec9e35 100644 --- a/components/TagItemMini.js +++ b/components/TagItemMini.js @@ -8,7 +8,7 @@ const TagItemMini = ({ tag, selected = false }) => { mr-2 py-0.5 px-1 text-xs whitespace-nowrap dark:hover:text-white ${selected ? 'text-white dark:text-gray-300 bg-black dark:bg-black dark:hover:bg-gray-900' - : `text-gray-600 hover:shadow-xl dark:border-gray-400 notion-${tag.color}_background dark:bg-gray-900`}` }> + : `text-gray-600 hover:shadow-xl dark:border-gray-400 notion-${tag.color}_background dark:bg-gray-800`}` }>
{selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
diff --git a/components/TopNav.js b/components/TopNav.js index b292f467..cd9abb38 100644 --- a/components/TopNav.js +++ b/components/TopNav.js @@ -1,13 +1,16 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import { faBars, faSearch, faTimes } from '@fortawesome/free-solid-svg-icons' +import { faAngleDoubleRight, faBars, faSearch, faTag, faThList, faTimes } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import throttle from 'lodash.throttle' +import Link from 'next/link' import { useCallback, useEffect, useRef, useState } from 'react' +import CategoryGroup from './CategoryGroup' import Collapse from './Collapse' import Logo from './Logo' import MenuButtonGroup from './MenuButtonGroup' import SearchDrawer from './SearchDrawer' +import TagGroups from './TagGroups' let windowTop = 0 @@ -50,8 +53,40 @@ const TopNav = ({ tags, currentTag, post, slot, categories, currentCategory, aut changeShow(!isOpen) } + const searchDrawerSlot = <> + { categories && ( +
+
+
{locale.COMMON.CATEGORY}
+ + + {locale.COMMON.MORE} + + +
+ +
+ ) } + + { tags && ( +
+
+
{locale.COMMON.TAGS}
+ + + {locale.COMMON.MORE} + + +
+
+ +
+
+ ) } + + return (
- + {/* 导航栏 */}