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,15 @@
import React from 'react';
import styles from './Page.module.scss';
const Page = ({ title, children }) => (
<div className={styles['page']}>
<div className={styles['page__inner']}>
{ title && <h1 className={styles['page__title']}>{title}</h1>}
<div className={styles['page__body']}>
{children}
</div>
</div>
</div>
);
export default Page;

View File

@@ -0,0 +1,49 @@
@import '../../assets/scss/variables';
@import '../../assets/scss/mixins';
.page {
@include margin-bottom(2);
&__inner {
padding: 25px 20px;
}
&__title {
font-size: $typographic-base-font-size * 2.5;
font-weight: 600;
@include line-height(2);
@include margin-top(0);
@include margin-bottom(1.45);
}
&__body {
font-size: $typographic-base-font-size;
@include line-height(1);
@include margin(0, 0, 1);
}
}
@include breakpoint-sm {
.page {
lost-column: 7/12;
&__inner {
padding: 30px 20px;
}
}
}
@include breakpoint-md {
.page {
lost-column: 2/3;
&__inner {
padding: 40px 35px;
}
}
}

View File

@@ -0,0 +1,15 @@
import React from 'react';
import renderer from 'react-test-renderer';
import Page from './Page';
describe('Page', () => {
const props = {
children: 'test',
title: 'test',
};
it('renders correctly', () => {
const tree = renderer.create(<Page {...props} />).toJSON();
expect(tree).toMatchSnapshot();
});
});

View File

@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Page renders correctly 1`] = `
<div
className="page"
>
<div
className="page__inner"
>
<h1
className="page__title"
>
test
</h1>
<div
className="page__body"
>
test
</div>
</div>
</div>
`;

View File

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