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: =>
|
|
|
|
<div className="image-file-upload #{@props.uploadData.state}">
|
2015-06-18 07:03:50 +08:00
|
|
|
<div className="attachment-file-actions">
|
2015-06-12 02:52:49 +08:00
|
|
|
<div className="attachment-icon" onClick={@_onClickRemove}>
|
2015-06-18 07:03:50 +08:00
|
|
|
<RetinaImg className="image-remove-icon" name="image-cancel-button.png"/>
|
2015-06-12 02:52:49 +08:00
|
|
|
</div>
|
2015-06-18 07:03:50 +08:00
|
|
|
</div>
|
2015-06-12 02:52:49 +08:00
|
|
|
|
|
|
|
<div className="attachment-preview" >
|
2015-06-20 02:31:27 +08:00
|
|
|
<div className="attachment-name-container">
|
|
|
|
<div className="attachment-name">{@props.uploadData.fileName}</div>
|
|
|
|
</div>
|
2015-06-16 09:48:17 +08:00
|
|
|
<DraggableImg src={@props.uploadData.filePath} />
|
2015-06-12 02:52:49 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<span className="attachment-upload-progress" style={@_uploadProgressStyle()}></span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
module.exports = ImageFileUpload
|