mail page fix
This commit is contained in:
parent
536ff35b34
commit
1cb76c1c2f
@ -398,20 +398,24 @@ function getReplyBody(email: Email, type: 'reply' | 'reply-all' | 'forward'): st
|
|||||||
|
|
||||||
if (type === 'forward') {
|
if (type === 'forward') {
|
||||||
return `
|
return `
|
||||||
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
<div class="email-content">
|
||||||
<p><strong>From:</strong> ${email.from}</p>
|
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
||||||
<p><strong>Date:</strong> ${date}</p>
|
<p><strong>From:</strong> ${email.from}</p>
|
||||||
<p><strong>Subject:</strong> ${email.subject}</p>
|
<p><strong>Date:</strong> ${date}</p>
|
||||||
<p><strong>To:</strong> ${Array.isArray(email.to) ? email.to.join(', ') : email.to}</p>
|
<p><strong>Subject:</strong> ${email.subject}</p>
|
||||||
<br/>
|
<p><strong>To:</strong> ${Array.isArray(email.to) ? email.to.join(', ') : email.to}</p>
|
||||||
<div class="prose max-w-none">${content}</div>
|
<br/>
|
||||||
|
<div class="prose max-w-none">${content}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} else {
|
} else {
|
||||||
return `
|
return `
|
||||||
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
<div class="email-content">
|
||||||
<p>On ${date}, ${email.from} wrote:</p>
|
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
||||||
<div class="prose max-w-none">${content}</div>
|
<p>On ${date}, ${email.from} wrote:</p>
|
||||||
|
<div class="prose max-w-none">${content}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,13 +51,6 @@ export default function ComposeEmail({
|
|||||||
}: ComposeEmailProps) {
|
}: ComposeEmailProps) {
|
||||||
const composeBodyRef = useRef<HTMLDivElement>(null);
|
const composeBodyRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
// Update the contentEditable div when composeBody changes
|
|
||||||
useEffect(() => {
|
|
||||||
if (composeBodyRef.current && composeBody) {
|
|
||||||
composeBodyRef.current.innerHTML = composeBody;
|
|
||||||
}
|
|
||||||
}, [composeBody]);
|
|
||||||
|
|
||||||
const handleInput = (e: React.FormEvent<HTMLDivElement>) => {
|
const handleInput = (e: React.FormEvent<HTMLDivElement>) => {
|
||||||
if (composeBodyRef.current) {
|
if (composeBodyRef.current) {
|
||||||
setComposeBody(composeBodyRef.current.innerHTML);
|
setComposeBody(composeBodyRef.current.innerHTML);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user