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 ( +