mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +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
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { localized } from 'mailspring-exports';
|
|
import { RetinaImg } from 'mailspring-component-kit';
|
|
|
|
export const QuotedTextControl: React.FunctionComponent<{
|
|
quotedTextPresent: boolean;
|
|
quotedTextHidden: boolean;
|
|
onUnhide: () => void;
|
|
onRemove: () => void;
|
|
}> = props => {
|
|
if (!props.quotedTextPresent || !props.quotedTextHidden) {
|
|
return null;
|
|
}
|
|
return (
|
|
<a
|
|
className="quoted-text-control"
|
|
onMouseDown={e => {
|
|
if (e.target instanceof HTMLElement && e.target.closest('.remove-quoted-text')) return;
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
props.onUnhide();
|
|
}}
|
|
>
|
|
<span className="dots">•••</span>
|
|
<span
|
|
className="remove-quoted-text"
|
|
onMouseUp={e => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
props.onRemove();
|
|
}}
|
|
>
|
|
<RetinaImg
|
|
title={localized('Remove quoted text')}
|
|
name="image-cancel-button.png"
|
|
mode={RetinaImg.Mode.ContentPreserve}
|
|
/>
|
|
</span>
|
|
</a>
|
|
);
|
|
};
|