mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-08-08 02:18:11 +02:00
Upgrade to Gatsby v2
This commit is contained in:
15
src/components/Page/Page.js
Normal file
15
src/components/Page/Page.js
Normal 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;
|
49
src/components/Page/Page.module.scss
Normal file
49
src/components/Page/Page.module.scss
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
15
src/components/Page/Page.test.js
Normal file
15
src/components/Page/Page.test.js
Normal 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();
|
||||
});
|
||||
});
|
22
src/components/Page/__snapshots__/Page.test.js.snap
Normal file
22
src/components/Page/__snapshots__/Page.test.js.snap
Normal 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>
|
||||
`;
|
1
src/components/Page/index.js
Normal file
1
src/components/Page/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './Page';
|
Reference in New Issue
Block a user