diff --git a/themes/medium/components/CategoryGroup.js b/themes/medium/components/CategoryGroup.js index d562cd1f9d4..3fd6b67d716 100644 --- a/themes/medium/components/CategoryGroup.js +++ b/themes/medium/components/CategoryGroup.js @@ -1,18 +1,37 @@ +import { useGlobal } from '@/lib/global' import CategoryItem from './CategoryItem' +/** + * 分类 + * @param {*} param0 + * @returns + */ const CategoryGroup = ({ currentCategory, categoryOptions }) => { + const { locale } = useGlobal() if (!categoryOptions) { return <> } - return
-
分类
-
- {categoryOptions?.map(category => { - const selected = currentCategory === category.name - return - })} + return ( +
+
+ + {locale.COMMON.CATEGORY} +
+
+ {categoryOptions?.map(category => { + const selected = currentCategory === category.name + return ( + + ) + })} +
-
+ ) } export default CategoryGroup diff --git a/themes/medium/components/TagGroups.js b/themes/medium/components/TagGroups.js index 390a6306f3a..dc0895f88a9 100644 --- a/themes/medium/components/TagGroups.js +++ b/themes/medium/components/TagGroups.js @@ -1,3 +1,4 @@ +import { useGlobal } from '@/lib/global' import TagItemMini from './TagItemMini' /** @@ -8,17 +9,19 @@ import TagItemMini from './TagItemMini' * @constructor */ const TagGroups = ({ tagOptions, currentTag }) => { + const { locale } = useGlobal() if (!tagOptions) return <> return (
-
标签
+
+ + {locale.COMMON.TAGS} +
- { - tagOptions?.map(tag => { - const selected = tag.name === currentTag - return - }) - } + {tagOptions?.map(tag => { + const selected = tag.name === currentTag + return + })}
)