mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
30 lines
856 B
CoffeeScript
30 lines
856 B
CoffeeScript
path = require 'path'
|
|
React = require 'react'
|
|
FileUpload = require './file-upload'
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
class ImageFileUpload extends FileUpload
|
|
@displayName: 'ImageFileUpload'
|
|
|
|
@propTypes:
|
|
uploadData: React.PropTypes.object
|
|
|
|
render: =>
|
|
<div className="file-wrap file-image-wrap file-upload">
|
|
<div className="file-action-icon" onClick={@_onClickRemove}>
|
|
<RetinaImg name="image-cancel-button.png" mode={RetinaImg.Mode.ContentPreserve}/>
|
|
</div>
|
|
|
|
<div className="file-preview">
|
|
<div className="file-name-container">
|
|
<div className="file-name">{@props.upload.filename}</div>
|
|
</div>
|
|
|
|
<img src={@props.upload.targetPath} onDragStart={@_onDragStart}/>
|
|
</div>
|
|
</div>
|
|
|
|
_onDragStart: (event) ->
|
|
event.preventDefault()
|
|
|
|
module.exports = ImageFileUpload
|