From 246ae4fa6df60159a3c45fbb669ffb71f5f39d6e Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 25 Mar 2023 15:42:33 +0800 Subject: [PATCH] css fix --- components/DarkModeButton.js | 2 +- themes/medium/LayoutArchive.js | 4 ++-- themes/medium/LayoutTagIndex.js | 2 +- themes/medium/components/BlogPostListPage.js | 8 ++++---- themes/medium/components/Footer.js | 2 +- themes/medium/components/MenuBarMobile.js | 2 +- themes/medium/components/MenuItemCollapse.js | 2 +- themes/medium/components/MenuItemDrop.js | 2 +- themes/medium/components/TopNavBar.js | 2 +- themes/nobelium/components/Nav.js | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js index 869a36b3..f324ea5e 100644 --- a/components/DarkModeButton.js +++ b/components/DarkModeButton.js @@ -13,7 +13,7 @@ const DarkModeButton = (props) => { htmlElement.classList?.add(newStatus ? 'dark' : 'light') } - return
+ return
diff --git a/themes/medium/LayoutArchive.js b/themes/medium/LayoutArchive.js index 520e0b33..a1449b72 100644 --- a/themes/medium/LayoutArchive.js +++ b/themes/medium/LayoutArchive.js @@ -8,7 +8,7 @@ export const LayoutArchive = props => { return (
- {Object.keys(archivePosts).map(archiveTitle => ( + {Object.keys(archivePosts)?.map(archiveTitle => (
{ {archiveTitle}
    - {archivePosts[archiveTitle].map(post => ( + {archivePosts[archiveTitle]?.map(post => (
  • { {locale.COMMON.TAGS}:
- {tagOptions.map(tag => { + {tagOptions?.map(tag => { return (
diff --git a/themes/medium/components/BlogPostListPage.js b/themes/medium/components/BlogPostListPage.js index ad78969b..bd7499dc 100644 --- a/themes/medium/components/BlogPostListPage.js +++ b/themes/medium/components/BlogPostListPage.js @@ -16,8 +16,9 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => { if (!posts || posts.length === 0) { return - } else { - return ( + } + + return (
{/* 文章列表 */} @@ -27,8 +28,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
- ) - } + ) } export default BlogPostListPage diff --git a/themes/medium/components/Footer.js b/themes/medium/components/Footer.js index 53be93b0..b9d4f49c 100644 --- a/themes/medium/components/Footer.js +++ b/themes/medium/components/Footer.js @@ -14,7 +14,7 @@ const Footer = ({ title }) => { return (
{`${copyrightDate}`} {BLOG.AUTHOR}.
diff --git a/themes/medium/components/MenuBarMobile.js b/themes/medium/components/MenuBarMobile.js index 5b4049b2..a81d54ff 100644 --- a/themes/medium/components/MenuBarMobile.js +++ b/themes/medium/components/MenuBarMobile.js @@ -28,7 +28,7 @@ export const MenuBarMobile = (props) => { return ( ) diff --git a/themes/medium/components/MenuItemCollapse.js b/themes/medium/components/MenuItemCollapse.js index c2244b5a..539419eb 100644 --- a/themes/medium/components/MenuItemCollapse.js +++ b/themes/medium/components/MenuItemCollapse.js @@ -48,7 +48,7 @@ export const MenuItemCollapse = (props) => { {/* 折叠子菜单 */} {hasSubMenu && - {link.subMenus.map(sLink => { + {link?.subMenus?.map(sLink => { return
diff --git a/themes/medium/components/MenuItemDrop.js b/themes/medium/components/MenuItemDrop.js index 18cae944..443a9682 100644 --- a/themes/medium/components/MenuItemDrop.js +++ b/themes/medium/components/MenuItemDrop.js @@ -37,7 +37,7 @@ export const MenuItemDrop = ({ link }) => { {/* 子菜单 */} {hasSubMenu &&
    - {link.subMenus.map(sLink => { + {link?.subMenus?.map(sLink => { return
  • {link?.icon &&   }{sLink.title} diff --git a/themes/medium/components/TopNavBar.js b/themes/medium/components/TopNavBar.js index d65abeef..3a7a0b55 100644 --- a/themes/medium/components/TopNavBar.js +++ b/themes/medium/components/TopNavBar.js @@ -62,7 +62,7 @@ export default function TopNavBar(props) { {/* 桌面端顶部菜单 */}
    - {links && links.map(link => )} + {links && links?.map(link => )}
diff --git a/themes/nobelium/components/Nav.js b/themes/nobelium/components/Nav.js index d7b920dc..cc618b90 100644 --- a/themes/nobelium/components/Nav.js +++ b/themes/nobelium/components/Nav.js @@ -102,7 +102,7 @@ const NavBar = props => {
    {links.map(link => )}
-
+
{links.map(link => collapseRef.current?.updateCollapseHeight(param)}/>)}