From a21adacab17e72539f6d08a20e32b30887c95b59 Mon Sep 17 00:00:00 2001 From: jurenroy Date: Mon, 27 Feb 2023 12:44:15 +0800 Subject: [PATCH] naa ra diay HAHAHAHA --- src/components/Sidebar/Sidebar.tsx | 7 ------- src/routes/Products/Products.tsx | 7 +++---- 2 files changed, 3 insertions(+), 11 deletions(-) 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

- + ); }