diff --git a/pages/search/index.js b/pages/search/index.js index e8f51d32..e5eebdbb 100644 --- a/pages/search/index.js +++ b/pages/search/index.js @@ -36,6 +36,8 @@ const Search = props => { const { theme } = useGlobal() const ThemeComponents = ThemeMap[theme] + console.log('search', props) + return ( {category.name}({category.count}) - ); + ) })} - ; + } export default GroupCategory diff --git a/themes/hexo/LayoutSearch.js b/themes/hexo/LayoutSearch.js index bb7225ca..ae1e938a 100644 --- a/themes/hexo/LayoutSearch.js +++ b/themes/hexo/LayoutSearch.js @@ -12,7 +12,7 @@ import Card from './components/Card' import Link from 'next/link' export const LayoutSearch = props => { - const { keyword, tags, categories } = props + const { keyword, tagOptions, categoryOptions } = props const { locale } = useGlobal() const router = useRouter() const currentSearch = keyword || router?.query?.s @@ -49,7 +49,7 @@ export const LayoutSearch = props => { {locale.COMMON.CATEGORY}:
- {categories?.map(category => { + {categoryOptions?.map(category => { return ( { {locale.COMMON.TAGS}:
- {tags?.map(tag => { + {tagOptions?.map(tag => { return (
diff --git a/themes/matery/LayoutSearch.js b/themes/matery/LayoutSearch.js index a64f1f2d..94ccbb96 100644 --- a/themes/matery/LayoutSearch.js +++ b/themes/matery/LayoutSearch.js @@ -12,7 +12,7 @@ import Card from './components/Card' import Link from 'next/link' export const LayoutSearch = props => { - const { keyword, tags, categories } = props + const { keyword, tagOptions, categoryOptions } = props const { locale } = useGlobal() const router = useRouter() const currentSearch = keyword || router?.query?.s @@ -49,7 +49,7 @@ export const LayoutSearch = props => { {locale.COMMON.CATEGORY}:
- {categories?.map(category => { + {categoryOptions?.map(category => { return ( { {locale.COMMON.TAGS}:
- {tags?.map(tag => { + {tagOptions?.map(tag => { return (
diff --git a/themes/medium/components/CategoryGroup.js b/themes/medium/components/CategoryGroup.js index 12b41e0f..1516c038 100644 --- a/themes/medium/components/CategoryGroup.js +++ b/themes/medium/components/CategoryGroup.js @@ -1,14 +1,14 @@ import React from 'react' import CategoryItem from './CategoryItem' -const CategoryGroup = ({ currentCategory, categories }) => { - if (!categories) { +const CategoryGroup = ({ currentCategory, categoryOptions }) => { + if (!categoryOptions) { return <> } return
分类
- {categories?.map(category => { + {categoryOptions?.map(category => { const selected = currentCategory === category.name return })} diff --git a/themes/medium/components/TagGroups.js b/themes/medium/components/TagGroups.js index 9168fa20..390a6306 100644 --- a/themes/medium/components/TagGroups.js +++ b/themes/medium/components/TagGroups.js @@ -7,14 +7,14 @@ import TagItemMini from './TagItemMini' * @returns {JSX.Element} * @constructor */ -const TagGroups = ({ tags, currentTag }) => { - if (!tags) return <> +const TagGroups = ({ tagOptions, currentTag }) => { + if (!tagOptions) return <> return (
标签
{ - tags?.map(tag => { + tagOptions?.map(tag => { const selected = tag.name === currentTag return })