Skip to content

Commit

Permalink
fix: footer at bottom of the page (#4153)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng authored Sep 9, 2024
1 parent 299125a commit 638cf34
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 56 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion src/web/components/structure/__tests__/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('Footer tests', () => {
const currentYear = date().year();
const {element} = render(<Footer />);

expect(element).toMatchSnapshot();
expect(element).toHaveTextContent(
'Copyright © 2009-' +
currentYear +
Expand Down
9 changes: 1 addition & 8 deletions src/web/components/structure/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import React from 'react';

import styled from 'styled-components';
Expand All @@ -18,17 +17,11 @@ const Link = styled.a`
`;

const Footer = styled.footer`
position: fixed;
bottom: 0;
right: 0;
left: 0;
padding: 2px;
font-size: 10px;
text-align: right;
text-align: center;
color: ${Theme.mediumGray};
margin-top: 10px;
padding-right: 5px;
z-index: ${Theme.Layers.aboveAll};
`;

const GreenboneFooter = () => {
Expand Down
22 changes: 14 additions & 8 deletions src/web/pages/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const StyledLayout = styled(Layout)`
height: calc(-48px + 100vh);
`;

const Container = styled.div`
flex: 1;
`;

const Page = ({children}) => {
const capabilities = useLoadCapabilities();
const location = useLocation();
Expand All @@ -49,16 +53,18 @@ const Page = ({children}) => {
<StyledLayout flex="row" align={['start', 'stretch']}>
<Menu />
<Main>
<FeedSyncNotification />
<ErrorBoundary
key={location.pathname}
message={_('An error occurred on this page.')}
>
{children}
</ErrorBoundary>
<Container>
<FeedSyncNotification />
<ErrorBoundary
key={location.pathname}
message={_('An error occurred on this page.')}
>
{children}
</ErrorBoundary>
</Container>
<Footer />
</Main>
</StyledLayout>
<Footer />
</CapabilitiesContext.Provider>
);
};
Expand Down

0 comments on commit 638cf34

Please sign in to comment.