mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
39 lines
860 B
JavaScript
39 lines
860 B
JavaScript
import { localized, React, PropTypes } from 'mailspring-exports';
|
|
|
|
class TemplateStatusBar extends React.Component {
|
|
static displayName = 'TemplateStatusBar';
|
|
|
|
static propTypes = {
|
|
draft: PropTypes.object.isRequired,
|
|
};
|
|
|
|
_usingTemplate({ draft }) {
|
|
return (
|
|
draft &&
|
|
draft.bodyEditorState &&
|
|
draft.bodyEditorState.document.getInlinesByType('templatevar').size > 0
|
|
);
|
|
}
|
|
|
|
render() {
|
|
if (!this._usingTemplate(this.props)) {
|
|
return <div />;
|
|
}
|
|
return (
|
|
<div className="template-status-bar">
|
|
{localized(
|
|
'Press "tab" to quickly move between the blanks - highlighting will not be visible to recipients.'
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
TemplateStatusBar.containerStyles = {
|
|
textAlign: 'center',
|
|
width: 580,
|
|
margin: 'auto',
|
|
};
|
|
|
|
export default TemplateStatusBar;
|