Skip to content

Commit dbdd9c9

Browse files
committed
Fix footer formatting on pages that don't fill height
1 parent 7642f84 commit dbdd9c9

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

components/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import FormattedLink from "./FormattedLink"
22

3-
export default function Footer({ location, marginBottom }: { location: string, marginBottom: number }) {
4-
return <footer className="flex flex-col items-center justify-center w-full border-t text-center" style={({ marginBottom: `${marginBottom}px` })}>
3+
export default function Footer({ location, marginBottom }: { location: string, marginBottom?: number }) {
4+
return <footer className="flex flex-col items-center justify-center w-full border-t text-center" style={({ marginBottom: marginBottom && `${marginBottom}px` })}>
55
<div className="flex items-center justify-center">
66
© All rights reserved by miHoYo. Other properties belong to their respective owners.
77
</div>

pages/_app.tsx

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,27 @@ export default function MyApp({ Component, pageProps, router }: AppProps) {
4646
/>}
4747
</Head>
4848

49-
<div className="w-full flex-1">
50-
<div className="absolute z-10">
51-
<CookieConsent
52-
buttonText="Accept all cookies"
53-
declineButtonText="Refuse non-essential cookies"
54-
enableDeclineButton
55-
onAccept={() => {
56-
setConsented(true)
57-
}}
58-
onDecline={() => {
59-
setConsented(false)
60-
}}
61-
>
62-
This website uses cookies to enhance the user experience.
63-
<div style={{ fontSize: "12px" }}>Currently we only use these for analytic purposes, intended to figure out where to focus our efforts.</div>
64-
</CookieConsent>
65-
</div>
66-
49+
<div className="w-full">
6750
<NavBar location={router.asPath} />
6851
<div className="p-4 flex flex-col w-full flex-1 px-1 lg:px-20 items-center justify-center">
6952
<Component {...pageProps} location={router.asPath} />
7053
</div>
71-
72-
<Footer location={router.asPath} marginBottom={consented || consented === null ? 3 : 80} />
7354
</div>
55+
56+
<CookieConsent
57+
buttonText="Accept all cookies"
58+
declineButtonText="Refuse non-essential cookies"
59+
enableDeclineButton
60+
onAccept={() => {
61+
setConsented(true)
62+
}}
63+
onDecline={() => {
64+
setConsented(false)
65+
}}
66+
>
67+
This website uses cookies to enhance the user experience.
68+
<div style={{ fontSize: "12px" }}>Currently we only use these for analytic purposes, intended to figure out where to focus our efforts.</div>
69+
</CookieConsent>
70+
<Footer location={router.asPath} marginBottom={consented || consented === null ? 3 : 80} />
7471
</div>
7572
}

0 commit comments

Comments
 (0)