refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -11,40 +11,42 @@ import Lead from '../components/lead';
|
||||
|
||||
import theme from '../theme';
|
||||
|
||||
const Blog = ({ data }) => (
|
||||
<Layout>
|
||||
<Helmet>
|
||||
<title>Blog</title>
|
||||
<meta name="description" content="Recent news and updates about Netlify CMS." />
|
||||
</Helmet>
|
||||
<Page>
|
||||
<Container size="sm">
|
||||
<h1>Netlify CMS Blog</h1>
|
||||
{data.allMarkdownRemark.edges.map(({ node }) => (
|
||||
<article
|
||||
key={node.id}
|
||||
css={css`
|
||||
margin-bottom: ${theme.space[5]};
|
||||
`}
|
||||
>
|
||||
<h2
|
||||
function Blog({ data }) {
|
||||
return (
|
||||
<Layout>
|
||||
<Helmet>
|
||||
<title>Blog</title>
|
||||
<meta name="description" content="Recent news and updates about Netlify CMS." />
|
||||
</Helmet>
|
||||
<Page>
|
||||
<Container size="sm">
|
||||
<h1>Netlify CMS Blog</h1>
|
||||
{data.allMarkdownRemark.edges.map(({ node }) => (
|
||||
<article
|
||||
key={node.id}
|
||||
css={css`
|
||||
margin-bottom: 0;
|
||||
margin-bottom: ${theme.space[5]};
|
||||
`}
|
||||
>
|
||||
<Link to={node.fields.slug}>{node.frontmatter.title}</Link>
|
||||
</h2>
|
||||
<MetaInfo>
|
||||
by {node.frontmatter.author} on {node.frontmatter.date}
|
||||
</MetaInfo>
|
||||
<Lead>{node.frontmatter.description}</Lead>
|
||||
</article>
|
||||
))}
|
||||
{/* TODO: pagination */}
|
||||
</Container>
|
||||
</Page>
|
||||
</Layout>
|
||||
);
|
||||
<h2
|
||||
css={css`
|
||||
margin-bottom: 0;
|
||||
`}
|
||||
>
|
||||
<Link to={node.fields.slug}>{node.frontmatter.title}</Link>
|
||||
</h2>
|
||||
<MetaInfo>
|
||||
by {node.frontmatter.author} on {node.frontmatter.date}
|
||||
</MetaInfo>
|
||||
<Lead>{node.frontmatter.description}</Lead>
|
||||
</article>
|
||||
))}
|
||||
{/* TODO: pagination */}
|
||||
</Container>
|
||||
</Page>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Blog;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { graphql } from 'gatsby';
|
||||
import Layout from '../components/layout';
|
||||
import Community from '../components/community';
|
||||
|
||||
const CommunityPage = ({ data }) => {
|
||||
function CommunityPage({ data }) {
|
||||
const { title, headline, subhead, sections } = data.markdownRemark.frontmatter;
|
||||
|
||||
return (
|
||||
@ -14,7 +14,7 @@ const CommunityPage = ({ data }) => {
|
||||
<Community headline={headline} subhead={subhead} sections={sections} />
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export const pageQuery = graphql`
|
||||
query communityPage {
|
||||
|
@ -65,7 +65,7 @@ const ContribList = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
const HomePage = ({ data }) => {
|
||||
function HomePage({ data }) {
|
||||
const landing = data.landing.childDataYaml;
|
||||
const updates = data.updates.childDataYaml;
|
||||
const contribs = data.contribs.childDataJson;
|
||||
@ -182,7 +182,7 @@ const HomePage = ({ data }) => {
|
||||
</HomeSection>
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export const pageQuery = graphql`
|
||||
query homeQuery {
|
||||
|
Reference in New Issue
Block a user