diff --git a/lib/global.js b/lib/global.js index 599a14cb..a6e45b3f 100644 --- a/lib/global.js +++ b/lib/global.js @@ -4,7 +4,6 @@ import { useRouter } from 'next/router' import BLOG from '@/blog.config' import { ALL_THEME, initDarkMode } from '@/themes/theme' import NProgress from 'nprogress' -import LoadingCover from '@/components/LoadingCover' import { getQueryVariable, isBrowser } from './utils' const GlobalContext = createContext() @@ -22,7 +21,7 @@ export function GlobalContextProvider({ children }) { const [theme, setTheme] = useState(BLOG.THEME) // 默认博客主题 const [isDarkMode, updateDarkMode] = useState(BLOG.APPEARANCE === 'dark') // 默认深色模式 const [onLoading, setOnLoading] = useState(false) // 抓取文章数据 - const [onReading, setOnReading] = useState(false) // 网页资源加载 + // const [onReading, setOnReading] = useState(false) // 网页资源加载 useEffect(() => { initLocale(lang, locale, updateLang, updateLocale) @@ -34,7 +33,7 @@ export function GlobalContextProvider({ children }) { // setOnReading(true) } // 监听页面元素加载完 - setOnReading(false) + // setOnReading(false) window.addEventListener('beforeunload', handleBeforeUnload) return () => { window.removeEventListener('beforeunload', handleBeforeUnload) @@ -88,10 +87,8 @@ export function GlobalContextProvider({ children }) { updateDarkMode, theme, setTheme, - switchTheme, - setOnReading + switchTheme }}> - {children} ) diff --git a/themes/gitbook/LayoutBase.js b/themes/gitbook/LayoutBase.js index 09cb681c..970a3e55 100644 --- a/themes/gitbook/LayoutBase.js +++ b/themes/gitbook/LayoutBase.js @@ -38,6 +38,8 @@ const LayoutBase = props => {
+ {/* 顶部导航栏 */} +
@@ -56,11 +58,9 @@ const LayoutBase = props => {
-
- {/* 顶部导航栏 */} - +
-
+
{slotTop} {onLoading ? LoadingCover : children} @@ -80,6 +80,21 @@ const LayoutBase = props => {
+ {/* 左侧推拉抽屉 */} +
+
+ + {slotLeft} +
+ {router.pathname !== '/search' && } + {showInfoCard && } + {CONFIG_MEDIUM.WIDGET_REVOLVER_MAPS === 'true' && } +
+
+ +
+
+ {/* 移动端底部导航栏 */} diff --git a/themes/gitbook/components/LogoBar.js b/themes/gitbook/components/LogoBar.js index cbe59474..a7fceebd 100644 --- a/themes/gitbook/components/LogoBar.js +++ b/themes/gitbook/components/LogoBar.js @@ -1,12 +1,14 @@ +import BLOG from '@/blog.config' import Link from 'next/link' -export default function LogoBar (props) { +export default function LogoBar(props) { const { siteInfo } = props return ( -
- - {siteInfo?.title} - -
- ); +
+ + {/* eslint-disable-next-line @next/next/no-img-element */} + {BLOG.AUTHOR} {siteInfo?.title} + +
+ ) } diff --git a/themes/gitbook/components/MenuItemDrop.js b/themes/gitbook/components/MenuItemDrop.js index e9d1b9f3..92cd9142 100644 --- a/themes/gitbook/components/MenuItemDrop.js +++ b/themes/gitbook/components/MenuItemDrop.js @@ -17,7 +17,7 @@ export const MenuItemDrop = ({ link }) => { return
  • changeShow(true)} onMouseOut={() => changeShow(false)} > {hasSubMenu && -
    {link?.icon && } {link?.name} @@ -27,7 +27,7 @@ export const MenuItemDrop = ({ link }) => { } {!hasSubMenu && -
    {link?.icon && } {link?.name} diff --git a/themes/gitbook/components/TopNavBar.js b/themes/gitbook/components/TopNavBar.js index b4e01345..8b07a5de 100644 --- a/themes/gitbook/components/TopNavBar.js +++ b/themes/gitbook/components/TopNavBar.js @@ -42,7 +42,7 @@ export default function TopNavBar(props) { } return ( -
    +
    {/* 移动端折叠菜单 */} diff --git a/themes/medium/LayoutBase.js b/themes/medium/LayoutBase.js index 19948d25..25c8be11 100644 --- a/themes/medium/LayoutBase.js +++ b/themes/medium/LayoutBase.js @@ -21,7 +21,7 @@ const ThemeGlobalMedium = createContext() * @constructor */ const LayoutBase = props => { - const { children, meta, showInfoCard = true, slotLeft, slotTop, siteInfo } = props + const { children, meta, showInfoCard = true, slotRight, slotTop, siteInfo } = props const { locale } = useGlobal() const router = useRouter() const [tocVisible, changeTocVisible] = useState(false) @@ -43,7 +43,7 @@ const LayoutBase = props => { {/* 桌面端左侧菜单 */} {/* */} -
    +
    {/* 顶部导航栏 */} @@ -71,7 +71,7 @@ const LayoutBase = props => {
    - {slotLeft} + {slotRight}
    {router.pathname !== '/search' && } {showInfoCard && } diff --git a/themes/medium/components/MenuItemDrop.js b/themes/medium/components/MenuItemDrop.js index e9d1b9f3..92cd9142 100644 --- a/themes/medium/components/MenuItemDrop.js +++ b/themes/medium/components/MenuItemDrop.js @@ -17,7 +17,7 @@ export const MenuItemDrop = ({ link }) => { return
  • changeShow(true)} onMouseOut={() => changeShow(false)} > {hasSubMenu && -
    {link?.icon && } {link?.name} @@ -27,7 +27,7 @@ export const MenuItemDrop = ({ link }) => { } {!hasSubMenu && -
    {link?.icon && } {link?.name}