diff --git a/src/pages/shop/section/productList/ProductList.tsx b/src/pages/shop/section/productList/ProductList.tsx index 2701bc7..cc11d31 100644 --- a/src/pages/shop/section/productList/ProductList.tsx +++ b/src/pages/shop/section/productList/ProductList.tsx @@ -53,10 +53,7 @@ const ProductList = () => { activeId={activeId} setActiveId={setActiveId} /> - + ); diff --git a/src/pages/shop/section/productList/components/ListAllProduct.tsx b/src/pages/shop/section/productList/components/ListAllProduct.tsx index 6365cd4..1f0d093 100644 --- a/src/pages/shop/section/productList/components/ListAllProduct.tsx +++ b/src/pages/shop/section/productList/components/ListAllProduct.tsx @@ -9,25 +9,11 @@ import { RootState } from "../../../../../redux/store"; import { useNavigate } from "react-router-dom"; import toast from "react-hot-toast"; -interface Category { - id: number | string; - label?: string; -} - -const ListAllProduct = ({ - activeId, - categories, -}: { - activeId: number; - categories?: Category[]; -}) => { +const ListAllProduct = ({ activeId }: { activeId: number }) => { const axios = useAxios(); const [selectedConfigId, setSelectedConfigId] = useState(null); const { token } = useSelector((state: RootState) => state.token); const navigate = useNavigate(); - const isDnsCategory = - categories?.find((category) => Number(category.id) === activeId)?.label?.toLowerCase() === - "dns"; const { data, error, isLoading, isFetching } = useQuery({ queryKey: ["configs", activeId], queryFn: () => { @@ -84,7 +70,6 @@ const ListAllProduct = ({ isOpen={selectedConfigId !== null} setIsOpen={(open) => { if (!open) setSelectedConfigId(null); }} configId={selectedConfigId} - isDns={isDnsCategory} /> )}
{ +const ModalBuy = ({ isOpen, setIsOpen, configId }: ModalBuyProps) => { const axios = useAxios(); const dispatch = useDispatch(); const navigate = useNavigate(); @@ -54,6 +54,10 @@ const ModalBuy = ({ isOpen, setIsOpen, configId, isDns }: ModalBuyProps) => { ); const advancedVerificationMessage = buildAdvancedVerificationMessage(advancedVerificationLimit); + const hasExtraDescription = Boolean( + data?.data?.result?.has_extra_description + ); + const extraDescription = data?.data?.result?.extra_description ?? ""; const advancedVerificationFromApi = data?.data?.result?.requires_advanced_verification; const hasAdvancedVerificationApiFlag = @@ -239,7 +243,11 @@ const ModalBuy = ({ isOpen, setIsOpen, configId, isDns }: ModalBuyProps) => { return ( <> - + {
) : (
- {isDns && ( + {hasExtraDescription && (