Skip to content

Commit 19c4bac

Browse files
author
Ives van Hoorne
committed
Update all existing gatsby pages
1 parent e475f37 commit 19c4bac

File tree

4 files changed

+103
-88
lines changed

4 files changed

+103
-88
lines changed

packages/homepage/src/components/TitleAndMetaTags.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
22
import Helmet from 'react-helmet';
33

4-
export default ({ title }: { title: string }) => (
4+
export default ({
5+
title = 'CodeSandbox: Online Code Editor Tailored for Web Application Development',
6+
}: {
7+
title: string,
8+
}) => (
59
<Helmet
610
title={title}
711
meta={[

packages/homepage/src/pages/changelog.js

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -115,53 +115,57 @@ const GitHubUser = ({ username }) => (
115115
</GitHubUserContainer>
116116
);
117117

118-
export default ({ data }) => {
119-
const { edges: posts } = data.allMarkdownRemark;
120-
121-
return (
122-
<Container>
123-
<TitleAndMetaTags title="CodeSandbox - Recent Updates" />
124-
<PageContainer width={1024}>
125-
<Heading1>Recent Updates</Heading1>
126-
<Description>
127-
This the list of recent updates to CodeSandbox. We only keep track of
128-
our notable updates here, for smaller updates you can check our{' '}
129-
<a href="https://github.com/CompuIves/codesandbox-client">
130-
GitHub repository
131-
</a>.
132-
</Description>
133-
<Changelogs>
134-
{posts.map(({ node: post }) => {
135-
const { frontmatter, fields, html } = post;
136-
137-
return (
138-
<Changelog>
139-
<ReleaseDate>
140-
<p>{fields.date}</p>
141-
<div>
142-
{frontmatter.authors.map(username => (
143-
<GitHubUser username={username} key={username} />
144-
))}
145-
</div>
146-
</ReleaseDate>
147-
148-
<Info>
149-
<Anchor name={`#${fields.slug}`} href={`#${fields.slug}`}>
150-
<ChangelogTitle id={fields.slug}>
151-
{frontmatter.title}
152-
</ChangelogTitle>
153-
</Anchor>
154-
<Content dangerouslySetInnerHTML={{ __html: html }} />
155-
</Info>
156-
</Changelog>
157-
);
158-
})}
159-
</Changelogs>
160-
<OlderPosts>We keep track of updates since December 2017.</OlderPosts>
161-
</PageContainer>
162-
</Container>
163-
);
164-
};
118+
// eslint-disable-next-line
119+
export default class Changelog extends React.Component {
120+
render() {
121+
const { data } = this.props;
122+
const { edges: posts } = data.allMarkdownRemark;
123+
124+
return (
125+
<Container>
126+
<TitleAndMetaTags title="CodeSandbox - Recent Updates" />
127+
<PageContainer width={1024}>
128+
<Heading1>Recent Updates</Heading1>
129+
<Description>
130+
This the list of recent updates to CodeSandbox. We only keep track
131+
of our notable updates here, for smaller updates you can check our{' '}
132+
<a href="https://github.com/CompuIves/codesandbox-client">
133+
GitHub repository
134+
</a>.
135+
</Description>
136+
<Changelogs>
137+
{posts.map(({ node: post }) => {
138+
const { frontmatter, fields, html } = post;
139+
140+
return (
141+
<Changelog>
142+
<ReleaseDate>
143+
<p>{fields.date}</p>
144+
<div>
145+
{frontmatter.authors.map(username => (
146+
<GitHubUser username={username} key={username} />
147+
))}
148+
</div>
149+
</ReleaseDate>
150+
151+
<Info>
152+
<Anchor name={`#${fields.slug}`} href={`#${fields.slug}`}>
153+
<ChangelogTitle id={fields.slug}>
154+
{frontmatter.title}
155+
</ChangelogTitle>
156+
</Anchor>
157+
<Content dangerouslySetInnerHTML={{ __html: html }} />
158+
</Info>
159+
</Changelog>
160+
);
161+
})}
162+
</Changelogs>
163+
<OlderPosts>We keep track of updates since December 2017.</OlderPosts>
164+
</PageContainer>
165+
</Container>
166+
);
167+
}
168+
}
165169

166170
export const pageQuery = graphql`
167171
query Changelogs {

packages/homepage/src/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class HomePage extends React.Component {
3333
render() {
3434
return (
3535
<div>
36-
<TitleAndMetaTags title="CodeSandbox: Online Code Editor Tailored for Web Application Development" />
36+
<TitleAndMetaTags />
3737

3838
<Animation />
3939
<NPMFeature />

packages/homepage/src/templates/docs.js

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -181,45 +181,52 @@ const Description = styled.p`
181181
margin-bottom: 0.25rem;
182182
`;
183183

184-
export default ({ data }) => {
185-
const { edges: docs } = data.allMarkdownRemark;
186-
const { html, frontmatter, fields } = data.markdownRemark;
187-
188-
return (
189-
<Container style={{ overflowX: 'auto' }}>
190-
<TitleAndMetaTags title={`${frontmatter.title} - CodeSandbox`} />
191-
<PageContainer>
192-
<DocsContainer>
193-
<div
194-
style={{
195-
flex: 1,
196-
minWidth: 250,
197-
}}
198-
>
199-
<StickyNavigation docs={docs} />
200-
</div>
201-
<Article>
202-
<Heading>
203-
<Title>{frontmatter.title}</Title>
204-
<Edit
205-
href={`https://github.com/CompuIves/codesandbox-client/tree/master/packages/homepage/content/${
206-
fields.path
207-
}`}
208-
target="_blank"
209-
rel="noreferrer noopener"
210-
>
211-
Edit this page
212-
</Edit>
213-
<Description>{frontmatter.description}</Description>
214-
</Heading>
215-
216-
<DocumentationContent dangerouslySetInnerHTML={{ __html: html }} />
217-
</Article>
218-
</DocsContainer>
219-
</PageContainer>
220-
</Container>
221-
);
222-
};
184+
// eslint-disable-next-line
185+
export default class Docs extends React.Component {
186+
render() {
187+
const { data } = this.props;
188+
189+
const { edges: docs } = data.allMarkdownRemark;
190+
const { html, frontmatter, fields } = data.markdownRemark;
191+
192+
return (
193+
<Container style={{ overflowX: 'auto' }}>
194+
<TitleAndMetaTags title={`${frontmatter.title} - CodeSandbox`} />
195+
<PageContainer>
196+
<DocsContainer>
197+
<div
198+
style={{
199+
flex: 1,
200+
minWidth: 250,
201+
}}
202+
>
203+
<StickyNavigation docs={docs} />
204+
</div>
205+
<Article>
206+
<Heading>
207+
<Title>{frontmatter.title}</Title>
208+
<Edit
209+
href={`https://github.com/CompuIves/codesandbox-client/tree/master/packages/homepage/content/${
210+
fields.path
211+
}`}
212+
target="_blank"
213+
rel="noreferrer noopener"
214+
>
215+
Edit this page
216+
</Edit>
217+
<Description>{frontmatter.description}</Description>
218+
</Heading>
219+
220+
<DocumentationContent
221+
dangerouslySetInnerHTML={{ __html: html }}
222+
/>
223+
</Article>
224+
</DocsContainer>
225+
</PageContainer>
226+
</Container>
227+
);
228+
}
229+
}
223230

224231
export const pageQuery = graphql`
225232
query Docs($slug: String!) {

0 commit comments

Comments
 (0)