Skip to content

Commit

Permalink
feat: new subheaders in overview pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Cayla Hamann committed Jul 7, 2020
1 parent 73cf3fc commit 04dceb4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
43 changes: 24 additions & 19 deletions src/templates/OverviewTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,30 @@ const OverviewTemplate = ({ data }) => {
<PageTitle>{title}</PageTitle>
<MDXContainer>{body}</MDXContainer>
{!!guides?.nodes.length && (
<GuideListing className={styles.guideListing}>
<GuideListing.List>
{guides?.nodes.map(({ frontmatter }, index) => (
<GuideTile
as={Link}
to={frontmatter.path}
key={index}
duration={frontmatter.duration}
title={frontmatter.tileShorthand?.title || frontmatter.title}
description={
frontmatter.tileShorthand?.description ||
frontmatter.description
}
path={frontmatter.path}
alignment={GuideTile.ALIGNMENT.LEFT}
/>
))}
</GuideListing.List>
</GuideListing>
<>
<h2
className={styles.subtitle}
>{`Guides to ${title.toLowerCase()}`}</h2>
<GuideListing className={styles.guideListing}>
<GuideListing.List>
{guides?.nodes.map(({ frontmatter }, index) => (
<GuideTile
as={Link}
to={frontmatter.path}
key={index}
duration={frontmatter.duration}
title={frontmatter.tileShorthand?.title || frontmatter.title}
description={
frontmatter.tileShorthand?.description ||
frontmatter.description
}
path={frontmatter.path}
alignment={GuideTile.ALIGNMENT.LEFT}
/>
))}
</GuideListing.List>
</GuideListing>
</>
)}
</Layout>
);
Expand Down
4 changes: 4 additions & 0 deletions src/templates/OverviewTemplate.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.guideListing {
margin-top: 2rem;
}

.subtitle {
margin-top: 2rem;
}

0 comments on commit 04dceb4

Please sign in to comment.