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') {
|
||||
return `
|
||||
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
||||
<p><strong>From:</strong> ${email.from}</p>
|
||||
<p><strong>Date:</strong> ${date}</p>
|
||||
<p><strong>Subject:</strong> ${email.subject}</p>
|
||||
<p><strong>To:</strong> ${Array.isArray(email.to) ? email.to.join(', ') : email.to}</p>
|
||||
<br/>
|
||||
<div class="prose max-w-none">${content}</div>
|
||||
<div class="email-content">
|
||||
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
||||
<p><strong>From:</strong> ${email.from}</p>
|
||||
<p><strong>Date:</strong> ${date}</p>
|
||||
<p><strong>Subject:</strong> ${email.subject}</p>
|
||||
<p><strong>To:</strong> ${Array.isArray(email.to) ? email.to.join(', ') : email.to}</p>
|
||||
<br/>
|
||||
<div class="prose max-w-none">${content}</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
return `
|
||||
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
||||
<p>On ${date}, ${email.from} wrote:</p>
|
||||
<div class="prose max-w-none">${content}</div>
|
||||
<div class="email-content">
|
||||
<div class="prose max-w-none" style="border-left: 2px solid #ccc; padding-left: 1em; margin-left: 0.5em;">
|
||||
<p>On ${date}, ${email.from} wrote:</p>
|
||||
<div class="prose max-w-none">${content}</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
@ -51,13 +51,6 @@ export default function ComposeEmail({
|
||||
}: ComposeEmailProps) {
|
||||
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>) => {
|
||||
if (composeBodyRef.current) {
|
||||
setComposeBody(composeBodyRef.current.innerHTML);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user