3
0
mirror of https://github.com/Qortal/q-mail.git synced 2025-02-11 17:55:56 +00:00

fix issues

This commit is contained in:
PhilReact 2024-01-13 19:46:59 +02:00
parent ff1a8213b7
commit 3b81fd9c19
5 changed files with 24 additions and 7 deletions

View File

@ -5,7 +5,7 @@ export function convertQortalLinks(inputHtml: string) {
// Replace matches in inputHtml with formatted anchor tag
var outputHtml = inputHtml.replace(regex, function (match) {
return `<a href="${match}" className="qortal-link">${match}</a>`;
return `<a href="${match}" class="qortal-link">${match}</a>`;
});
return outputHtml;

1
src/global.d.ts vendored
View File

@ -39,6 +39,7 @@ interface QortalRequestOptions {
message?: string
query?: string
prefix?: boolean
qortalLink?: string
}
declare function qortalRequest(options: QortalRequestOptions): Promise<any>

View File

@ -175,3 +175,10 @@ body::-webkit-scrollbar-thumb:hover {
}
.qortal-link {
color: #24A1FF;
}
.reply-other .qortal-link {
color: #005EA5
}

View File

@ -105,7 +105,6 @@ export const ShowMessageV2 = ({
cleanHTML = DOMPurify.sanitize(message.htmlContent);
}
return (
<Box
sx={{
@ -292,10 +291,18 @@ export const ShowMessageV2 = ({
gap: "8px",
}}
>
{message?.generalData?.threadV2?.map((msg: any) => {
if (!msg?.data) return null;
return <ShowMessageV2Replies message={msg?.data} />;
})}
{[...message?.generalData?.threadV2] // Create a copy of the array
.sort((a, b) => {
// Sort messages based on createdAt in descending order
if (!a.data || !b.data) return 0;
return b.data.createdAt - a.data.createdAt;
})
.map(msg => {
// Render each message using a component
if (!msg?.data) return null;
return <ShowMessageV2Replies key={msg.data.id} message={msg.data} />;
})
}
{message?.htmlContent && (
<div dangerouslySetInnerHTML={{ __html: cleanHTML }} />
)}

View File

@ -66,7 +66,9 @@ export const ShowMessageV2Replies = ({
padding: !isUser ? '0px 15px' : 'unset',
flexShrink: 0,
width: '100%'
}}>
}}
className={isUser ? "" : "reply-other"}
>
<Box
sx={{
display: "flex",