Skip to content
This repository was archived by the owner on Jun 5, 2022. It is now read-only.

Commit 959b107

Browse files
authored
Merge pull request #23 from joshuaai/svg-import
Importing UploadIcon.svg as Component
2 parents b549957 + a91a8eb commit 959b107

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/component/index.css

Lines changed: 0 additions & 3 deletions
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

Lines changed: 3 additions & 1 deletion
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)