mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 23:16:52 +00:00
build
This commit is contained in:
@@ -12,7 +12,8 @@ const CategoryGroup = ({ currentCategory, categories }) => {
|
|||||||
<div className='flex flex-wrap'>
|
<div className='flex flex-wrap'>
|
||||||
{Object.keys(categories).map(category => {
|
{Object.keys(categories).map(category => {
|
||||||
const selected = currentCategory === category
|
const selected = currentCategory === category
|
||||||
return <CategoryItem key={category} selected={selected} category={category} categoryCount={categories[category]}/>
|
const categoryCount = +categories[category]
|
||||||
|
return <CategoryItem key={category} selected={selected} category={category} categoryCount={categoryCount}/>
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import Link from 'next/link'
|
|||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||||
import { faFolderOpen, faFolder } from '@fortawesome/free-solid-svg-icons'
|
import { faFolderOpen, faFolder } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
export default function CategoryItem ({ key, selected, category, categoryCount }) {
|
export default function CategoryItem ({ selected, category, categoryCount }) {
|
||||||
return <Link key={key || category} href={`/category/${category}`} passHref>
|
return <Link href={`/category/${category}`} passHref>
|
||||||
<a className={(selected
|
<a className={(selected
|
||||||
? 'hover:text-white dark:hover:text-white bg-gray-600 text-white '
|
? 'hover:text-white dark:hover:text-white bg-gray-600 text-white '
|
||||||
: 'dark:text-gray-400 text-gray-500 hover:text-white dark:hover:text-white hover:bg-gray-600') +
|
: 'dark:text-gray-400 text-gray-500 hover:text-white dark:hover:text-white hover:bg-gray-600') +
|
||||||
' flex text-sm items-center duration-300 cursor-pointer py-1 font-light px-2 whitespace-nowrap'}>
|
' flex text-sm items-center duration-300 cursor-pointer py-1 font-light px-2 whitespace-nowrap'}>
|
||||||
<div><FontAwesomeIcon icon={selected ? faFolderOpen : faFolder}
|
<div><FontAwesomeIcon icon={selected ? faFolderOpen : faFolder}
|
||||||
className={'mr-2'} />{category} {categoryCount && ({ categoryCount })}
|
className={'mr-2'} />{category} {categoryCount && (categoryCount)}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
Reference in New Issue
Block a user