Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@
"Works with TypeScript|no description given": "Works with TypeScript",
"Watch Talks about Jest|no description given": "Watch Talks about Jest",
"The Jest core team and contributors regularly speak about Jest and Delightful JavaScript Testing. Check out our talks about [Building High-Quality JavaScript Tools](https://www.youtube.com/watch?v=PvabBs_utr8) at JSConf.eu 2017 or our talk about [Jest as a Platform](https://www.youtube.com/watch?v=NtjyeojAOBs) at ReactiveConf 2017.|no description given": "The Jest core team and contributors regularly speak about Jest and Delightful JavaScript Testing. Check out our talks about [Building High-Quality JavaScript Tools](https://www.youtube.com/watch?v=PvabBs_utr8) at JSConf.eu 2017 or our talk about [Jest as a Platform](https://www.youtube.com/watch?v=NtjyeojAOBs) at ReactiveConf 2017.",
"Watch more videos|no description given": "Watch more videos",
"Who's using Jest?|no description given": "Who's using Jest?",
"Jest is used by teams of all sizes to test web applications, node.js services, mobile apps, and APIs.|no description given": "Jest is used by teams of all sizes to test web applications, node.js services, mobile apps, and APIs.",
"More Jest Users|no description given": "More Jest Users",
"Talks & Videos|no description given": "Talks & Videos",
"We understand that reading through docs can be boring sometimes. Here is a community curated list of talks & videos around Jest.|no description given": "We understand that reading through docs can be boring sometimes. Here is a community curated list of talks & videos around Jest.",
"Add your favorite talk|no description given": "Add your favorite talk",
"Help Translate|recruit community translators for your project": "Help Translate",
"Edit this Doc|recruitment message asking to edit the doc source": "Edit",
"Translate this Doc|recruitment message asking to translate the docs": "Translate"
Expand Down
17 changes: 15 additions & 2 deletions website/pages/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class HomeSplash extends React.Component {
</div>
</div>
</div>
<div className="githubButton" style={{minHeight: '20px'}}>
<div className="githubButton" style={{ minHeight: '20px' }}>
<a
className="github-button"
href={this.props.config.repoUrl}
Expand Down Expand Up @@ -171,7 +171,7 @@ class Index extends React.Component {

<div
className="productShowcaseSection paddingBottom"
style={{textAlign: 'center'}}
style={{ textAlign: 'center' }}
>
<h2>
<translate>Zero configuration testing platform</translate>
Expand Down Expand Up @@ -350,8 +350,21 @@ class Index extends React.Component {
</div>
</div>
</div>

<div
className="productShowcaseSection paddingTop"
style={{ textAlign: 'center' }}
>
<a
className="button"
href={siteConfig.baseUrl + this.props.language + '/videos.html'}
>
<translate>Watch more videos</translate>
</a>
</div>
</Container>


<div className="productShowcaseSection paddingBottom">
<h2>
<translate>Who's using Jest?</translate>
Expand Down
5 changes: 1 addition & 4 deletions website/pages/en/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ class Users extends React.Component {
</div>
<div className="logos">{showcase}</div>
<p>Are you using this project?</p>
<a
href="https://github.com/facebook/jest/edit/master/website/siteConfig.js"
className="button"
>
<a href={siteConfig.siteConfigUrl} className="button">
Add your company
</a>
</div>
Expand Down
115 changes: 115 additions & 0 deletions website/pages/en/videos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
const React = require('react');

const { Container, MarkdownBlock } = require('../../core/CompLibrary.js');
const { translate } = require('../../server/translate.js');
const siteConfig = require(process.cwd() + '/siteConfig.js');

class Video extends React.PureComponent {
render() {
const { url, type } = this.props;

switch (type) {
case siteConfig.videoTypes.YOUTUBE: {
return (
<iframe
width="560"
height="315"
src={url}
frameBorder="0"
allowFullScreen
/>
);
}
case siteConfig.videoTypes.IFRAME: {
return (
<iframe src={url} />
);
}
default: {
return (
<iframe src={url} />
);
}
}
}
}

class Videos extends React.Component {
render() {
const showcase = siteConfig.videos.map((video, index) => {
const { title, description, type, url } = video;

const textMarkup = (
<div className="blockContent">
<h2>
{title}
</h2>
<div>
<MarkdownBlock>
{description}
</MarkdownBlock>
</div>
</div>
);
const videoMarkup = (
<div className="video">
<Video url={url} type={type} />
</div>
);

return (
<Container key={url} padding={['bottom', 'top']}>
<a className="hash-link" href={`#${title}`} />
{
index % 2 === 0
? (
<div className="blockElement imageAlignSide threeByGridBlock">
{videoMarkup}
{textMarkup}
</div>
)
: (
<div className="blockElement imageAlignSide threeByGridBlock">
{textMarkup}
{videoMarkup}
</div>
)
}
</Container>
);
});

return (
<div className="mainContainer">
<Container padding={['bottom', 'top']}>
<div className="showcaseSection">
<div className="prose">
<h1>
<translate>
Talks & Videos
</translate>
</h1>
<p>
<translate>
We understand that reading through docs can be boring sometimes.
Here is a community curated list of talks & videos around Jest.
</translate>
</p>
</div>
</div>
{showcase}
<div style={{ textAlign: 'center' }}>
<a href={siteConfig.siteConfigUrl} className="button">
<translate>
Add your favorite talk
</translate>
</a>
</div>
</Container>
</div>
);
}
}

module.exports = Videos;

39 changes: 32 additions & 7 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@
* LICENSE file in the root directory of this source tree.
*/

/* List of talks & videos */

const videoTypes = {
YOUTUBE: 'youtube',
IFRAME: 'iframe',
};

const videos = [
{
title: 'Learn how to test JavaScript with Jest',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we swap this one out with a different one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought it was removed from main page only to be included here.

description: 'In this [video](https://egghead.io/lessons/javascript-test-javascript-with-jest) by [Kent C. Dodds](https://twitter.com/kentcdodds) you will learn how to install Jest and write your first unit test.',
type: videoTypes.IFRAME,
url: 'https://fast.wistia.net/embed/iframe/78j73pyz17',
},
{
title: 'Test React applications using Enzyme & Jest',
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.',
type: videoTypes.YOUTUBE,
url: 'https://www.youtube.com/embed/8Ww2QBVIw0I?rel=0',
},
];

/* List of projects/orgs using your project for the users page */
const users = [
{
Expand Down Expand Up @@ -257,15 +279,17 @@ const siteConfig = {
projectName: 'jest',
repo: 'facebook/jest',
users,
videos,
videoTypes,
editUrl: repoUrl + '/edit/master/docs/',
headerLinks: [
{doc: 'getting-started', label: 'Docs'},
{doc: 'api', label: 'API'},
{page: 'help', label: 'Help'},
{blog: true, label: 'Blog'},
{languages: true},
{search: true},
{href: repoUrl, label: 'GitHub'},
{ doc: 'getting-started', label: 'Docs' },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert these whitespace changes? Please run yarn lint!

Copy link
Copy Markdown
Contributor Author

@bogas04 bogas04 Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer I think there's no lint script. 🤷🏽‍♂️

{ doc: 'api', label: 'API' },
{ page: 'help', label: 'Help' },
{ blog: true, label: 'Blog' },
{ languages: true },
{ search: true },
{ href: repoUrl, label: 'GitHub' },
],
headerIcon: 'img/jest.svg',
footerIcon: 'img/jest-outline.svg',
Expand All @@ -284,6 +308,7 @@ const siteConfig = {
},
scripts: ['https://buttons.github.io/buttons.js'],
repoUrl,
siteConfigUrl: 'https://github.com/facebook/jest/edit/master/website/siteConfig.js',
};

module.exports = siteConfig;