Skip to content

Commit

Permalink
fix(heo): fix heo category selected style
Browse files Browse the repository at this point in the history
  • Loading branch information
real-jacket committed Sep 4, 2023
1 parent e199866 commit 64dbf4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion themes/heo/components/CategoryBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function CategoryBar(props) {
setScrollRight(!scrollRight)
}
}

return <div id='category-bar' className={`flex flex-nowrap justify-between items-center h-12 mb-4 space-x-2 w-full lg:bg-white dark:lg:bg-[#1e1e1e]
${border ? 'lg:border lg:hover:border dark:lg:border-gray-800 hover:border-indigo-600 dark:hover:border-yellow-600 ' : ''} py-2 lg:px-2 rounded-xl transition-colors duration-200`}>

Expand All @@ -54,7 +55,8 @@ export default function CategoryBar(props) {
*/
const MenuItem = ({ href, name }) => {
const router = useRouter()
const selected = router.pathname === href
const { category } = router.query
const selected = category === name
return <div className={`whitespace-nowrap mr-2 duration-200 transition-all font-bold px-2 py-0.5 rounded-md text-gray-900 dark:text-white hover:text-white hover:bg-indigo-600 dark:hover:bg-yellow-600 ${selected ? 'text-white bg-indigo-600 dark:bg-yellow-600' : ''}`}>
<Link href={href}>{name}</Link>
</div>
Expand Down

0 comments on commit 64dbf4d

Please sign in to comment.