mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-18 05:58:11 +08:00
21bc2ef398
* Move to Slate 44, start using types more extensively in Composer * More types and cleanup * Expose the editor object to the draft session, try exposing editor to session * Bump to Slate 45 for https://github.com/ianstormtaylor/slate/pull/2225/files * How did the unsubscribe plugin get in here * Bump Slate types, fix TS errors, start testing * Polish * Fix issue with emails not shrinking when you close quoted text * Fix the “remove quoted text” button * More polish * Fix issues with PR, improve typings * Remove spurious log
39 lines
963 B
TypeScript
39 lines
963 B
TypeScript
import React from 'react';
|
|
import { localized, PropTypes, Message, MessageWithEditorState } from 'mailspring-exports';
|
|
|
|
class TemplateStatusBar extends React.Component<{ draft: MessageWithEditorState }> {
|
|
static displayName = 'TemplateStatusBar';
|
|
|
|
static containerStyles = {
|
|
textAlign: 'center',
|
|
width: 580,
|
|
margin: 'auto',
|
|
};
|
|
|
|
static propTypes = {
|
|
draft: PropTypes.object.isRequired,
|
|
};
|
|
|
|
_usingTemplate(draft: MessageWithEditorState) {
|
|
return (
|
|
draft &&
|
|
draft.bodyEditorState &&
|
|
draft.bodyEditorState.document.getInlinesByType('templatevar').size > 0
|
|
);
|
|
}
|
|
|
|
render() {
|
|
if (!this._usingTemplate(this.props.draft)) {
|
|
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>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default TemplateStatusBar;
|