Skip to content

Commit

Permalink
fix: if product is not found in ProductDetails page navigate the user…
Browse files Browse the repository at this point in the history
… to not found page temporarily
  • Loading branch information
Moamal-2000 committed Dec 2, 2024
1 parent 42a32e5 commit 9566d35
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useRef } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Navigate } from "react-router-dom";
import { updateProductsState } from "src/Features/productsSlice";
import useOnlineStatus from "src/Hooks/Helper/useOnlineStatus";
import SkeletonProductDetails from "../../Shared/SkeletonLoaders/DetailsPage/SkeletonProductDetails";
Expand All @@ -12,6 +13,8 @@ import ProductFirstInfos from "./ProductFirstInfos/ProductFirstInfos";
import ProductSizes from "./ProductSizes/ProductSizes";

const ProductDetails = ({ productData }) => {
if (!productData) return <Navigate to="product-not-found" />;

const { loadingProductDetails } = useSelector((state) => state.loading);
const { previewImg, isZoomInPreviewActive } = useSelector(
(state) => state.global
Expand Down

0 comments on commit 9566d35

Please sign in to comment.