2015-11-07 07:53:21 +08:00
React = require 'react'
AutoloadImagesStore = require './autoload-images-store'
Actions = require './autoload-images-actions'
2015-12-01 09:11:57 +08:00
{Message} = require 'nylas-exports'
2015-11-07 07:53:21 +08:00
class AutoloadImagesHeader extends React.Component
@displayName: 'AutoloadImagesHeader'
2015-12-01 09:11:57 +08:00
@propTypes:
message: React.PropTypes.instanceOf(Message).isRequired
2015-11-07 07:53:21 +08:00
constructor: (@props) ->
render: =>
if AutoloadImagesStore.shouldBlockImagesIn(@props.message)
<div className="autoload-images-header">
<a className="option" onClick={ => Actions.temporarilyEnableImages(@props.message) }>Show Images</a>
<span style={paddingLeft: 10, paddingRight: 10}>|</span>
<a className="option" onClick={ => Actions.permanentlyEnableImages(@props.message) }>Always show images from {@props.message.fromContact().toString()}</a>
</div>
else
<div></div>
module.exports = AutoloadImagesHeader