From 18e52c6352d69191a8283cb7d1daea5616153820 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 26 Dec 2022 21:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=BE=AE=E8=B0=83=EF=BC=8C?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ThemeSwitch.js | 18 +++++++-- themes/matery/LayoutCategory.js | 33 ++++++++++++++--- themes/matery/LayoutCategoryIndex.js | 49 ++++++++++++------------- themes/matery/LayoutTag.js | 8 ++-- themes/matery/components/ArticleInfo.js | 5 +-- themes/matery/components/WordCount.js | 13 ++++--- 6 files changed, 78 insertions(+), 48 deletions(-) diff --git a/components/ThemeSwitch.js b/components/ThemeSwitch.js index 9ec3394d..4e84f36f 100644 --- a/components/ThemeSwitch.js +++ b/components/ThemeSwitch.js @@ -1,4 +1,5 @@ import { useGlobal } from '@/lib/global' +import { ALL_THEME } from '@/themes' import React from 'react' import { Draggable } from './Draggable' /** @@ -6,15 +7,24 @@ import { Draggable } from './Draggable' * @returns 主题切换 */ export function ThemeSwitch() { - const { theme, switchTheme } = useGlobal() + const { theme, changeTheme } = useGlobal() + + const onSelectChange = (e) => { + changeTheme(e.target.value) + } return (<>
- -
{theme}
- + + {/*
{theme}
*/} +
diff --git a/themes/matery/LayoutCategory.js b/themes/matery/LayoutCategory.js index 12abfa10..d7c72799 100644 --- a/themes/matery/LayoutCategory.js +++ b/themes/matery/LayoutCategory.js @@ -2,14 +2,35 @@ import BlogPostListScroll from './components/BlogPostListScroll' import BlogPostListPage from './components/BlogPostListPage' import LayoutBase from './LayoutBase' import BLOG from '@/blog.config' +import Link from 'next/link' +import HeaderArticle from './components/HeaderArticle' export const LayoutCategory = props => { - const { category } = props - return -
- - {category} + const { category, categories } = props + return } > + +
+ +
+ +
+ {categories.map(e => { + const selected = e.name === category + return ( + +
+ + {e.name}({e.count}) +
+ + ) + })} +
+
+ + {BLOG.POST_LIST_STYLE === 'page' ? : } +
- {BLOG.POST_LIST_STYLE === 'page' ? : } +
} diff --git a/themes/matery/LayoutCategoryIndex.js b/themes/matery/LayoutCategoryIndex.js index 6d21da03..99c0f582 100644 --- a/themes/matery/LayoutCategoryIndex.js +++ b/themes/matery/LayoutCategoryIndex.js @@ -1,35 +1,32 @@ -import { useGlobal } from '@/lib/global' import Link from 'next/link' -import Card from './components/Card' +import HeaderArticle from './components/HeaderArticle' import LayoutBase from './LayoutBase' export const LayoutCategoryIndex = props => { const { categories } = props - const { locale } = useGlobal() + return ( - - -
- - {locale.COMMON.CATEGORY}: -
-
- {categories.map(category => { - return ( - -
- - {category.name}({category.count}) + } > + +
+ +
+ +
+ {categories.map(e => { + return ( + +
+ + {e.name}({e.count}) +
+ + ) + })} +
- - ) - })} -
- -
+ +
+ ) } diff --git a/themes/matery/LayoutTag.js b/themes/matery/LayoutTag.js index 5e26addd..3f3d4fbd 100644 --- a/themes/matery/LayoutTag.js +++ b/themes/matery/LayoutTag.js @@ -14,9 +14,9 @@ export const LayoutTag = (props) => { return } > -
+
-
+
{locale.COMMON.TAGS} @@ -33,8 +33,10 @@ export const LayoutTag = (props) => { })}
+ + {BLOG.POST_LIST_STYLE === 'page' ? : } +
- {BLOG.POST_LIST_STYLE === 'page' ? : } } diff --git a/themes/matery/components/ArticleInfo.js b/themes/matery/components/ArticleInfo.js index fd21e660..892e1c3e 100644 --- a/themes/matery/components/ArticleInfo.js +++ b/themes/matery/components/ArticleInfo.js @@ -28,15 +28,14 @@ export const ArticleInfo = (props) => { passHref > - 发布日期: {date} + 发布日期: {date} 更新日期: {post.lastEditedTime} - - + )} diff --git a/themes/matery/components/WordCount.js b/themes/matery/components/WordCount.js index 783e37c9..be39bff6 100644 --- a/themes/matery/components/WordCount.js +++ b/themes/matery/components/WordCount.js @@ -10,14 +10,15 @@ export default function WordCount() { }) return - - - 文章字数 - 0 - + + + 文章字数  + 0 + + 阅读时长: - 0 分钟 + 0分钟 }