From 384a6da21eec69eb7c73d475a7f84bc0ca040f3c Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 21 Apr 2025 21:02:31 +0200 Subject: [PATCH] mail page fix design --- app/courrier/page.tsx | 62 ++++++++++++------------------------- components/ComposeEmail.tsx | 19 ++---------- 2 files changed, 23 insertions(+), 58 deletions(-) diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index b1647b2e..d7341a89 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -370,20 +370,11 @@ function getReplyBody(email: Email, type: 'reply' | 'reply-all' | 'forward' = 'r decodedContent = convertCharset(partBody, partHeaderInfo.charset); } - // Preserve the original MIME structure if (partHeaderInfo.contentType.includes('text/html')) { - content = ` -
- ${decodedContent} -
- `; + content = decodedContent; break; } else if (partHeaderInfo.contentType.includes('text/plain') && !content) { - content = ` -
-
${decodedContent}
-
- `; + content = decodedContent; } } catch (error) { console.error('Error decoding email part:', error); @@ -392,54 +383,43 @@ function getReplyBody(email: Email, type: 'reply' | 'reply-all' | 'forward' = 'r } else { // Handle simple email try { - let decodedBody = ''; if (headerInfo.encoding === 'base64') { - decodedBody = decodeBase64(body, headerInfo.charset); + content = decodeBase64(body, headerInfo.charset); } else if (headerInfo.encoding === 'quoted-printable') { - decodedBody = decodeQuotedPrintable(body, headerInfo.charset); + content = decodeQuotedPrintable(body, headerInfo.charset); } else { - decodedBody = convertCharset(body, headerInfo.charset); + content = convertCharset(body, headerInfo.charset); } - - content = ` -
- ${headerInfo.contentType.includes('text/html') ? decodedBody : `
${decodedBody}
`} -
- `; } catch (error) { console.error('Error decoding email body:', error); content = body; } } - // Clean and sanitize HTML content while preserving structure + // Clean and sanitize HTML content content = cleanHtml(content); - // Format the reply/forward content with proper structure and direction + // Format the reply/forward content let formattedContent = ''; if (type === 'forward') { formattedContent = ` -
-