diff --git a/package-lock.json b/package-lock.json index e0dbbb9..a73add6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@fortawesome/fontawesome-svg-core": "^6.6.0", "@fortawesome/free-solid-svg-icons": "^6.6.0", "@fortawesome/react-fontawesome": "^0.2.2", - "@headlessui/react": "^2.1.9", + "@headlessui/react": "^2.1.10", "@heroicons/react": "^2.1.5", "@mui/icons-material": "^6.1.2", "@react-spring/web": "^9.7.5", @@ -1185,9 +1185,9 @@ } }, "node_modules/@headlessui/react": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-2.1.9.tgz", - "integrity": "sha512-ckWw7vlKtnoa1fL2X0fx1a3t/Li9MIKDVXn3SgG65YlxvDAsNrY39PPCxVM7sQRA7go2fJsuHSSauKFNaJHH7A==", + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-2.1.10.tgz", + "integrity": "sha512-6mLa2fjMDAFQi+/R10B+zU3edsUk/MDtENB2zHho0lqKU1uzhAfJLUduWds4nCo8wbl3vULtC5rJfZAQ1yqIng==", "license": "MIT", "dependencies": { "@floating-ui/react": "^0.26.16", diff --git a/package.json b/package.json index d5094fa..26f701f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@fortawesome/fontawesome-svg-core": "^6.6.0", "@fortawesome/free-solid-svg-icons": "^6.6.0", "@fortawesome/react-fontawesome": "^0.2.2", - "@headlessui/react": "^2.1.9", + "@headlessui/react": "^2.1.10", "@heroicons/react": "^2.1.5", "@mui/icons-material": "^6.1.2", "@react-spring/web": "^9.7.5", diff --git a/src/appLayout/MainNavigation.css b/src/appLayout/MainNavigation.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/appLayout/MainNavigation.jsx b/src/appLayout/MainNavigation.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/src/appLayout/Navbar.jsx b/src/appLayout/Navbar.jsx new file mode 100644 index 0000000..1dccb6d --- /dev/null +++ b/src/appLayout/Navbar.jsx @@ -0,0 +1,57 @@ +import { Bars3Icon, BellIcon, ChevronDownIcon } from "@heroicons/react/24/outline"; +import { Link } from "react-router-dom"; +import { Menu } from "@headlessui/react"; // Import from Headless UI +import logo from "../assets/logo.png"; +import profile from "../assets/profile.png"; + +const Navbar = ({ onSidebarToggle }) => { + const userNavigation = [ + { name: "Profile", href: "#" }, + { name: "Settings", href: "#" }, + { name: "Log out", href: "/login" }, + ]; + + return ( +
+
+
+ + Logo +
+
+ + +
+ + Profile + + +
+ + {userNavigation.map((item) => ( + + {({ active }) => ( + + {item.name} + + )} + + ))} + +
+
+
+
+ ); +}; + +export default Navbar; diff --git a/src/appLayout/Sidebar.jsx b/src/appLayout/Sidebar.jsx new file mode 100644 index 0000000..b5ad048 --- /dev/null +++ b/src/appLayout/Sidebar.jsx @@ -0,0 +1,58 @@ +// // Sidebar.jsx +// import { Link } from "react-router-dom"; +// import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/outline"; +// import { useState } from "react"; +// import logo from "../assets/logo.png"; +// import { navigation } from "../pages/navigationData"; // Externalized navigation data + +// const Sidebar = ({ isOpen }) => { +// const [openDropdown, setOpenDropdown] = useState(null); + +// const toggleDropdown = (name) => { +// setOpenDropdown(openDropdown === name ? null : name); +// }; + +// return ( +//
+//
+//
+// Logo +//
+// +//
+//
+// ); +// }; + +// export default Sidebar; diff --git a/src/pages/ActivityTab.jsx b/src/pages/ActivityTab.jsx index e01dd68..64888f4 100644 --- a/src/pages/ActivityTab.jsx +++ b/src/pages/ActivityTab.jsx @@ -23,6 +23,9 @@ const ActivityTab = () => { const [newStatus, setNewStatus] = useState('All'); const [filteredActivity, setFilteredActivity] = useState(activityData); + const [isAddingComment, setIsAddingComment] = useState(false); // To control comment section display + const [newComment, setNewComment] = useState(''); // To store the new comment + // Function to filter activities based on search criteria const handleSearch = () => { const filtered = activityData.filter((activity) => { @@ -35,8 +38,21 @@ const ActivityTab = () => { setFilteredActivity(filtered); }; + // Function to handle the new comment submission + const handleAddComment = () => { + const newActivity = { + date: new Date().toLocaleString(), + actionBy: 'User', // Example: Comment will be added by the user + status: 'COMMENT ADDED', + message: newComment + }; + setFilteredActivity([newActivity, ...filteredActivity]); + setNewComment(''); + setIsAddingComment(false); // Hide the comment section after submission + }; + return ( -
+
{/* Search Section */}
@@ -80,7 +96,6 @@ const ActivityTab = () => {
-
- + {/* Add Comment Section */}
-

View Rule Breakdown

- +

View Rule Breakdown

+ {!isAddingComment ? ( + + ) : ( +
+