Commit 379eb4cb authored by Lê Bảo Hồng Đức's avatar Lê Bảo Hồng Đức

fix

parent 57edd123
......@@ -10,6 +10,7 @@ import ImageNext from "@/components/shared/image-next";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import ListCategory from "@/components/base/list-category";
import EventsCalendar from "@/app/(main)/(home)/components/events-calendar";
import {
buildDynamicPostHref,
buildDynamicCategoryMenu,
......@@ -63,6 +64,15 @@ export default function ArticlePage({ category, allCategories }: ArticlePageProp
const pageSize = 10;
const keyword = submitSearch.trim();
// Auto-search with debounce
useEffect(() => {
const timer = setTimeout(() => {
setSubmitSearch(searchInput);
setPage(1);
}, 500);
return () => clearTimeout(timer);
}, [searchInput]);
useEffect(() => {
const params = new URLSearchParams(searchParamsString);
if (page > 1) {
......@@ -202,7 +212,7 @@ export default function ArticlePage({ category, allCategories }: ArticlePageProp
<aside className="contents xl:order-2 xl:block xl:w-[320px] xl:space-y-5 xl:pt-0">
<form
className="order-1 rounded-[22px] border border-[#edf1f5] bg-white p-5 shadow-[0_14px_34px_rgba(17,24,39,0.05)] xl:order-none"
className="order-1 rounded-[22px] border border-[#edf1f5] bg-white p-5 shadow-[0_14px_34px_rgba(17,24,39,0.05)] xl:order-0"
onSubmit={(event) => {
event.preventDefault();
setPage(1);
......@@ -238,7 +248,9 @@ export default function ArticlePage({ category, allCategories }: ArticlePageProp
</div>
</form>
<div className="order-3 overflow-hidden rounded-[22px] shadow-[0_18px_42px_rgba(17,24,39,0.12)] xl:order-none">
<EventsCalendar compact className="xl:w-full xl:min-w-0" />
<div className="order-3 overflow-hidden rounded-[22px] shadow-[0_18px_42px_rgba(17,24,39,0.12)] xl:order-0">
<div className="relative min-h-[390px] bg-[#1f334f]">
<ImageNext
src="/banner.webp"
......
......@@ -10,6 +10,7 @@ import ImageNext from "@/components/shared/image-next";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import ListCategory from "@/components/base/list-category";
import EventsCalendar from "@/app/(main)/(home)/components/events-calendar";
import {
buildDynamicPostHref,
buildDynamicCategoryMenu,
......@@ -37,6 +38,15 @@ export default function CatalogPage({ category, allCategories }: CatalogPageProp
const pageSize = 8;
const keyword = submitSearch.trim();
// Auto-search with debounce
useEffect(() => {
const timer = setTimeout(() => {
setSubmitSearch(searchInput);
setPage(1);
}, 500);
return () => clearTimeout(timer);
}, [searchInput]);
useEffect(() => {
const params = new URLSearchParams(searchParamsString);
if (page > 1) {
......@@ -140,7 +150,7 @@ export default function CatalogPage({ category, allCategories }: CatalogPageProp
<aside className="contents xl:order-2 xl:block xl:w-[320px] xl:space-y-5 xl:pt-0">
<form
className="order-1 rounded-[22px] border border-[#edf1f5] bg-white p-5 shadow-[0_14px_34px_rgba(17,24,39,0.05)] xl:order-none"
className="order-1 rounded-[22px] border border-[#edf1f5] bg-white p-5 shadow-[0_14px_34px_rgba(17,24,39,0.05)] xl:order-0"
onSubmit={(event) => {
event.preventDefault();
setPage(1);
......@@ -176,6 +186,8 @@ export default function CatalogPage({ category, allCategories }: CatalogPageProp
</div>
</form>
<EventsCalendar compact className="xl:w-full xl:min-w-0" />
<div className="order-3 overflow-hidden rounded-[22px] shadow-[0_18px_42px_rgba(17,24,39,0.12)] xl:order-0">
<div className="relative min-h-[390px] bg-[#1f334f]">
<ImageNext
......
......@@ -7,7 +7,7 @@ import {
ABOUT_VCCI_HCM_SLUG,
AboutVcciHcmPage,
DefaultInformationPage,
LEGAL_TRADE_PAGE_SLUG,
LEGAL_TRADE_PAGE_SLUGS,
LegalTradePages,
MARKET_PROFILE_PAGE_SLUG,
MarketProfilePage,
......@@ -32,6 +32,7 @@ const LEGAL_TRADE_CHILD_SLUGS = new Set([
"bieu-mau-co-va-cach-khai",
"phi-va-le-phi-cap-co",
"diem-cap-va-thoi-gian-cap-co",
"diem-cap-va-thoi-gian-cap-gcn-va-xac-nhan-cttm",
"thong-tin-lien-he-co",
]);
......@@ -77,15 +78,16 @@ function resolveInformationVariant(post: DynamicPostItem, category: DynamicCateg
}
if (
category.slug === LEGAL_TRADE_PAGE_SLUG ||
LEGAL_TRADE_PAGE_SLUGS.has(category.slug) ||
category.parent_id === LEGAL_TRADE_CATEGORY_ID ||
LEGAL_TRADE_CHILD_SLUGS.has(category.slug) ||
post.slug === LEGAL_TRADE_PAGE_SLUG ||
LEGAL_TRADE_PAGE_SLUGS.has(post.slug) ||
LEGAL_TRADE_CHILD_SLUGS.has(post.slug) ||
post.categories.some((item) => item.id === LEGAL_TRADE_CATEGORY_ID) ||
post.categories.some(
(item) =>
item.url === "/phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai" ||
item.url === "/phap-che-va-cttm" ||
item.url.startsWith("/xuat-xu-hang-hoa/"),
)
) {
......
......@@ -162,7 +162,7 @@ export default function MemberBenefitsPage() {
<p className="mt-1">
P. 306, Lầu 3, Tòa nhà VCCI, 171 Võ Thị Sáu,
<br />
Quận 3, TP. Hồ Chí Minh
Phường Xuân Hoà, TP. HCM
</p>
</div>
</div>
......
......@@ -47,7 +47,7 @@ const SERVICE_SUPPORT_ITEMS = [
},
{
key: "certificate",
title: "Xác nhận các chứng từ thương mại (Bỏ cấp C/O)",
title: "Xác nhận các chứng từ thương mại",
icon: FileBadge2,
},
{
......
......@@ -3,5 +3,7 @@ export const SERVICE_PAGE_SLUG = "dich-vu-cung-cap";
export const MEMBER_BENEFITS_PAGE_SLUG = "loi-ich-hoi-vien-vcci";
export const MEMBER_REGISTRATION_PAGE_SLUG = "dang-ky-hoi-vien";
export const MARKET_PROFILE_PAGE_SLUG = "ho-so-thi-truong";
export const LEGAL_TRADE_PAGE_SLUG =
"phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai";
export const LEGAL_TRADE_PAGE_SLUGS = new Set([
"phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai",
"phap-che-va-cttm",
]);
......@@ -74,10 +74,15 @@ function resolveVariant(post: DynamicPostItem, category: DynamicCategoryRouteIte
if (
slug === "diem-cap-va-cap-gcn-va-xac-nhan-cttm" ||
slug === "diem-cap-va-thoi-gian-cap-co" ||
slug === "diem-cap-va-thoi-gian-cap-gcn-va-xac-nhan-cttm" ||
externalLink ===
"/phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai/diem-cap-va-cap-gcn-va-xac-nhan-cttm" ||
externalLink ===
"/phap-che-va-xac-nhan-chung-tu-tm/diem-cap-va-thoi-gian-cap-gcn-va-xac-nhan-cttm" ||
url ===
"/phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai/diem-cap-va-cap-gcn-va-xac-nhan-cttm" ||
url ===
"/phap-che-va-xac-nhan-chung-tu-tm/diem-cap-va-thoi-gian-cap-gcn-va-xac-nhan-cttm" ||
url === "/xuat-xu-hang-hoa/diem-cap-va-thoi-gian-cap-co"
) {
return "locations" as const;
......
......@@ -19,7 +19,12 @@ const MenuItem = ({ title, link, items }: MenuItemProps) => {
const normalizedLink = link && link !== '#' ? link : '/'
const hasChildren = items.length > 0
const isRoot = normalizedLink === '/'
const isActive = isRoot ? pathname === '/' : pathname === normalizedLink || pathname.startsWith(normalizedLink)
const isChildActive = items.some((item) => pathname === item.link || pathname.startsWith(item.link))
const isActive = isRoot
? pathname === '/'
: pathname === normalizedLink ||
pathname.startsWith(normalizedLink) ||
isChildActive
const linkId = useMemo(() => `header-trigger-${title}`, [title])
const hoverCardRef = useCallback(
......
......@@ -3,9 +3,9 @@ import type { Category } from "@/api/models/category";
export const categoryFallbackRows: Category[] = [
{
"id": "450bed53-0e17-4f0a-8a02-17fa657ab5b0",
"name": "Điểm cấp và cấp GCN và xác nhận CTTM",
"slug": "diem-cap-va-cap-gcn-va-xac-nhan-cttm",
"url": "/phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai/diem-cap-va-cap-gcn-va-xac-nhan-cttm",
"name": "Điểm cấp và thời gian cấp GCN và xác nhận CTTM",
"slug": "diem-cap-va-thoi-gian-cap-gcn-va-xac-nhan-cttm",
"url": "/phap-che-va-xac-nhan-chung-tu-tm/diem-cap-va-thoi-gian-cap-gcn-va-xac-nhan-cttm",
"created_at": "2026-05-19T07:10:47.564Z",
"created_by": "aff87dea-73a3-4076-b1be-6b0b7b59a21d",
"updated_at": "2026-05-19T07:10:47.564Z",
......@@ -241,9 +241,9 @@ export const categoryFallbackRows: Category[] = [
},
{
"id": "69b4c7e7-28ea-41f2-97f4-988fe702a8a3",
"name": "Pháp chế, cấp giấy chứng nhận và xác nhận chứng từ thương mại",
"slug": "phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai",
"url": "/phap-che-cap-giay-chung-nhan-va-xac-nhan-chung-tu-thuong-mai",
"name": "Pháp chế và CTTM",
"slug": "phap-che-va-cttm",
"url": "/phap-che-va-cttm",
"created_at": "2026-05-14T04:54:26.127Z",
"created_by": null,
"updated_at": "2026-05-15T08:29:25.863Z",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment