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,10 @@
import React from 'react';
import styles from './Icon.module.scss';
const Icon = ({ icon }) => (
<svg className={styles['icon']} viewBox={icon.viewBox}>
<path d={icon.path} />
</svg>
);
export default Icon;

View File

@@ -0,0 +1,19 @@
.icon {
display: inline-block;
width: 1em;
height: 1em;
stroke-width: 0;
stroke: currentColor;
fill: currentColor;
font-style: normal;
font-weight: normal;
speak: none;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: .2em;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@@ -0,0 +1,17 @@
import React from 'react';
import renderer from 'react-test-renderer';
import Icon from './Icon';
describe('Icon', () => {
const props = {
icon: {
viewBox: '0 0 0 0',
path: '',
}
};
it('renders correctly', () => {
const tree = renderer.create(<Icon {...props} />).toJSON();
expect(tree).toMatchSnapshot();
});
});

View File

@@ -0,0 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Icon renders correctly 1`] = `
<svg
className="icon"
viewBox="0 0 0 0"
>
<path
d=""
/>
</svg>
`;

View File

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