Upgrade to Gatsby v2

This commit is contained in:
alxshelepenok
2018-11-09 20:08:48 +03:00
parent e83dfc6dff
commit 8b92891329
204 changed files with 18708 additions and 3904 deletions

View File

@@ -0,0 +1,11 @@
import React from 'react';
import moment from 'moment';
import styles from './Meta.module.scss';
const Meta = ({ date }) => (
<div className={styles['meta']}>
<p className={styles['meta__date']}>Published {moment(date).format('D MMM YYYY')}</p>
</div>
);
export default Meta;

View File

@@ -0,0 +1,9 @@
@import '../../../assets/scss/variables';
@import '../../../assets/scss/mixins';
.meta {
&__date {
font-style: italic;
}
}

View File

@@ -0,0 +1,14 @@
import React from 'react';
import renderer from 'react-test-renderer';
import Meta from './Meta';
describe('Meta', () => {
it('renders correctly', () => {
const props = {
date: '2016-09-01T23:46:37.121Z'
};
const tree = renderer.create(<Meta {...props} />).toJSON();
expect(tree).toMatchSnapshot();
});
});

View File

@@ -0,0 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Meta renders correctly 1`] = `
<div
className="meta"
>
<p
className="meta__date"
>
Published
2 Sep 2016
</p>
</div>
`;

View File

@@ -0,0 +1 @@
export { default } from './Meta';