diff --git a/src/components/common/FileInfo.js b/src/components/common/FileInfo.js index a3814dc..703614d 100644 --- a/src/components/common/FileInfo.js +++ b/src/components/common/FileInfo.js @@ -1,5 +1,5 @@ import React, { Component, PropTypes } from 'react'; -import { Col, Glyphicon } from 'react-bootstrap'; +import { Col, Glyphicon, Modal, Button } from 'react-bootstrap'; import filesize from 'filesize'; export default class FileUploadItem extends Component { @@ -15,8 +15,23 @@ export default class FileUploadItem extends Component { width: "150px" }; + state = { + show: false + }; + + showModal = (show) => { + this.setState({ show: show }); + }; + + deleteFile = () => { + let { onClick } = this.props; + onClick(); + this.showModal(false); + }; + render() { let { file, height, width, onClick } = this.props; + let { show } = this.state; const containerStyle = { margin: "auto", @@ -64,12 +79,28 @@ export default class FileUploadItem extends Component { return ( + + + Delete file + + + Are you sure that you want to delete this file? + + + + + +

{filename}

-
+
this.showModal(true)} style={trashContainerStyle}>