mirror of
https://github.com/Qortal/q-mail.git
synced 2025-02-12 02:05:56 +00:00
fix issues
This commit is contained in:
parent
ff1a8213b7
commit
3b81fd9c19
@ -5,7 +5,7 @@ export function convertQortalLinks(inputHtml: string) {
|
|||||||
|
|
||||||
// Replace matches in inputHtml with formatted anchor tag
|
// Replace matches in inputHtml with formatted anchor tag
|
||||||
var outputHtml = inputHtml.replace(regex, function (match) {
|
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;
|
return outputHtml;
|
||||||
|
1
src/global.d.ts
vendored
1
src/global.d.ts
vendored
@ -39,6 +39,7 @@ interface QortalRequestOptions {
|
|||||||
message?: string
|
message?: string
|
||||||
query?: string
|
query?: string
|
||||||
prefix?: boolean
|
prefix?: boolean
|
||||||
|
qortalLink?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
declare function qortalRequest(options: QortalRequestOptions): Promise<any>
|
declare function qortalRequest(options: QortalRequestOptions): Promise<any>
|
||||||
|
@ -175,3 +175,10 @@ body::-webkit-scrollbar-thumb:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.qortal-link {
|
||||||
|
color: #24A1FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reply-other .qortal-link {
|
||||||
|
color: #005EA5
|
||||||
|
}
|
@ -105,7 +105,6 @@ export const ShowMessageV2 = ({
|
|||||||
cleanHTML = DOMPurify.sanitize(message.htmlContent);
|
cleanHTML = DOMPurify.sanitize(message.htmlContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -292,10 +291,18 @@ export const ShowMessageV2 = ({
|
|||||||
gap: "8px",
|
gap: "8px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{message?.generalData?.threadV2?.map((msg: any) => {
|
{[...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;
|
if (!msg?.data) return null;
|
||||||
return <ShowMessageV2Replies message={msg?.data} />;
|
return <ShowMessageV2Replies key={msg.data.id} message={msg.data} />;
|
||||||
})}
|
})
|
||||||
|
}
|
||||||
{message?.htmlContent && (
|
{message?.htmlContent && (
|
||||||
<div dangerouslySetInnerHTML={{ __html: cleanHTML }} />
|
<div dangerouslySetInnerHTML={{ __html: cleanHTML }} />
|
||||||
)}
|
)}
|
||||||
|
@ -66,7 +66,9 @@ export const ShowMessageV2Replies = ({
|
|||||||
padding: !isUser ? '0px 15px' : 'unset',
|
padding: !isUser ? '0px 15px' : 'unset',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
width: '100%'
|
width: '100%'
|
||||||
}}>
|
}}
|
||||||
|
className={isUser ? "" : "reply-other"}
|
||||||
|
>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user