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

Added logout button #39

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Classes from "./pages/classes";
import VolunteerSchedule from "./pages/schedule";
import VolunteerProfile from "./pages/volunteerProfile";
import AdminVerify from "./pages/AdminVerify";
import "notyf/notyf.min.css";

function App() {
const [isVolunteer, setIsVolunteer] = useState(false);
Expand Down
30 changes: 27 additions & 3 deletions frontend/src/components/volunteerLayout/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ body {
position: relative;
}

.content-heading {
display: flex;
justify-content: space-between;
align-items: center;
}

.content-title {
flex: 1;
color: var(--primary-blue);
Expand Down Expand Up @@ -60,11 +66,13 @@ body {
padding-left: 20px;
padding-top: 14px;
padding-bottom: 14px;
position: relative; /* Required for positioning the vertical line */
position: relative;
/* Required for positioning the vertical line */
}

.nav-item.active::before {
content: ""; /* Creates the line */
content: "";
/* Creates the line */
position: absolute;
left: 0;
top: 50%;
Expand All @@ -89,7 +97,8 @@ body {

.navbar.collapsed {
padding-top: 15px;
width: 70px; /* Adjust width as needed */
width: 70px;
/* Adjust width as needed */
}

.nav-profile-card-container {
Expand All @@ -99,3 +108,18 @@ body {
justify-content: flex-end;
margin-bottom: 1rem;
}

.logout-button {
height: fit-content;
padding: 0.6vw 0.85vw;
background-color: var(--white);
border: 1px solid var(--primary-blue);
border-radius: 8px;
box-shadow: 0px 4px 16px #0f111105;
cursor: pointer;
font-family: var(--font-primary);
}

.logout-button i {
color: var(--dark-grey);
}
12 changes: 11 additions & 1 deletion frontend/src/components/volunteerLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,17 @@ function VolunteerLayout({ pageTitle, children, pageStyle }) {
</div>
</aside>
<main className="content-container" style={pageStyle}>
<h2 className="content-title">{pageTitle}</h2>
<div className="content-heading">
<h2 className="content-title">{pageTitle}</h2>
{pageTitle === "My Profile" && (
<button className="logout-button" onClick={() => {
localStorage.removeItem("neuronAuthToken");
window.location.href = "/auth/login";
}}>
<i className="fa-solid fa-arrow-right-from-bracket"></i>&nbsp;&nbsp;Log Out
</button>
)}
</div>
{children} {/* Render page content here */}
</main>
</div>
Expand Down