2018-08-07 09:53:31 -06:00
|
|
|
import React from 'react';
|
2018-07-25 07:47:26 -04:00
|
|
|
import Helmet from 'react-helmet';
|
2018-08-23 17:58:38 -04:00
|
|
|
import { graphql } from 'gatsby';
|
2020-01-23 21:55:18 -05:00
|
|
|
import { css } from '@emotion/core';
|
2018-07-25 07:47:26 -04:00
|
|
|
|
2018-08-23 17:58:38 -04:00
|
|
|
import Layout from '../components/layout';
|
2020-01-23 21:55:18 -05:00
|
|
|
import Markdownify from '../components/markdownify';
|
|
|
|
import PageHero from '../components/page-hero';
|
|
|
|
import HeroTitle from '../components/hero-title';
|
|
|
|
import Lead from '../components/lead';
|
|
|
|
import Container from '../components/container';
|
|
|
|
import SectionLabel from '../components/section-label';
|
|
|
|
import Page from '../components/page';
|
|
|
|
import Grid from '../components/grid';
|
|
|
|
import CommunityChannelsList from '../components/community-channels-list';
|
2018-07-25 07:47:26 -04:00
|
|
|
|
2020-01-23 21:55:18 -05:00
|
|
|
import theme from '../theme';
|
2018-07-25 07:47:26 -04:00
|
|
|
|
|
|
|
const CommunityPage = ({ data }) => {
|
2019-06-24 19:07:19 -04:00
|
|
|
const { title, headline, subhead, sections } = data.markdownRemark.frontmatter;
|
2018-07-25 07:47:26 -04:00
|
|
|
|
|
|
|
return (
|
2020-01-23 21:55:18 -05:00
|
|
|
<Layout hasPageHero>
|
2019-06-26 15:52:47 -04:00
|
|
|
<Helmet title={title} />
|
2020-01-23 21:55:18 -05:00
|
|
|
<PageHero>
|
|
|
|
<div
|
|
|
|
css={css`
|
|
|
|
margin-bottom: 20px;
|
|
|
|
`}
|
|
|
|
>
|
|
|
|
<HeroTitle>
|
|
|
|
<Markdownify source={headline} />
|
|
|
|
</HeroTitle>
|
|
|
|
<Lead light>
|
|
|
|
<Markdownify source={subhead} />
|
|
|
|
</Lead>
|
|
|
|
</div>
|
|
|
|
</PageHero>
|
|
|
|
|
|
|
|
<Container>
|
|
|
|
<Page>
|
|
|
|
<Grid cols={2}>
|
|
|
|
<div
|
|
|
|
css={css`
|
|
|
|
margin-bottom: ${theme.space[5]};
|
|
|
|
`}
|
|
|
|
>
|
|
|
|
{sections.map(({ title: sectionTitle, channels }, channelIdx) => (
|
|
|
|
<React.Fragment key={channelIdx}>
|
|
|
|
<SectionLabel>{sectionTitle}</SectionLabel>
|
|
|
|
<CommunityChannelsList channels={channels} />
|
|
|
|
</React.Fragment>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</Grid>
|
|
|
|
</Page>
|
|
|
|
</Container>
|
2018-08-23 17:58:38 -04:00
|
|
|
</Layout>
|
2018-07-25 07:47:26 -04:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const pageQuery = graphql`
|
|
|
|
query communityPage {
|
2018-08-23 17:58:38 -04:00
|
|
|
markdownRemark(fileAbsolutePath: { regex: "/community/" }) {
|
2018-07-25 07:47:26 -04:00
|
|
|
frontmatter {
|
|
|
|
headline
|
|
|
|
subhead
|
2019-06-24 19:07:19 -04:00
|
|
|
sections {
|
|
|
|
title
|
|
|
|
channels {
|
|
|
|
title
|
|
|
|
description
|
|
|
|
url
|
|
|
|
}
|
2018-07-25 07:47:26 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default CommunityPage;
|