2015-06-12 02:52:49 +08:00
|
|
|
path = require 'path'
|
|
|
|
React = require 'react'
|
|
|
|
FileUpload = require './file-upload'
|
2015-06-16 09:48:17 +08:00
|
|
|
{RetinaImg, DraggableImg} = require 'nylas-component-kit'
|
2015-06-12 02:52:49 +08:00
|
|
|
|
|
|
|
class ImageFileUpload extends FileUpload
|
|
|
|
@displayName: 'ImageFileUpload'
|
|
|
|
|
|
|
|
@propTypes:
|
|
|
|
uploadData: React.PropTypes.object
|
|
|
|
|
|
|
|
render: =>
|
2015-07-16 04:15:05 +08:00
|
|
|
<div className="file-wrap file-image-wrap file-upload">
|
|
|
|
<div className="file-action-icon" onClick={@_onClickRemove}>
|
|
|
|
<RetinaImg name="image-cancel-button.png"/>
|
2015-06-18 07:03:50 +08:00
|
|
|
</div>
|
2015-06-12 02:52:49 +08:00
|
|
|
|
2015-07-16 04:15:05 +08:00
|
|
|
<div className="file-preview">
|
|
|
|
<div className="file-name-container">
|
|
|
|
<div className="file-name">{@props.uploadData.fileName}</div>
|
2015-06-20 02:31:27 +08:00
|
|
|
</div>
|
2015-07-16 04:15:05 +08:00
|
|
|
|
2015-06-16 09:48:17 +08:00
|
|
|
<DraggableImg src={@props.uploadData.filePath} />
|
2015-06-12 02:52:49 +08:00
|
|
|
</div>
|
|
|
|
|
2015-07-16 04:15:05 +08:00
|
|
|
<div className={"progress-bar-wrap state-#{@props.uploadData.state}"}>
|
|
|
|
<span className="progress-foreground" style={@_uploadProgressStyle()}></span>
|
|
|
|
</div>
|
2015-06-12 02:52:49 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
module.exports = ImageFileUpload
|