index.js 493 Bytes
import React from 'react'
import { ReactSVG } from 'react-svg'

const style = {
  width: '14px',
  height: '18px',
  marginRight: '5px'
}

function getAll(context) {
  return context.keys().reduce((o, modulePath, i) => {
    o[modulePath.replace(/.\/|.svg/g, '')] = props => {
      return <ReactSVG style={style} src={context.keys().map(context)[i]} {...props} />;
    };
    return o;
  }, {});
}

const IconPack = getAll(require.context('./icons', false, /\.svg$/))

export default IconPack