Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sign out #158

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions frontend/src/components/Banner.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import FintrackLogo from '../assets/images/FintrackLogo.png';

const Banner = () => {
const handleSignOut = () => {
// Removes the token from localStorage
localStorage.removeItem("token");

// Redirect to the login page
window.location.href = "/login";
};

return (
<div className="bg-primary flex flex-row w-[100%] py-[1%] px-[2%]">
<img src={FintrackLogo} alt="logo" className="w-[15%]" />

<button
className="absolute top-50 right-10 bg-primary-red text-white text-button px-3 py-3 min-w-[200px] rounded-full hover:bg-primary-red-dark active:bg-primary-red-darker"
// User signed out upon clicking button
onClick={handleSignOut}
>
Sign Out
</button>
</div>
);
}
Expand Down