style: prettier

This commit is contained in:
2022-06-24 20:59:39 +01:00
parent 14f78c9ded
commit 58e38dbedd
24 changed files with 69 additions and 68 deletions

View File

@@ -7,12 +7,12 @@ import {
Heading, Heading,
Section, Section,
Table, Table,
Text Text,
} from "./components"; } from "./components";
const shadows = { const shadows = {
white: "xl-white", white: "xl-white",
"dark-grey": "xl-black" "dark-grey": "xl-black",
}; };
export default function CaseStudy({ data }) { export default function CaseStudy({ data }) {
@@ -26,9 +26,9 @@ export default function CaseStudy({ data }) {
price, price,
time_taken, time_taken,
date, date,
content content,
} = data.caseStudy; } = data.caseStudy;
const images = data.images.nodes.map(node => node.childImageSharp); const images = data.images.nodes.map((node) => node.childImageSharp);
return ( return (
<Layout location={path} title={`${title} Case Study`}> <Layout location={path} title={`${title} Case Study`}>
<Header image={images[image].full}> <Header image={images[image].full}>

View File

@@ -13,7 +13,7 @@ const Container = styled.button`
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
${props => ${(props) =>
props.float && props.float &&
css` css`
float: ${props.float}; float: ${props.float};

View File

@@ -2,7 +2,7 @@ import React from "react";
import styled from "@emotion/styled"; import styled from "@emotion/styled";
const Container = styled.div` const Container = styled.div`
transform: ${props => transform: ${(props) =>
props.offset props.offset
? `perspective(500px) translate3d(-10%, 0, -200px)` ? `perspective(500px) translate3d(-10%, 0, -200px)`
: `translate3d(0, 0, 0)`}; : `translate3d(0, 0, 0)`};

View File

@@ -9,7 +9,7 @@ import "slick-carousel/slick/slick.css";
const Button = styled.button` const Button = styled.button`
position: absolute; position: absolute;
top: 50%; top: 50%;
${props => ${(props) =>
props.variant === "right" && props.variant === "right" &&
css` css`
right: 0; right: 0;
@@ -61,7 +61,7 @@ export default function CustomSlick({ children }) {
speed: 500, speed: 500,
autoplaySpeed: 10000, autoplaySpeed: 10000,
slidesToShow: 1, slidesToShow: 1,
slidesToScroll: 1 slidesToScroll: 1,
}; };
useEffect(() => { useEffect(() => {
slick.current.slickPlay(); slick.current.slickPlay();

View File

@@ -5,7 +5,7 @@ import { css } from "@emotion/react";
const Container = styled.div` const Container = styled.div`
display: grid; display: grid;
gap: var(--spacing-y-lg) var(--spacing-x-md); gap: var(--spacing-y-lg) var(--spacing-x-md);
${props => ${(props) =>
props.columns && props.columns &&
props.columns.map((column, i) => props.columns.map((column, i) =>
i === 0 && column > 1 i === 0 && column > 1
@@ -24,7 +24,7 @@ const Container = styled.div`
` `
)} )}
${props => ${(props) =>
props.verticalSeparator && props.verticalSeparator &&
css` css`
@media (max-width: ${props.verticalSeparator}) { @media (max-width: ${props.verticalSeparator}) {
@@ -43,7 +43,7 @@ export default function Grid({
columns, columns,
breakpoints = ["30em"], breakpoints = ["30em"],
verticalSeparator, verticalSeparator,
children children,
}) { }) {
return ( return (
<Container <Container

View File

@@ -27,7 +27,7 @@ const Top = styled.div`
fill: var(--color-secondary); fill: var(--color-secondary);
} }
${props => ${(props) =>
props.visible && props.visible &&
css` css`
filter: none; filter: none;
@@ -39,7 +39,7 @@ const Top = styled.div`
const Middle = styled.div` const Middle = styled.div`
opacity: 0; opacity: 0;
transition: opacity 0.5s ease-in 0.75s; transition: opacity 0.5s ease-in 0.75s;
${props => ${(props) =>
props.visible && props.visible &&
css` css`
opacity: 1; opacity: 1;
@@ -63,7 +63,7 @@ const Bottom = styled.div`
fill: var(--color-secondary); fill: var(--color-secondary);
} }
${props => ${(props) =>
props.visible && props.visible &&
css` css`
filter: none; filter: none;

View File

@@ -7,34 +7,34 @@ const Container = styled.header`
height: 50vh; height: 50vh;
min-height: 280px; min-height: 280px;
color: var(--color-white); color: var(--color-white);
${props => props.avoidNav && `margin-top: 40px;`} ${(props) => props.avoidNav && `margin-top: 40px;`}
`; `;
const Content = styled.div` const Content = styled.div`
position: absolute; position: absolute;
${props => ${(props) =>
props.posY !== "bottom" && props.posY !== "bottom" &&
css` css`
top: ${props.posY === "top" ? 0 : "50%"}; top: ${props.posY === "top" ? 0 : "50%"};
`} `}
${props => ${(props) =>
props.posY === "bottom" && props.posY === "bottom" &&
css` css`
bottom: 0; bottom: 0;
`} `}
${props => ${(props) =>
props.posX !== "right" && props.posX !== "right" &&
css` css`
left: ${props.posX === "left" ? 0 : "50%"}; left: ${props.posX === "left" ? 0 : "50%"};
`} `}
${props => ${(props) =>
props.posX === "right" && props.posX === "right" &&
css` css`
right: 0; right: 0;
`} `}
transform: translate( transform: translate(
${props => (props.posX === "middle" ? "-50%" : 0)}, ${(props) => (props.posX === "middle" ? "-50%" : 0)},
${props => (props.posY === "middle" ? "-50%" : 0)} ${(props) => (props.posY === "middle" ? "-50%" : 0)}
); );
max-width: var(--page-max-width); max-width: var(--page-max-width);
padding: var(--spacing-y-sm) var(--spacing-x-sm); padding: var(--spacing-y-sm) var(--spacing-x-sm);
@@ -50,7 +50,7 @@ export default function Header({
avoidNav, avoidNav,
variant, variant,
swap, swap,
children children,
}) { }) {
const [posY, posX] = position.split(" "); const [posY, posX] = position.split(" ");
return ( return (

View File

@@ -3,20 +3,21 @@ import styled from "@emotion/styled";
import { css } from "@emotion/react"; import { css } from "@emotion/react";
const Styles = styled.h1` const Styles = styled.h1`
margin: ${props => (props.noMargin ? 0 : `0 0 var(--spacing-y-sm)`)}; margin: ${(props) => (props.noMargin ? 0 : `0 0 var(--spacing-y-sm)`)};
font-size: ${props => `var(--font-size-${props.size})`}; font-size: ${(props) => `var(--font-size-${props.size})`};
text-shadow: 0 0 ${props => props.shadowSize} ${props => props.shadowColor}; text-shadow: 0 0 ${(props) => props.shadowSize}
${props => ${(props) => props.shadowColor};
${(props) =>
props.color && props.color &&
css` css`
color: var(--color-${props.color}); color: var(--color-${props.color});
`} `}
${props => ${(props) =>
props.noWrap && props.noWrap &&
css` css`
white-space: nowrap; white-space: nowrap;
`} `}
${props => ${(props) =>
props.align && props.align &&
css` css`
text-align: ${props.align}; text-align: ${props.align};
@@ -29,19 +30,19 @@ const sizes = {
h3: "lg", h3: "lg",
h4: "lg", h4: "lg",
h5: "lg", h5: "lg",
h6: "lg" h6: "lg",
}; };
const shadowSizes = { const shadowSizes = {
sm: "2px", sm: "2px",
md: "5px", md: "5px",
lg: "10px", lg: "10px",
xl: "15px" xl: "15px",
}; };
const shadowColors = { const shadowColors = {
white: "rgba(255, 255, 255, 0.25)", white: "rgba(255, 255, 255, 0.25)",
black: "rgba(0, 0, 0, 0.25)" black: "rgba(0, 0, 0, 0.25)",
}; };
export default function Heading({ export default function Heading({

View File

@@ -21,7 +21,7 @@ const Content = styled.div`
export default function IconWithContent({ children }) { export default function IconWithContent({ children }) {
return ( return (
<Container> <Container>
{children.map(child => { {children.map((child) => {
if (child.type === Icon) { if (child.type === Icon) {
return <IconWrapper key="icon">{child}</IconWrapper>; return <IconWrapper key="icon">{child}</IconWrapper>;
} }

View File

@@ -4,9 +4,9 @@ import { css } from "@emotion/react";
const Container = styled.span` const Container = styled.span`
display: inline-flex; display: inline-flex;
width: ${props => `var(--icon-size-${props.size})`}; width: ${(props) => `var(--icon-size-${props.size})`};
height: ${props => `var(--icon-size-${props.size})`}; height: ${(props) => `var(--icon-size-${props.size})`};
${props => ${(props) =>
props.color && props.color &&
css` css`
color: var(--color-${props.color}); color: var(--color-${props.color});

View File

@@ -23,6 +23,6 @@ export { default as ReviewSummary } from "./review-summary";
export { default as Section } from "./section"; export { default as Section } from "./section";
export { default as Select } from "./select"; export { default as Select } from "./select";
export { default as Table } from "./table"; export { default as Table } from "./table";
export { default as Team } from './team'; export { default as Team } from "./team";
export { default as Text } from "./text"; export { default as Text } from "./text";
export { default as Tile } from "./tile"; export { default as Tile } from "./tile";

View File

@@ -23,7 +23,7 @@ export default function InputText({
value, value,
onChange, onChange,
required, required,
textArea textArea,
}) { }) {
return ( return (
<Input <Input

View File

@@ -4,13 +4,13 @@ import { css } from "@emotion/react";
import { Link as GatsbyLink } from "gatsby"; import { Link as GatsbyLink } from "gatsby";
const StyledLink = styled.a` const StyledLink = styled.a`
${props => ${(props) =>
props.size && props.size &&
css` css`
font-size: var(--font-size-${props.size}); font-size: var(--font-size-${props.size});
`} `}
color: var(--color-dark); color: var(--color-dark);
${props => ${(props) =>
props.noDecoration props.noDecoration
? css` ? css`
text-decoration: none; text-decoration: none;
@@ -20,7 +20,7 @@ const StyledLink = styled.a`
text-decoration-thickness: 2px; text-decoration-thickness: 2px;
text-underline-offset: 3px; text-underline-offset: 3px;
`} `}
${props => ${(props) =>
props.weight && props.weight &&
css` css`
font-weight: ${props.weight}; font-weight: ${props.weight};

View File

@@ -27,7 +27,7 @@ export default function CustomMap({ ...other }) {
`); `);
const Wrapper = GoogleApiWrapper({ const Wrapper = GoogleApiWrapper({
apiKey: data.site.siteMetadata.secrets.GMAPS_APIKEY apiKey: data.site.siteMetadata.secrets.GMAPS_APIKEY,
})(MapContainer); })(MapContainer);
return <Wrapper {...other} />; return <Wrapper {...other} />;
} }

View File

@@ -35,7 +35,7 @@ const Bar = styled.span`
const TopBar = styled(Bar)` const TopBar = styled(Bar)`
top: 5px; top: 5px;
transform: ${props => transform: ${(props) =>
props.open props.open
? `translate3d(0, 10px, 0) rotate(50deg)` ? `translate3d(0, 10px, 0) rotate(50deg)`
: `translate3d(0, 0, 0) rotate(0)`}; : `translate3d(0, 0, 0) rotate(0)`};
@@ -44,13 +44,13 @@ const TopBar = styled(Bar)`
const MiddleBar = styled(Bar)` const MiddleBar = styled(Bar)`
top: 15px; top: 15px;
opacity: ${props => (props.open ? 0 : 1)}; opacity: ${(props) => (props.open ? 0 : 1)};
transition: opacity 1s ease-in; transition: opacity 1s ease-in;
`; `;
const BottomBar = styled(Bar)` const BottomBar = styled(Bar)`
top: 25px; top: 25px;
transform: ${props => transform: ${(props) =>
props.open props.open
? `translate3d(0, -10px, 0) rotate(-410deg)` ? `translate3d(0, -10px, 0) rotate(-410deg)`
: `translate3d(0, 0, 0) rotate(0)`}; : `translate3d(0, 0, 0) rotate(0)`};

View File

@@ -28,10 +28,10 @@ const ListItem = styled.li`
} }
@media (max-width: 30em) { @media (max-width: 30em) {
transform: ${props => transform: ${(props) =>
props.open ? `translate3d(0, 0, 0)` : `translate3d(-100%, 0, 0)`}; props.open ? `translate3d(0, 0, 0)` : `translate3d(-100%, 0, 0)`};
transition: transform 0.3s ease-in-out transition: transform 0.3s ease-in-out
calc(0.15s + (${props => props.index} * 0.1s)); calc(0.15s + (${(props) => props.index} * 0.1s));
} }
`; `;

View File

@@ -25,7 +25,7 @@ const Link = styled(GatsbyLink)`
margin: 0 var(--spacing-x-xs); margin: 0 var(--spacing-x-xs);
padding: 9px 0; padding: 9px 0;
border-bottom: 2px solid border-bottom: 2px solid
${props => ${(props) =>
props.active === "true" || props.partiallyActive props.active === "true" || props.partiallyActive
? `var(--color-white)` ? `var(--color-white)`
: `transparent`}; : `transparent`};

View File

@@ -11,10 +11,10 @@ const Container = styled.div`
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 6; z-index: 6;
background-color: ${props => background-color: ${(props) =>
props.open ? `rgba(0, 0, 0, 0.8)` : `rgba(0, 0, 0, 0.4)`}; props.open ? `rgba(0, 0, 0, 0.8)` : `rgba(0, 0, 0, 0.4)`};
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
transform: ${props => transform: ${(props) =>
props.open props.open
? `translate3d(0, 0, 0)` ? `translate3d(0, 0, 0)`
: `translate3d(0, calc(-100% + 40px), 0)`}; : `translate3d(0, calc(-100% + 40px), 0)`};
@@ -51,7 +51,7 @@ const Heading = styled(Link)`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
opacity: ${props => (props.hidden ? 0 : 1)}; opacity: ${(props) => (props.hidden ? 0 : 1)};
transform: opacity 0.3s ease-in; transform: opacity 0.3s ease-in;
svg { svg {

View File

@@ -12,7 +12,7 @@ import Calendar from "../icons/calendar.svg";
const ICONS = { const ICONS = {
Bark: <Bark />, Bark: <Bark />,
Checkatrade: <Checkatrade />, Checkatrade: <Checkatrade />,
"Rated People": <RatedPeople /> "Rated People": <RatedPeople />,
}; };
const Container = styled.div` const Container = styled.div`

View File

@@ -4,10 +4,10 @@ import { Heading } from ".";
const Container = styled.div` const Container = styled.div`
padding: var(--spacing-y-lg) var(--spacing-x-sm); padding: var(--spacing-y-lg) var(--spacing-x-sm);
${props => !props.variant && `background-color: var(--color-white);`} ${(props) => !props.variant && `background-color: var(--color-white);`}
${props => ${(props) =>
props.variant === "primary" && `background-color: var(--color-light);`} props.variant === "primary" && `background-color: var(--color-light);`}
${props => ${(props) =>
props.variant === "transparent" && props.variant === "transparent" &&
`background-color: var(--color-semi-transparent);`} `background-color: var(--color-semi-transparent);`}
`; `;
@@ -25,7 +25,7 @@ export default function Section({
heading, heading,
headingElement = "h2", headingElement = "h2",
children, children,
variant variant,
}) { }) {
return ( return (
<Container variant={variant}> <Container variant={variant}>

View File

@@ -3,28 +3,28 @@ import styled from "@emotion/styled";
import { css } from "@emotion/react"; import { css } from "@emotion/react";
const StyledText = styled.p` const StyledText = styled.p`
margin: ${props => (props.noMargin ? 0 : `0 0 var(--spacing-y-md)`)}; margin: ${(props) => (props.noMargin ? 0 : `0 0 var(--spacing-y-md)`)};
${props => ${(props) =>
props.textStyle && props.textStyle &&
css` css`
font-style: ${props.textStyle}; font-style: ${props.textStyle};
`} `}
${props => ${(props) =>
props.align && props.align &&
css` css`
text-align: ${props.align}; text-align: ${props.align};
`} `}
${props => ${(props) =>
props.size && props.size &&
css` css`
font-size: var(--font-size-${props.size}); font-size: var(--font-size-${props.size});
`} `}
${props => ${(props) =>
props.color && props.color &&
css` css`
color: var(--color-${props.color}); color: var(--color-${props.color});
`} `}
${props => ${(props) =>
props.weight && props.weight &&
css` css`
font-weight: ${props.weight}; font-weight: ${props.weight};

View File

@@ -119,10 +119,10 @@ export default function Layout({ location, title: pageTitle, children }) {
title={pageTitle ? `${pageTitle} : ${title}` : title} title={pageTitle ? `${pageTitle} : ${title}` : title}
meta={[ meta={[
{ name: "description", content: description }, { name: "description", content: description },
{ name: "keywords", content: keywords } { name: "keywords", content: keywords },
]} ]}
htmlAttributes={{ htmlAttributes={{
lang: "en" lang: "en",
}} }}
/> />
<Global styles={GlobalStyles} /> <Global styles={GlobalStyles} />
@@ -130,8 +130,8 @@ export default function Layout({ location, title: pageTitle, children }) {
styles={ styles={
navOpen && { navOpen && {
body: { body: {
overflowY: "hidden" overflowY: "hidden",
} },
} }
} }
/> />

View File

@@ -17,7 +17,7 @@ const triangleCoords = [
{ lat: 51.611, lng: -0.45 }, // Northwood { lat: 51.611, lng: -0.45 }, // Northwood
{ lat: 51.737, lng: -0.399 }, // St Albans { lat: 51.737, lng: -0.399 }, // St Albans
{ lat: 51.992, lng: -0.281 }, // Letchworth { lat: 51.992, lng: -0.281 }, // Letchworth
{ lat: 52.253, lng: 0.109 } // Cambridge { lat: 52.253, lng: 0.109 }, // Cambridge
]; ];
export default function Index() { export default function Index() {
@@ -28,7 +28,7 @@ export default function Index() {
<Map <Map
initialCenter={{ initialCenter={{
lat: 51.765, lat: 51.765,
lng: 0.022 lng: 0.022,
}} }}
zoom={7} zoom={7}
mapTypeContol={false} mapTypeContol={false}

View File

@@ -15,7 +15,7 @@ import {
ReviewSummary, ReviewSummary,
Section, Section,
Text, Text,
Tile Tile,
} from "../components"; } from "../components";
import Calendar from "../icons/calendar.svg"; import Calendar from "../icons/calendar.svg";
import CheckCircle from "../icons/check-circle.svg"; import CheckCircle from "../icons/check-circle.svg";