Skip to content

Commit

Permalink
mobile styles
Browse files Browse the repository at this point in the history
  • Loading branch information
macfarlandian committed Feb 26, 2021
1 parent fcf09da commit fa5b9ad
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
29 changes: 18 additions & 11 deletions spotlight-client/src/OtherNarrativeLinks/OtherNarrativeLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ import Arrow from "../UiLibrary/Arrow";
// grid styles adapted from IE-safe auto placement grid
// https://css-tricks.com/css-grid-in-ie-faking-an-auto-placement-grid-with-gaps/

const Wrapper = styled.div`
/* prevents the trailing grid gaps from pushing other stuff around */
overflow: hidden;
`;

const LinkList = styled.ul`
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -120,17 +125,19 @@ const OtherNarrativeLinks = (): React.ReactElement | null => {
.filter((narrative) => narrative.id !== currentNarrativeTypeId);

return (
<LinkList>
{narrativesToDisplay.map((narrative) => {
return (
<NarrativeLink
key={narrative.id}
tenantId={tenant.id}
narrative={narrative}
/>
);
})}
</LinkList>
<Wrapper>
<LinkList>
{narrativesToDisplay.map((narrative) => {
return (
<NarrativeLink
key={narrative.id}
tenantId={tenant.id}
narrative={narrative}
/>
);
})}
</LinkList>
</Wrapper>
);
};

Expand Down
14 changes: 11 additions & 3 deletions spotlight-client/src/PageTenant/PageTenant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,30 @@ import React from "react";
import styled from "styled-components/macro";
import OtherNarrativeLinks from "../OtherNarrativeLinks";
import { useDataStore } from "../StoreProvider";
import { CopyBlock, PageSection, typefaces } from "../UiLibrary";
import { breakpoints, CopyBlock, PageSection, typefaces } from "../UiLibrary";
import withRouteSync from "../withRouteSync";

const Introduction = styled(PageSection)`
margin: ${rem(160)} 0;
margin: ${rem(48)} 0;
@media screen and (min-width: ${breakpoints.tablet[0]}px) {
margin: ${rem(160)} 0;
}
`;

const Links = styled(PageSection)``;

const Title = styled.h1`
font-family: ${typefaces.display};
font-size: ${rem(52)};
font-size: ${rem(32)};
letter-spacing: -0.04em;
line-height: 1.4;
margin-bottom: ${rem(32)};
max-width: ${rem(760)};
@media screen and (min-width: ${breakpoints.tablet[0]}px) {
font-size: ${rem(52)};
}
`;

const Description = styled(CopyBlock)`
Expand Down
3 changes: 2 additions & 1 deletion spotlight-client/src/SiteNavigation/SiteNavigation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe("on small screens", () => {
expect(menu).toHaveAttribute("aria-hidden", "false");
});

expect.hasAssertions();
fireEvent.click(screen.getByRole("link", { name: "Spotlight" }));
expect(menu).toHaveAttribute("aria-hidden", "true");
});
});
5 changes: 4 additions & 1 deletion spotlight-client/src/SiteNavigation/SiteNavigationMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ const SiteNavigation: React.FC = () => {
<NavBar style={{ borderColor: animatedStyles.borderColor }}>
<NavGroup>
<NavGroupItem>
<NavLink to={getUrlForResource({ page: "home" })}>
<NavLink
onClick={() => setExpanded(false)}
to={getUrlForResource({ page: "home" })}
>
<BrandMark light />
</NavLink>
</NavGroupItem>
Expand Down

0 comments on commit fa5b9ad

Please sign in to comment.