Mailspring/internal_packages/message-autoload-images/lib/autoload-images-header.jsx
Ben Gotow 3fc6582718 es6(*): convert 20+ source files used in example packages to ES2016
There could be a few lurking bugs. Please test!
2016-02-29 18:47:22 -08:00

35 lines
997 B
JavaScript

import React from 'react';
import AutoloadImagesStore from './autoload-images-store';
import Actions from './autoload-images-actions';
import {Message} from 'nylas-exports';
export default class AutoloadImagesHeader extends React.Component {
static displayName = 'AutoloadImagesHeader';
static propTypes = {
message: React.PropTypes.instanceOf(Message).isRequired,
}
render() {
const {message} = this.props;
if (AutoloadImagesStore.shouldBlockImagesIn(message) === false) {
return (
<div></div>
);
}
return (
<div className="autoload-images-header">
<a className="option" onClick={ ()=> Actions.temporarilyEnableImages(message) }>
Show Images
</a>
<span style={{paddingLeft: 10, paddingRight: 10}}>|</span>
<a className="option" onClick={ ()=> Actions.permanentlyEnableImages(message) }>
Always show images from {message.fromContact().toString()}
</a>
</div>
);
}
}