diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index c38c8bc..167dcec 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -46,13 +46,6 @@ export default function Sidebar() { - navigate("/Products/AddProduct")} - name="Add Product" - > - - - navigate("/Inventory")} name="Inventory" diff --git a/src/routes/Products/Products.tsx b/src/routes/Products/Products.tsx index 8db92ee..a3c1d07 100644 --- a/src/routes/Products/Products.tsx +++ b/src/routes/Products/Products.tsx @@ -1,13 +1,12 @@ import React from "react"; import styles from "../../styles"; +import { useNavigate } from "react-router-dom"; import ProductsIcon from "../../Components/Icons/ProductsIcon/ProductsIcon"; import ProductInfo from "../../Components/ProductInfo/ProductInfo"; import ProductsLists from "../../Components/ProductsLists/ProductsLists"; export default function Products() { - const handleAddProduct = () => { - window.location.href = "/Products/AddProduct"; - }; + const navigate = useNavigate(); return (
@@ -16,7 +15,7 @@ export default function Products() {

Products

- + ); }