refactor: convert function expressions to declarations (#4926)

This commit is contained in:
Vladislav Shkodin
2021-02-08 20:01:21 +02:00
committed by GitHub
parent c0236536dd
commit 141a2eba56
241 changed files with 3444 additions and 2933 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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 {