Skip to content

Commit

Permalink
fixed profile dropdown position and styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ozerodb committed Jan 3, 2024
1 parent 0478baa commit 0b5ded9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
21 changes: 21 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Generic styling */
:root {
--hkblue: #061e33;
--hkwhite: #ffffff;
Expand All @@ -11,3 +12,23 @@ body {
a {
color: var(--hkwhite);
}

/* Profile dropdown on HKNavbar */
#profile-nav-dropdown .dropdown-menu {
position: absolute;
right: 0;
left: auto;
padding: 0.5rem 1rem;
margin-top: 0.5rem;
background-color: rgba(6, 30, 51, 0.7);
backdrop-filter: blur(4px);
border: 1px solid white;
}

#profile-nav-dropdown .dropdown-menu .dropdown-item-text {
color: var(--hkwhite);
}

#profile-nav-dropdown .dropdown-menu .dropdown-divider {
border-top: 1px solid white;
}
9 changes: 5 additions & 4 deletions frontend/src/components/HKNavbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ const HKNavbar = () => {
) : !isAuthenticated ? (
<LoginButton />
) : (
<>
<div id="profile-nav-dropdown">
<NavDropdown
title={
<Image
<Image className="me-2 border"
fluid
alt="Picture"
src={user.picture}
Expand All @@ -57,12 +57,13 @@ const HKNavbar = () => {
roundedCircle
/>
}

>
<NavDropdown.ItemText>{user.name}</NavDropdown.ItemText>
<NavDropdown.ItemText>{user.name ? user.name : user.email}</NavDropdown.ItemText>
<NavDropdown.Divider />
<LogoutButton />
</NavDropdown>
</>
</div>
)}
</Col>
</Navbar>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/LogoutButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const LogoutButton = () => {
});
};

return <Button onClick={handleLogout}>Log Out</Button>;
return <Button variant="outline-light" onClick={handleLogout}>Log Out</Button>;
};

export default LogoutButton;

0 comments on commit 0b5ded9

Please sign in to comment.