Skip to content

Commit

Permalink
Merge pull request #2605 from andrewbaldwin44/feature/static-footer
Browse files Browse the repository at this point in the history
Modern UI: Change Footer to Static Positioning
  • Loading branch information
cyberw committed Feb 15, 2024
2 parents 648bec8 + 714d4c4 commit a0a3700
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locust/webui/dist/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="/assets/index-fcdc76c8.js"></script>
<script type="module" crossorigin src="/assets/index-af38c28c.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="/assets/index-fcdc76c8.js"></script>
<script type="module" crossorigin src="/assets/index-af38c28c.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
18 changes: 12 additions & 6 deletions locust/webui/src/components/Layout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { Box, Container } from '@mui/material';
import { Container } from '@mui/material';

import About from 'components/Layout/Footer/About';

export default function Footer() {
return (
<Box component='nav' sx={{ position: 'fixed', bottom: 0, width: '100%' }}>
<Container maxWidth='xl' sx={{ display: 'flex', justifyContent: 'flex-end' }}>
<About />
</Container>
</Box>
<Container
maxWidth='xl'
sx={{
display: 'flex',
height: 'var(--footer-height)',
alignItems: 'center',
justifyContent: 'flex-end',
}}
>
<About />
</Container>
);
}
7 changes: 5 additions & 2 deletions locust/webui/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ReactNode } from 'react';
import { Box } from '@mui/material';

import Footer from 'components/Layout/Footer/Footer';
import Navbar from 'components/Layout/Navbar/Navbar';
Expand All @@ -10,8 +11,10 @@ interface ILayout {
export default function Layout({ children }: ILayout) {
return (
<>
<Navbar />
<main>{children}</main>
<Box sx={{ minHeight: 'calc(100vh - var(--footer-height))' }}>
<Navbar />
<main>{children}</main>
</Box>
<Footer />
</>
);
Expand Down
9 changes: 9 additions & 0 deletions locust/webui/src/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ const createTheme = (mode: PaletteMode) =>
main: '#00C853',
},
},
components: {
MuiCssBaseline: {
styleOverrides: {
':root': {
'--footer-height': '40px',
},
},
},
},
});

export default createTheme;

0 comments on commit a0a3700

Please sign in to comment.