Skip to content

Commit

Permalink
Merge pull request #157 from kasundie30/main
Browse files Browse the repository at this point in the history
Update Header.jsx
  • Loading branch information
kasundie30 authored Oct 21, 2024
2 parents 6e2dbf7 + b4b940c commit ead1c13
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 ead1c13

Please sign in to comment.