From f7499571c353aefce2cff380b80a18c61f4a1a16 Mon Sep 17 00:00:00 2001 From: LanesGood Date: Fri, 26 Jul 2024 12:51:52 -0400 Subject: [PATCH] Update page body layout, hero responsiveness --- src/components/footer.js | 4 +-- src/components/hero.js | 40 ++++++++++++++++++------------ src/components/layout/page-body.js | 26 +++++++++---------- src/components/typeahead-box.js | 5 +++- 4 files changed, 41 insertions(+), 34 deletions(-) diff --git a/src/components/footer.js b/src/components/footer.js index a9e2a68c5..9144bc26d 100644 --- a/src/components/footer.js +++ b/src/components/footer.js @@ -55,8 +55,7 @@ const Headline = styled.p` } ` -const Footer = ({ shortname, isMediumDown }) => { - console.log(isMediumDown) +const Footer = ({ shortname }) => { return ( @@ -233,7 +232,6 @@ const Footer = ({ shortname, isMediumDown }) => { Footer.propTypes = { shortname: PropTypes.string.isRequired, - isMediumDown: PropTypes.bool, } export default Footer diff --git a/src/components/hero.js b/src/components/hero.js index 89a13cb25..e0fa9bd57 100644 --- a/src/components/hero.js +++ b/src/components/hero.js @@ -5,7 +5,7 @@ import styled from "styled-components" import { StaticImage } from "gatsby-plugin-image" import { NEGATIVE, POSITIVE } from "../utils/constants" -import { colors, layout } from "../theme" +import { colors, layout, breakpoints } from "../theme" import DateList from "./date-list-hover" import { ArrowIcon } from "../icons" import { TypeAhead } from "../components/typeahead-box" @@ -75,7 +75,26 @@ const Container = styled.section` }%, rgba(12,21,32, 0.0)${ratioInPercent + 20}%)` : null}; ` +const HeroContentWrapper = styled.div` + grid-area: 1 / 2 / 1 / 2; + display: grid; + grid-template-columns: ${({ textToImageRatio }) => + textToImageRatio && `${textToImageRatio[0]}fr ${textToImageRatio[1]}fr`}; + grid-template-areas: + "title image" + "extras image"; + grid-gap: 0.5rem; + padding: 0 ${layout.smallPageMargin}; + @media screen and (min-width: ${breakpoints["sm"]}) { + padding: 0 ${layout.pageMargin}; + } +` +const HeroTitle = styled.h1` + @media screen and (max-width: ${breakpoints["sm"]}) { + font-size: 2.875rem; + } +` export default function Hero({ backlink, tagline, @@ -117,19 +136,7 @@ export default function Hero({ backgroundImage={backgroundImage} ratioInPercent={ratioInPercent} > -
+
)} -

{title}

+ {title}
@@ -211,7 +219,7 @@ export default function Hero({ {image}
)} -
+ {backgroundImage && (
- {children} -
- ) + return {children} } PageBody.propTypes = { diff --git a/src/components/typeahead-box.js b/src/components/typeahead-box.js index 18be97e81..e2b3d7f7e 100644 --- a/src/components/typeahead-box.js +++ b/src/components/typeahead-box.js @@ -111,7 +111,10 @@ export function TypeAhead() { align-items: center; cursor: pointer; width: 100%; - min-width: 24rem; + min-width: 80vw; + @media screen and (min-width: 800px) { + min-width: 24rem; + } `} >