From da8278ca42594cc2368cff9aff15ea2e05255167 Mon Sep 17 00:00:00 2001 From: suu3 Date: Wed, 24 Jan 2024 16:58:42 +0900 Subject: [PATCH] [fix] active menu --- src/components/@layout/category-menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/@layout/category-menu.tsx b/src/components/@layout/category-menu.tsx index e6ec2ad7..d72b67cf 100644 --- a/src/components/@layout/category-menu.tsx +++ b/src/components/@layout/category-menu.tsx @@ -4,7 +4,7 @@ import { list, active, inactive } from "./category-menu.module.css" import { withPrefix } from "gatsby" const CategoryMenu = ({ categories = {}, pathname = "" }) => { - const [clicked, setClicked] = useState(`/${pathname.split("/")[1]}`) + const [clicked, setClicked] = useState(pathname.split("/page/")[0]) const { totalCount, group } = categories const listClassName = (category: string) => {