mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 07:26:47 +00:00
next
This commit is contained in:
@@ -2,16 +2,16 @@ import Link from 'next/link'
|
||||
import React from 'react'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
|
||||
const CategoryList = ({ currentCategory, categories }) => {
|
||||
if (!categories) {
|
||||
const CategoryList = ({ currentCategory, categoryOptions }) => {
|
||||
const { locale } = useGlobal()
|
||||
if (!categoryOptions) {
|
||||
return <></>
|
||||
}
|
||||
const { locale } = useGlobal()
|
||||
|
||||
return (
|
||||
<ul className='flex py-1 space-x-3'>
|
||||
<li className='w-16 py-2 dark:text-gray-200 whitespace-nowrap'>{locale.COMMON.CATEGORY}</li>
|
||||
{categories.map(category => {
|
||||
{categoryOptions.map(category => {
|
||||
const selected = category.name === currentCategory
|
||||
return (
|
||||
<Link
|
||||
@@ -32,10 +32,10 @@ const CategoryList = ({ currentCategory, categories }) => {
|
||||
</a>
|
||||
</li>
|
||||
</Link>
|
||||
);
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export default CategoryList
|
||||
|
||||
@@ -7,13 +7,13 @@ import TagItem from './TagItem'
|
||||
* @returns {JSX.Element}
|
||||
* @constructor
|
||||
*/
|
||||
const TagList = ({ tags, currentTag }) => {
|
||||
if (!tags) {
|
||||
const TagList = ({ tagOptions, currentTag }) => {
|
||||
if (!tagOptions) {
|
||||
return <></>
|
||||
}
|
||||
return <ul className='flex py-1 space-x-3'>
|
||||
<li className='w-20 py-2 dark:text-gray-200 whitespace-nowrap'>标签:</li>
|
||||
{tags.map(tag => {
|
||||
{tagOptions.map(tag => {
|
||||
const selected = tag.name === currentTag
|
||||
return <TagItem key={tag.name} tag={tag} selected={selected}/>
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user