From 2c07a79d1ea808287c1b5adf0fd5e222c1e9c746 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 23 Dec 2021 14:59:38 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20layout=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/BaseLayout.js | 32 ++++++++++---------------------- lib/cache/cache_manager.js | 8 ++++---- pages/index.js | 11 +++++++++-- public/bg_image.jpg | Bin 550829 -> 296266 bytes 4 files changed, 23 insertions(+), 28 deletions(-) mode change 100644 => 100755 public/bg_image.jpg diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index 8056895b..3544d86c 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -1,7 +1,6 @@ import CommonHead from '@/components/CommonHead' import FloatDarkModeButton from '@/components/FloatDarkModeButton' import Footer from '@/components/Footer' -import Header from '@/components/Header' import JumpToBottomButton from '@/components/JumpToBottomButton' import JumpToTopButton from '@/components/JumpToTopButton' import LoadingCover from '@/components/LoadingCover' @@ -9,7 +8,6 @@ import SideAreaRight from '@/components/SideAreaRight' import TopNav from '@/components/TopNav' import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' -import { useRouter } from 'next/router' import PropTypes from 'prop-types' import React, { useCallback, useEffect, useRef } from 'react' /** @@ -33,6 +31,7 @@ const BaseLayout = ({ children, layout, fullWidth, + headerSlot, tags, meta, post, @@ -65,40 +64,29 @@ const BaseLayout = ({ }, []) const { onLoading } = useGlobal() const targetRef = useRef(null) - const router = useRouter() + console.log('header', headerSlot) return (<> - {/* 顶部导航栏 */} - {/* {router.asPath === '/as' && */} - - {/* } */} + - {/* 首页头图 */} - {router.asPath === '/' &&
} + <>{headerSlot} -
- - {/*
- -
*/} - -
+
+
{onLoading ? : <> {children} } -
- - - -
+ +