Skip to content

Commit a91a8eb

Browse files
committed
Importing UploadIcon.svg as Component
This keeps the original SVG file rather than inlining it as in JakeHartnell#23. The image is passed instead as a the `src` property to <img />. This fixes JakeHartnell#22.
1 parent b549957 commit a91a8eb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/component/index.css

-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@
7474
.fileContainer .uploadIcon {
7575
width: 50px;
7676
height: 50px;
77-
background: url(UploadIcon.svg);
78-
-webkit-background-size: cover;
79-
background-size: cover;
8077
}
8178

8279
.fileContainer .uploadPicturesWrapper {

src/component/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import './index.css';
44
import FlipMove from 'react-flip-move';
5+
import UploadIcon from './UploadIcon.svg';
56

67
const styles = {
78
display: "flex",
@@ -82,7 +83,8 @@ class ReactImageUploadComponent extends React.PureComponent {
8283
*/
8384
renderIcon() {
8485
if (this.props.withIcon) {
85-
return <div className="uploadIcon"/>;
86+
return <img src={UploadIcon} className="uploadIcon"
87+
alt="Upload Icon" />;
8688
}
8789
}
8890

0 commit comments

Comments
 (0)