Skip to content

Commit

Permalink
Fix issue causing status bar to block app controls
Browse files Browse the repository at this point in the history
Implement navbar-height scss var
  • Loading branch information
SteveMicroNova committed Jan 8, 2025
1 parent 770c469 commit d7bf478
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const App = ({ selectedPage }) => {
return (
<div className="app">
<DisconnectedIcon />
<div style={{ paddingBottom: "56px" }}>
<div className="app-body">
<Page selectedPage={selectedPage} />
</div>
<MenuBar pageNumber={selectedPage} />
Expand Down
4 changes: 4 additions & 0 deletions web/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
height: 100vh;
background-color: green;
}

.app-body {
padding-bottom: general.$navbar-height;
}
1 change: 1 addition & 0 deletions web/src/components/MenuBar/MenuBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
z-index: 1; // The Marquees on player cards appeared above the MenuBar otherwise, the MenuBar needs to be on top of everything always
bottom: 0;
width: 100vw;
height: general.$navbar-height;
@include general.low-shadow-up;
}
1 change: 1 addition & 0 deletions web/src/components/StatusBars/StatusBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function StatusBar(props) {

return(
<Snackbar
className="snackbar"
autoHideDuration={3000}
anchorOrigin={{vertical: "bottom", horizontal: "left"}}
open={open}
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/StatusBars/StatusBars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
--right: translate(5px, 0px);
animation: errorShake 0.5s 1; // Only animate once, reapplying the class will reapply the animation
}

.snackbar {
bottom: calc(general.$navbar-height + 4px); // Used to keep the snackbar above the navbar at the bottom as to not block controls on mobile
}
3 changes: 3 additions & 0 deletions web/src/general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ $select-color-gray: #bdbdbd; // for preset used_last
$mute-color: #dc3545;

$page-header-height: 3rem;
// Used to ensure that fixed-positioned components don't appear on top of the navbar
// This number is the natural height of the navbar when an explicit height is not provided, and was not set to 56px arbitrarily
$navbar-height: 56px;

// fonts
@font-face {
Expand Down

0 comments on commit d7bf478

Please sign in to comment.