mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-08-03 16:13:01 +02:00
Upgrade to Gatsby v2
This commit is contained in:
15
src/components/Layout/Layout.js
Normal file
15
src/components/Layout/Layout.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import Helmet from 'react-helmet';
|
||||
import styles from './Layout.module.scss';
|
||||
|
||||
const Layout = ({ children, title, description }) => (
|
||||
<div className={styles.layout}>
|
||||
<Helmet>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
</Helmet>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Layout;
|
6
src/components/Layout/Layout.module.scss
Normal file
6
src/components/Layout/Layout.module.scss
Normal file
@@ -0,0 +1,6 @@
|
||||
@import '../../assets/scss/variables';
|
||||
@import '../../assets/scss/mixins';
|
||||
|
||||
.layout {
|
||||
lost-center: $layout-width;
|
||||
}
|
16
src/components/Layout/Layout.test.js
Normal file
16
src/components/Layout/Layout.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import Layout from './Layout';
|
||||
|
||||
describe('Layout', () => {
|
||||
const props = {
|
||||
children: 'test',
|
||||
description: 'test',
|
||||
title: 'test'
|
||||
};
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer.create(<Layout {...props} />).toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
});
|
9
src/components/Layout/__snapshots__/Layout.test.js.snap
Normal file
9
src/components/Layout/__snapshots__/Layout.test.js.snap
Normal file
@@ -0,0 +1,9 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Layout renders correctly 1`] = `
|
||||
<div
|
||||
className="layout"
|
||||
>
|
||||
test
|
||||
</div>
|
||||
`;
|
1
src/components/Layout/index.js
Normal file
1
src/components/Layout/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './Layout';
|
Reference in New Issue
Block a user