From b4b940c3e2478cabc91bb7e24968bfde03c64a05 Mon Sep 17 00:00:00 2001 From: Kasundie Hewawasam Date: Mon, 21 Oct 2024 22:29:18 +0530 Subject: [PATCH] Update Header.jsx --- front-end/src/Pages/Deliverables.jsx | 7 +------ front-end/src/Pages/Downloads.jsx | 2 +- front-end/src/components/Header.jsx | 16 ---------------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/front-end/src/Pages/Deliverables.jsx b/front-end/src/Pages/Deliverables.jsx index 518ab60..ed0f8e5 100644 --- a/front-end/src/Pages/Deliverables.jsx +++ b/front-end/src/Pages/Deliverables.jsx @@ -150,12 +150,7 @@ const onDeleteClick = async (deliverableId) => { try { await axios.delete(`http://localhost:8080/deliverable/delete/${deliverableId}`); loadData(); - if (response.status === 200) { - alert('Deliverable deleted successfully'); - loadData(); - } else { - alert('Failed to delete deliverable'); - } + alert('Deliverable deleted successfully'); } catch (error) { console.error("Error deleting deliverable:", error); alert("Failed to delete deliverable!"); diff --git a/front-end/src/Pages/Downloads.jsx b/front-end/src/Pages/Downloads.jsx index 45e366b..bb0b7ae 100644 --- a/front-end/src/Pages/Downloads.jsx +++ b/front-end/src/Pages/Downloads.jsx @@ -197,7 +197,7 @@ const FileUploadDownload = () => {
- +
diff --git a/front-end/src/components/Header.jsx b/front-end/src/components/Header.jsx index 3d89315..d87db15 100644 --- a/front-end/src/components/Header.jsx +++ b/front-end/src/components/Header.jsx @@ -117,22 +117,6 @@ function Header(){ const handleToggle = (checked) => { setIsEditMode(checked); }; - - // // Initialize the state with a function that reads from localStorage - // const [isEditMode, setIsEditMode] = useState(() => { - // const savedEditModeValue = localStorage.getItem('isEditMode'); - // return savedEditModeValue !== null ? JSON.parse(savedEditModeValue) : false; // Default to false if no saved value - // }); - - // // Change the view mode and the edit mode when the switch handle is toggled - // const handleToggle = () => { - - // setIsEditMode(checked => ({ - // isEditMode: !checked.isEditMode})); - // localStorage.setItem('isEditMode', JSON.stringify(isEditMode)); - // console.log(JSON.parse(localStorage.getItem('isEditMode'))); - // }; - // set hamburger menu to close when a link is clicked const handleLinkClick = () => {