mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
42 lines
1.1 KiB
TypeScript
42 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>
|
||
|
);
|
||
|
};
|