From 6938414cb17058ef490ad3f489f7442493d3f620 Mon Sep 17 00:00:00 2001 From: Nathan Kluth Date: Tue, 5 Dec 2023 08:40:47 -0700 Subject: [PATCH] shared var --- packages/nextjs/app/migration/products/[slug].tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nextjs/app/migration/products/[slug].tsx b/packages/nextjs/app/migration/products/[slug].tsx index 7e51584..389c7bd 100644 --- a/packages/nextjs/app/migration/products/[slug].tsx +++ b/packages/nextjs/app/migration/products/[slug].tsx @@ -27,9 +27,10 @@ interface PageProps { const ProductPage: NextPage = ({ data }) => { const query = useSearchParams(); const product = data?.product; + const variant = query?.get("variant"); const selectedVariant = - (product?.variants || []).find((v) => v?.slug && v.slug === query?.get("variant")) || product?.variants?.[0]; + (product?.variants || []).find((v) => v?.slug && v.slug === variant) || product?.variants?.[0]; return ( @@ -39,7 +40,7 @@ const ProductPage: NextPage = ({ data }) => {
- +