Loëck Vézien
7 years ago
22 changed files with 165 additions and 153 deletions
@ -1,19 +0,0 @@ |
|||
// @flow
|
|||
|
|||
import React from 'react' |
|||
import styled from 'styled-components' |
|||
import { fontSize, color } from 'styled-system' |
|||
import FontAwesomeIcon from '@fortawesome/react-fontawesome' |
|||
|
|||
const Container = styled.span` |
|||
${fontSize}; |
|||
${color}; |
|||
display: inline-flex; |
|||
position: relative; |
|||
` |
|||
|
|||
export default ({ name, ...props }: { name: string | Object }) => ( |
|||
<Container {...props}> |
|||
<FontAwesomeIcon icon={name} /> |
|||
</Container> |
|||
) |
@ -1,36 +0,0 @@ |
|||
// @flow
|
|||
|
|||
import React from 'react' |
|||
import { storiesOf } from '@storybook/react' |
|||
import { text, number } from '@storybook/addon-knobs' |
|||
|
|||
import Icon from 'components/base/Icon' |
|||
|
|||
const stories = storiesOf('Components/Icon', module) |
|||
|
|||
const Wrapper = ({ children }: { children: any }) => ( |
|||
<div> |
|||
<div style={{ opacity: 0.2 }}> |
|||
(Change the icon value with{' '} |
|||
<a |
|||
href="https://fontawesome.com/icons?d=gallery&s=regular,solid&m=free" |
|||
target="_blank" |
|||
style={{ cursor: 'pointer' }} |
|||
> |
|||
FontAwesome |
|||
</a>{' '} |
|||
icon) |
|||
</div> |
|||
{children} |
|||
</div> |
|||
) |
|||
|
|||
stories.add('basic', () => ( |
|||
<Wrapper> |
|||
<Icon |
|||
color={text('color', 'black')} |
|||
fontSize={number('fontSize', 5)} |
|||
name={text('icon', 'check')} |
|||
/> |
|||
</Wrapper> |
|||
)) |
@ -0,0 +1,10 @@ |
|||
import React from 'react' |
|||
|
|||
export default props => ( |
|||
<svg viewBox="0 0 384 512" {...props}> |
|||
<path |
|||
fill="currentColor" |
|||
d="M323.1 441l53.9-53.9c9.4-9.4 9.4-24.5 0-33.9L279.8 256l97.2-97.2c9.4-9.4 9.4-24.5 0-33.9L323.1 71c-9.4-9.4-24.5-9.4-33.9 0L192 168.2 94.8 71c-9.4-9.4-24.5-9.4-33.9 0L7 124.9c-9.4 9.4-9.4 24.5 0 33.9l97.2 97.2L7 353.2c-9.4 9.4-9.4 24.5 0 33.9L60.9 441c9.4 9.4 24.5 9.4 33.9 0l97.2-97.2 97.2 97.2c9.3 9.3 24.5 9.3 33.9 0z" |
|||
/> |
|||
</svg> |
|||
) |
@ -0,0 +1,10 @@ |
|||
import React from 'react' |
|||
|
|||
export default props => ( |
|||
<svg viewBox="0 0 576 512" {...props}> |
|||
<path |
|||
fill="currentColor" |
|||
d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" |
|||
/> |
|||
</svg> |
|||
) |
@ -0,0 +1,10 @@ |
|||
import React from 'react' |
|||
|
|||
export default props => ( |
|||
<svg viewBox="0 0 448 512" {...props}> |
|||
<path |
|||
fill="currentColor" |
|||
d="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z" |
|||
/> |
|||
</svg> |
|||
) |
@ -1,7 +1,7 @@ |
|||
const plugins = require('./plugins') |
|||
|
|||
const config = { |
|||
plugins, |
|||
plugins: plugins('main'), |
|||
} |
|||
|
|||
module.exports = config |
|||
|
@ -1,12 +1,29 @@ |
|||
const webpack = require('webpack') |
|||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') |
|||
|
|||
require('../src/globals') |
|||
|
|||
module.exports = [ |
|||
new webpack.DefinePlugin({ |
|||
__GLOBAL_STYLES__: JSON.stringify(__GLOBAL_STYLES__), |
|||
__DEV__, |
|||
__PROD__, |
|||
'process.env.NODE_ENV': JSON.stringify(__ENV__), |
|||
}), |
|||
] |
|||
const { BUNDLE_ANALYZER } = process.env |
|||
|
|||
module.exports = type => { |
|||
const plugins = [ |
|||
new webpack.DefinePlugin({ |
|||
__GLOBAL_STYLES__: JSON.stringify(__GLOBAL_STYLES__), |
|||
__DEV__, |
|||
__PROD__, |
|||
'process.env.NODE_ENV': JSON.stringify(__ENV__), |
|||
}), |
|||
] |
|||
|
|||
if (BUNDLE_ANALYZER) { |
|||
plugins.push( |
|||
new BundleAnalyzerPlugin({ |
|||
analyzerMode: 'static', |
|||
openAnalyzer: false, |
|||
reportFilename: `../report-${type}.html`, |
|||
}), |
|||
) |
|||
} |
|||
|
|||
return plugins |
|||
} |
|||
|
Loading…
Reference in new issue