diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4f4c0ba..159e5f4 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -17894,7 +17894,7 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=14.17" + "node": ">=4.2.0" } }, "node_modules/unbox-primitive": { diff --git a/frontend/src/components/buttons/LogOutButton.jsx b/frontend/src/components/buttons/LogOutButton.jsx new file mode 100644 index 0000000..2e663d7 --- /dev/null +++ b/frontend/src/components/buttons/LogOutButton.jsx @@ -0,0 +1,15 @@ +import React from 'react'; + +export default function LogOutButton({ onClick }) { + return ( + + ); +} diff --git a/frontend/src/components/cards/ProfilePopUpCard.jsx b/frontend/src/components/cards/ProfilePopUpCard.jsx new file mode 100644 index 0000000..4fdf75b --- /dev/null +++ b/frontend/src/components/cards/ProfilePopUpCard.jsx @@ -0,0 +1,89 @@ +import React from 'react'; +import { useNavigate } from 'react-router'; +import HistoryIcon from '@mui/icons-material/History'; +import PersonIcon from '@mui/icons-material/Person'; +import LogOutButton from '../buttons/LogOutButton'; + +export default function ProfilePopUpCard({ bidderID }) { + const navigate = useNavigate(); + + const handleLogOut = async () => { + try { + localStorage.removeItem('userInfo'); + navigate('/'); + } catch (err) { + // eslint-disable-next-line no-console + console.error( + err.response ? err.response.data.error : 'An unknown error occurred' + ); + } + }; + return ( +
+
+
+
+
+
+
+
+ + Bidder ID: #123456 + + {bidderID} +
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+ ); +} diff --git a/frontend/src/components/navBars/NavBar.jsx b/frontend/src/components/navBars/NavBar.jsx index 963abb9..350d0f0 100644 --- a/frontend/src/components/navBars/NavBar.jsx +++ b/frontend/src/components/navBars/NavBar.jsx @@ -6,6 +6,7 @@ import PersonIcon from '@mui/icons-material/Person'; import PersonOutlinedIcon from '@mui/icons-material/PersonOutlined'; import logo from '../../assets/microvan_logo.svg'; import useAuth from '../../hooks/useAuth'; +import ProfilePopUpCard from '../cards/ProfilePopUpCard'; export default function NavBar() { const [notificationHover, setNotificationHover] = useState(false); @@ -93,6 +94,18 @@ export default function NavBar() { ) : ( )} + {personHover && ( +
+ +
+ )}