Skip to content

Commit

Permalink
Update Header.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kasundie30 committed Oct 21, 2024
1 parent 7d3bb82 commit b4b940c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
7 changes: 1 addition & 6 deletions front-end/src/Pages/Deliverables.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/Pages/Downloads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const FileUploadDownload = () => {
</div>
<div className="inputbox">
<label>Name</label>
<input type="text" placeholder="Enter a Display Name" value={displayName} onChange={handleDisplayNameChange} className = "field"/>
<input type="text" placeholder="Enter a Display Name" value={displayName} onChange={handleDisplayNameChange} className = "field" required/>
</div>
<div className="inputbox">
<label>File</label>
Expand Down
16 changes: 0 additions & 16 deletions front-end/src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit b4b940c

Please sign in to comment.