Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 23, 2024
2 parents d2b529f + ccf861b commit fc6c418
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions themes/next/components/CategoryGroup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { siteConfig } from '@/lib/config'
import Link from 'next/link'

const CategoryGroup = ({ currentCategory, categories }) => {
if (!categories) return <></>
if (!categories || categories.length === 0) return <></>
const categoryCount = siteConfig('PREVIEW_CATEGORY_COUNT')
const categoryOptions = categories.slice(0, categoryCount)
return <>
<div id='category-list' className='dark:border-gray-600 flex flex-wrap'>
{categories.map(category => {
{categoryOptions.map(category => {
const selected = currentCategory === category.name
return (
<Link
Expand Down
8 changes: 6 additions & 2 deletions themes/next/components/TagGroups.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { siteConfig } from '@/lib/config'
import TagItemMini from './TagItemMini'

/**
Expand All @@ -8,11 +9,14 @@ import TagItemMini from './TagItemMini'
* @constructor
*/
const TagGroups = ({ tags, currentTag }) => {
if (!tags) return <></>
if (!tags || tags.length === 0) return <></>

const tagsCount = siteConfig('PREVIEW_TAG_COUNT')
const tagOptions = tags.slice(0, tagsCount)
return (
<div id='tags-group' className='dark:border-gray-600 w-66 space-y-2'>
{
tags.map(tag => {
tagOptions.map(tag => {
const selected = tag.name === currentTag
return <TagItemMini key={tag.name} tag={tag} selected={selected} />
})
Expand Down

1 comment on commit fc6c418

@vercel
Copy link

@vercel vercel bot commented on fc6c418 Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.