Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#30] Updated logos to follow design #41

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions overrides/home/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import RedEarthImg from "./media/earth-1.png";

const IntroHeadline = styled(Hug)`
display: flex;
flex-flow: column;
gap: ${glsp(2)};
grid-column: content-start / content-end;

Expand All @@ -32,6 +31,10 @@ const IntroHeadline = styled(Hug)`
flex-flow: row;
`}

${media.mediumDown`
flex-flow: column;
`}

p {
font-size: 1.25rem;
padding-top: 1rem;
Expand Down Expand Up @@ -144,7 +147,7 @@ export default function HomeComponent() {
</StyledVarHeading>
<p>{description}</p>
</IntroDesc>
<Partners size="small" />
<Partners size="small" top={4} />
</IntroHeadline>
</HomeDescription>
<ContentContainer>
Expand Down
121 changes: 92 additions & 29 deletions overrides/home/partners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,104 @@ const LogoWrapper = styled.div`
`}
`;

const LogoWrapperWithLimit = styled.div`
display: flex;
flex-flow: column;
flex-shrink: 0;
gap: 2rem;
align-items: center;
justify-content: center;

div {
gap: 1rem;
display: flex;
flex-flow: row;
align-items: center;
${media.mediumDown`
gap: 0.5rem;
`}
}
`;

export default function Partners(props: {
size: "big" | "small"
size: "big" | "small",
top?: number,
}) {
const { size } = props;
const squareLogoHeight = size == "big" ? "80" : "40";

return (
<LogoWrapper>
<a href="https://www.nasa.gov/">
<Image src={nasaImg} alt="NASA logo" height={squareLogoHeight} />
</a>

<a href="https://www.epa.gov/">
<Image src={epaImg} alt="EPA logo" height={squareLogoHeight} />
</a>

<a href="https://www.fema.gov/">
<Image src={femaImg} alt="FEMA logo" height={squareLogoHeight} />
</a>

<a href="https://www.noaa.gov/">
<Image src={noaaImg} alt="NOAA logo" height={squareLogoHeight} />
</a>
let partners = [
{
href: "https://www.nasa.gov/",
src: nasaImg,
alt: "NASA logo"
},
{
href: "https://www.epa.gov/",
src: epaImg,
alt: "EPA logo"
},
{
href: "https://www.fema.gov/",
src: femaImg,
alt: "FEMA logo"
},
{
href: "https://www.noaa.gov/",
src: noaaImg,
alt: "NOAA logo"
},
{
href: "https://www.usaid.gov/",
src: usaidImg,
alt: "USAID logo"
},
{
href: "https://www.usda.gov/",
src: usdaImg,
alt: "USDA logo"
},
{
href: "https://www.usgs.gov/",
src: usgsImg,
alt: "USGS logo",
height: size == "big" ? "40" : "20",
},
]

<a href="https://www.usaid.gov/">
<Image src={usaidImg} alt="USAID logo" height={squareLogoHeight} />
</a>
const createOrder = (top?: number) => {
const createRow = (logos: any[]) => (
<>
{logos.map((partner) => (
<a href={partner.href}>
<Image
src={partner.src}
alt={partner.alt}
height={partner.height || squareLogoHeight}
/>
</a>
))}
</>
);

<a href="https://www.usda.gov/">
<Image src={usdaImg} alt="USAID logo" height={squareLogoHeight} />
</a>

<a href="https://www.usgs.gov/">
<Image src={usgsImg} alt="USGS logo" height={size == "big" ? "40" : "20"} />
</a>
</LogoWrapper>
if (top) {
const bottom = partners.splice(top);
return (
<LogoWrapperWithLimit>
<div>{createRow(partners)}</div>
<div>{createRow(bottom)}</div>
</LogoWrapperWithLimit>
);
} else {
return (
<LogoWrapper>
{createRow(partners)}
</LogoWrapper>
);
}
}

return (
createOrder(props.top)
);
}
Loading