summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/ProductDetail.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules/product-detail/components/ProductDetail.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/ProductDetail.tsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx
index bfdf5b43..fad35a7d 100644
--- a/src-migrate/modules/product-detail/components/ProductDetail.tsx
+++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx
@@ -22,6 +22,7 @@ import PriceAction from './PriceAction'
import SimilarBottom from './SimilarBottom'
import SimilarSide from './SimilarSide'
import VariantList from './VariantList'
+import { getAuth } from '~/libs/auth'
import { gtagProductDetail } from '@/core/utils/googleTag'
@@ -34,7 +35,8 @@ const SELF_HOST = process.env.NEXT_PUBLIC_SELF_HOST
const ProductDetail = ({ product }: Props) => {
const { isDesktop, isMobile } = useDevice()
const router = useRouter()
- const { setAskAdminUrl, askAdminUrl, activeVariantId } = useProductDetail()
+ const auth = getAuth()
+ const { setAskAdminUrl, askAdminUrl, activeVariantId, setIsApproval, isApproval } = useProductDetail()
useEffect(() => {
gtagProductDetail(product);
@@ -54,6 +56,12 @@ const ProductDetail = ({ product }: Props) => {
setAskAdminUrl(createdAskUrl)
}, [router.asPath, product.manufacture.name, product.name, setAskAdminUrl])
+ useEffect(() => {
+ if (typeof auth === 'object') {
+ setIsApproval(auth?.feature?.soApproval);
+ }
+ }, []);
+
return (
<>
<div className='md:flex md:flex-wrap'>
@@ -121,7 +129,7 @@ const ProductDetail = ({ product }: Props) => {
)}
<div className='h-4 md:h-10' />
- {!!activeVariantId && <ProductPromoSection productId={activeVariantId} />}
+ {!!activeVariantId && !isApproval && <ProductPromoSection productId={activeVariantId} />}
<div className={style['section-card']}>
<h2 className={style['heading']}>