From a91a8eb6160a02a1be32d14b233d6e0123281ccf Mon Sep 17 00:00:00 2001 From: joshuaai Date: Sat, 31 Mar 2018 08:45:15 +0000 Subject: [PATCH] Importing UploadIcon.svg as Component This keeps the original SVG file rather than inlining it as in #23. The image is passed instead as a the `src` property to . This fixes #22. --- src/component/index.css | 3 --- src/component/index.js | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/component/index.css b/src/component/index.css index 3f169fb2..c92ac262 100644 --- a/src/component/index.css +++ b/src/component/index.css @@ -74,9 +74,6 @@ .fileContainer .uploadIcon { width: 50px; height: 50px; - background: url(UploadIcon.svg); - -webkit-background-size: cover; - background-size: cover; } .fileContainer .uploadPicturesWrapper { diff --git a/src/component/index.js b/src/component/index.js index ec7a1626..653fe7ff 100644 --- a/src/component/index.js +++ b/src/component/index.js @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import './index.css'; import FlipMove from 'react-flip-move'; +import UploadIcon from './UploadIcon.svg'; const styles = { display: "flex", @@ -82,7 +83,8 @@ class ReactImageUploadComponent extends React.PureComponent { */ renderIcon() { if (this.props.withIcon) { - return
; + return Upload Icon; } }