From 554002854ca09bfa381e49f45d0b7db48ec6817b Mon Sep 17 00:00:00 2001 From: Julian Reinhardt Date: Tue, 26 Oct 2021 22:02:01 +0200 Subject: [PATCH] Fixes footer overlapping with content --- frontend/src/components/Footer.tsx | 174 +++++++++++------------- frontend/src/components/SiteWrapper.tsx | 116 +++++++++------- 2 files changed, 145 insertions(+), 145 deletions(-) diff --git a/frontend/src/components/Footer.tsx b/frontend/src/components/Footer.tsx index b49b00f9..5ef645c1 100644 --- a/frontend/src/components/Footer.tsx +++ b/frontend/src/components/Footer.tsx @@ -2,107 +2,89 @@ import React from "react"; import { useHealthState } from "context"; import { intl } from "locale"; -import styled from "styled-components"; -const FixedFooterWrapper = styled.div` - position: fixed; - bottom: 0; - width: 100%; -`; - -interface Props { - fixed?: boolean; -} -function Footer({ fixed }: Props) { +function Footer() { const { health } = useHealthState(); - const wrapped = () => { - return ( - ); } diff --git a/frontend/src/components/SiteWrapper.tsx b/frontend/src/components/SiteWrapper.tsx index 0132cb0f..16e4fcbd 100644 --- a/frontend/src/components/SiteWrapper.tsx +++ b/frontend/src/components/SiteWrapper.tsx @@ -9,10 +9,24 @@ import styled from "styled-components"; import { NavMenu } from "./NavMenu"; -const StyledContainer = styled.div` +const StyledSiteContainer = styled.div` + display: flex; + flex-direction: column; + height: 100vh; +`; + +const StyledScrollContainer = styled.div` + flex: 1 0 auto; + overflow: auto; +`; + +const StyledContentContainer = styled.div` padding-bottom: 30px; `; +const StyledFooterContainer = styled.div` + flex-shrink: 0; +`; interface Props { children?: ReactNode; } @@ -21,55 +35,59 @@ function SiteWrapper({ children }: Props) { const { logout } = useAuthState(); return ( -
- - } - avatar={} - profileName={user.nickname} - profileSubName={ - user.roles.includes("admin") - ? intl.formatMessage({ - id: "users.admin", - defaultMessage: "Administrator", - }) - : intl.formatMessage({ - id: "users.standard", - defaultMessage: "Standard User", - }) - } - buttons={[]} - profileItems={[ - - {intl.formatMessage({ - id: "profile.title", - defaultMessage: "Profile settings", - })} - , - , - - {intl.formatMessage({ - id: "profile.logout", - defaultMessage: "Logout", - })} - , - ]} - /> - -
-
- {children} + + + + } + avatar={} + profileName={user.nickname} + profileSubName={ + user.roles.includes("admin") + ? intl.formatMessage({ + id: "users.admin", + defaultMessage: "Administrator", + }) + : intl.formatMessage({ + id: "users.standard", + defaultMessage: "Standard User", + }) + } + buttons={[]} + profileItems={[ + + {intl.formatMessage({ + id: "profile.title", + defaultMessage: "Profile settings", + })} + , + , + + {intl.formatMessage({ + id: "profile.logout", + defaultMessage: "Logout", + })} + , + ]} + /> + +
+
+ {children} +
-
-
-
+ + +