diff --git a/src/components/grid.js b/src/components/grid.js new file mode 100644 index 0000000..d946b5d --- /dev/null +++ b/src/components/grid.js @@ -0,0 +1,34 @@ +import React from "react"; +import styled from "@emotion/styled"; +import { css } from "@emotion/react"; + +const Container = styled.div` + display: grid; + gap: var(--spacing-x-sm) var(--spacing-y-sm); + ${props => + props.columns && + props.columns.map((column, i) => + i === 0 && column > 1 + ? css` + grid-template-columns: repeat(${column}, minmax(10px, 1fr)); + ` + : css` + @media (min-width: ${props.breakpoints[i - 1]}) { + grid-template-columns: repeat(${column}, minmax(10px, 1fr)); + ${ + i === 1 && + css` + gap: var(--spacing-x-md) var(--spacing-y-md); + ` + } +` + )} +`; + +export default function Grid({ columns, breakpoints = ["30em"], children }) { + return ( + + {children} + + ); +} diff --git a/src/components/index.js b/src/components/index.js index 508cd42..db482c7 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -3,6 +3,7 @@ export { default as Card } from "./card"; export { default as Content } from "./content"; export { default as CustomSlick } from "./custom-slick"; export { default as Footer } from "./footer"; +export { default as Grid } from "./grid"; export { default as HeaderLogo } from "./header-logo"; export { default as Header } from "./header"; export { default as Heading } from "./heading"; diff --git a/src/components/section.js b/src/components/section.js index 9ca8711..1e3a2ec 100644 --- a/src/components/section.js +++ b/src/components/section.js @@ -1,6 +1,5 @@ import React from "react"; import styled from "@emotion/styled"; -import { css } from "@emotion/react"; import { Heading } from "."; const Container = styled.div` @@ -23,27 +22,11 @@ const Head = styled.div` text-align: center; `; -const Body = styled.div` - ${props => - props.grid > 0 && - css` - display: grid; - gap: var(--spacing-x-sm) 0; - - @media (min-width: ${props.breakpoint}) { - grid-template-columns: repeat(${props.grid}, 1fr); - gap: var(--spacing-x-md); - } - `} -`; - export default function Section({ heading, headingElement = "h2", children, - variant, - grid, - breakpoint = "30em" + variant }) { return ( @@ -53,9 +36,7 @@ export default function Section({ {heading} )} - - {children} - + {children} ); diff --git a/src/pages/contact.js b/src/pages/contact.js index a8fc774..0247d7e 100644 --- a/src/pages/contact.js +++ b/src/pages/contact.js @@ -4,6 +4,7 @@ import { Marker } from "google-maps-react"; import Layout from "../layout"; import { Button, + Grid, Header, Icon, IconWithContent, @@ -56,83 +57,85 @@ export default function Index({ data }) { >

Get in touch

-
-
- Get in touch with us - More info here - - - - - - 07123 456789 - - - - - - - - quotations@abcprojectdesign.com - - -
-
- {submitted ? ( +
+ +
+ Get in touch with us + More info here - + - <> - - Thank you for contacting us - - - We will be in touch shortly - - + + 07123 456789 + - ) : ( - <> + + + + + + quotations@abcprojectdesign.com + + +
+
+ {submitted ? ( - + - - Contact us - + <> + + Thank you for contacting us + + + We will be in touch shortly + + -
- - - - - - - - - )} -
+ ) : ( + <> + + + + + + Contact us + + +
+ + + + + + + + + )} +
+