Skip to content

Commit fc14ac8

Browse files
ranyitzcpojer
authored andcommitted
fix lint on website (#5506)
1 parent 3250edc commit fc14ac8

3 files changed

Lines changed: 90 additions & 101 deletions

File tree

website/pages/en/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ class Index extends React.Component {
364364
</div>
365365
</Container>
366366

367-
368367
<div className="productShowcaseSection paddingBottom">
369368
<h2>
370369
<translate>Who's using Jest?</translate>

website/pages/en/videos.js

Lines changed: 81 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -5,109 +5,95 @@ const {translate} = require('../../server/translate.js');
55
const siteConfig = require(process.cwd() + '/siteConfig.js');
66

77
class Video extends React.PureComponent {
8-
render() {
9-
const {url, type} = this.props;
8+
render() {
9+
const {url, type} = this.props;
1010

11-
switch (type) {
12-
case siteConfig.videoTypes.YOUTUBE: {
13-
return (
14-
<iframe
15-
width="560"
16-
height="315"
17-
src={url}
18-
frameBorder="0"
19-
allowFullScreen
20-
/>
21-
);
22-
}
23-
case siteConfig.videoTypes.IFRAME: {
24-
return (
25-
<iframe src={url} />
26-
);
27-
}
28-
default: {
29-
return (
30-
<iframe src={url} />
31-
);
32-
}
33-
}
11+
switch (type) {
12+
case siteConfig.videoTypes.YOUTUBE: {
13+
return (
14+
<iframe
15+
width="560"
16+
height="315"
17+
src={url}
18+
frameBorder="0"
19+
allowFullScreen
20+
/>
21+
);
22+
}
23+
case siteConfig.videoTypes.IFRAME: {
24+
return <iframe src={url} />;
25+
}
26+
default: {
27+
return <iframe src={url} />;
28+
}
3429
}
30+
}
3531
}
3632

3733
class Videos extends React.Component {
38-
render() {
39-
const showcase = siteConfig.videos.map(({title, description, type, url}, index) => {
40-
const textMarkup = (
41-
<div className="blockContent">
42-
<h2>
43-
{title}
44-
</h2>
45-
<div>
46-
<MarkdownBlock>
47-
{description}
48-
</MarkdownBlock>
49-
</div>
50-
</div>
51-
);
52-
const videoMarkup = (
53-
<div className="video">
54-
<Video url={url} type={type} />
55-
</div>
56-
);
57-
58-
return (
59-
<Container key={url} padding={['bottom', 'top']}>
60-
<a className="hash-link" href={`#${title}`} />
61-
{
62-
index % 2 === 0
63-
? (
64-
<div className="blockElement imageAlignSide threeByGridBlock">
65-
{videoMarkup}
66-
{textMarkup}
67-
</div>
68-
)
69-
: (
70-
<div className="blockElement imageAlignSide threeByGridBlock">
71-
{textMarkup}
72-
{videoMarkup}
73-
</div>
74-
)
75-
}
76-
</Container>
77-
);
78-
});
34+
render() {
35+
const showcase = siteConfig.videos.map(
36+
({title, description, type, url}, index) => {
37+
const textMarkup = (
38+
<div className="blockContent">
39+
<h2>{title}</h2>
40+
<div>
41+
<MarkdownBlock>{description}</MarkdownBlock>
42+
</div>
43+
</div>
44+
);
45+
const videoMarkup = (
46+
<div className="video">
47+
<Video url={url} type={type} />
48+
</div>
49+
);
7950

8051
return (
81-
<div className="mainContainer">
82-
<Container padding={['bottom', 'top']}>
83-
<div className="showcaseSection">
84-
<div className="prose">
85-
<h1>
86-
<translate>
87-
Talks & Videos
88-
</translate>
89-
</h1>
90-
<p>
91-
<translate>
92-
We understand that reading through docs can be boring sometimes.
93-
Here is a community curated list of talks & videos around Jest.
94-
</translate>
95-
</p>
96-
</div>
97-
</div>
98-
{showcase}
99-
<div style={{textAlign: 'center'}}>
100-
<a href={siteConfig.siteConfigUrl} className="button">
101-
<translate>
102-
Add your favorite talk
103-
</translate>
104-
</a>
105-
</div>
106-
</Container>
107-
</div>
52+
<Container key={url} padding={['bottom', 'top']}>
53+
<a className="hash-link" href={`#${title}`} />
54+
{index % 2 === 0 ? (
55+
<div className="blockElement imageAlignSide threeByGridBlock">
56+
{videoMarkup}
57+
{textMarkup}
58+
</div>
59+
) : (
60+
<div className="blockElement imageAlignSide threeByGridBlock">
61+
{textMarkup}
62+
{videoMarkup}
63+
</div>
64+
)}
65+
</Container>
10866
);
109-
}
67+
}
68+
);
69+
70+
return (
71+
<div className="mainContainer">
72+
<Container padding={['bottom', 'top']}>
73+
<div className="showcaseSection">
74+
<div className="prose">
75+
<h1>
76+
<translate>Talks & Videos</translate>
77+
</h1>
78+
<p>
79+
<translate>
80+
We understand that reading through docs can be boring
81+
sometimes. Here is a community curated list of talks & videos
82+
around Jest.
83+
</translate>
84+
</p>
85+
</div>
86+
</div>
87+
{showcase}
88+
<div style={{textAlign: 'center'}}>
89+
<a href={siteConfig.siteConfigUrl} className="button">
90+
<translate>Add your favorite talk</translate>
91+
</a>
92+
</div>
93+
</Container>
94+
</div>
95+
);
96+
}
11097
}
11198

11299
module.exports = Videos;
113-

website/siteConfig.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,23 @@ const videos = [
1919
title: 'Rogelio Guzman - Jest Snapshots and Beyond - React Conf 2017',
2020
type: videoTypes.YOUTUBE,
2121
url: 'https://www.youtube.com/embed/HAuXJVI_bUs',
22-
description: '[Rogelio](https://twitter.com/rogeliog) shows how Jest might help you overcome the inertia to write & maintain tests with the help of a simple React Application.',
22+
description:
23+
'[Rogelio](https://twitter.com/rogeliog) shows how Jest might help you overcome the inertia to write & maintain tests with the help of a simple React Application.',
2324
},
2425
{
2526
title: 'Snapshot testing - Anna Doubkova, React London 2017',
2627
type: videoTypes.YOUTUBE,
2728
url: 'https://www.youtube.com/embed/sCbGfi40IWk',
28-
description: 'In this talk, [Anna Doubkova](https://twitter.com/lithinn) explains Snapshot Testing in brief while also highlighting testing pitfalls.',
29+
description:
30+
'In this talk, [Anna Doubkova](https://twitter.com/lithinn) explains Snapshot Testing in brief while also highlighting testing pitfalls.',
2931
},
3032
{
3133
title: 'Test React applications using Enzyme & Jest',
3234
type: videoTypes.YOUTUBE,
3335
url: 'https://www.youtube.com/embed/8Ww2QBVIw0I',
34-
description: 'This talk by [Ryan Walsh](https://twitter.com/_rtwalsh) gives an introduction to testing [React](https://facebook.github.io/react/) components using [Enzyme](http://airbnb.io/enzyme/) and Jest.',
35-
}
36+
description:
37+
'This talk by [Ryan Walsh](https://twitter.com/_rtwalsh) gives an introduction to testing [React](https://facebook.github.io/react/) components using [Enzyme](http://airbnb.io/enzyme/) and Jest.',
38+
},
3639
];
3740

3841
/* List of projects/orgs using your project for the users page */
@@ -314,7 +317,8 @@ const siteConfig = {
314317
},
315318
scripts: ['https://buttons.github.io/buttons.js'],
316319
repoUrl,
317-
siteConfigUrl: 'https://github.com/facebook/jest/edit/master/website/siteConfig.js',
320+
siteConfigUrl:
321+
'https://github.com/facebook/jest/edit/master/website/siteConfig.js',
318322
};
319323

320324
module.exports = siteConfig;

0 commit comments

Comments
 (0)