From 2647646b2e28cf587e009976a7bc9d55fdcdffcc Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Wed, 13 Nov 2024 21:30:41 +0000 Subject: [PATCH] Improve appearance of footer on mobile --- src/components/footer.js | 50 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/components/footer.js b/src/components/footer.js index f957a59a6c6c..14c200cde468 100644 --- a/src/components/footer.js +++ b/src/components/footer.js @@ -2,9 +2,10 @@ import * as React from "react" import { StaticImage } from "gatsby-plugin-image" import styled from "styled-components" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" +import { useMediaQuery } from "react-responsive" +import { device } from "./util/styles/breakpoints" const FooterBar = styled.footer` - height: 64px; background-color: var(--navbar-background-color); color: var(--main-background-color); display: flex; @@ -12,13 +13,18 @@ const FooterBar = styled.footer` justify-content: space-between; align-items: center; font-size: var(--font-size-16); - padding-left: var(--site-margins); - padding-right: var(--site-margins); + padding: calc(0.9 * var(--a-vsmall-space)) var(--site-margins); font-weight: var(--font-weight-normal); + gap: calc(1.5 * var(--a-modest-space)); + + // noinspection CssUnknownProperty + @media ${device.sm} { + flex-direction: column-reverse; + } ` const Spacer = styled.div` - width: 190px; + width: 6rem; ` const Logo = styled(props => )` @@ -28,7 +34,6 @@ const Logo = styled(props => )` align-items: center; justify-content: space-between; font-weight: var(--font-weight-bold); - margin-left: 7px; ` const SponsorInfo = styled.div` background-color: var(--navbar-background-color); @@ -37,29 +42,30 @@ const SponsorInfo = styled.div` flex-direction: row; align-items: center; justify-content: space-between; - font-size: var(--font-size-20); + font-size: var(--font-size-12); font-weight: var(--font-weight-bold); + gap: calc(.8 * var(--a-small-space)); + + // noinspection CssUnknownProperty + @media ${device.sm} { + flex-direction: column; + margin-top: 10px; + + } ` -const LicenseText = styled(props => )` +const LegalText = styled(props => )` margin: 8px; color: var(--navbar-text-color); + text-decoration: underline; - &:visited { - color: var(--navbar-text-color); - text-decoration: underline; - } - - &:link { - color: var(--navbar-text-color); - text-decoration: underline; - } ` const LicenseInfo = styled.div` display: flex; flex-direction: row; align-items: center; + font-size: var(--font-size-12); ` const PaddedIcon = styled(props => )` @@ -69,15 +75,19 @@ const PaddedIcon = styled(props => )` ` const Footer = () => { + const isMobile = useMediaQuery({ query: device.sm }) + return ( - + {isMobile || } - + CC by 3.0 - + + | + Privacy Policy Sponsored by @@ -90,7 +100,7 @@ const Footer = () => { formats={["auto", "webp", "avif"]} src="../images/redhat_reversed.svg" alt="Red Hat logo" - height={36} + height={26} />