chore: Update translations
This commit is contained in:
parent
1d1e8889dc
commit
fc38049b87
@ -107,7 +107,14 @@ const Timeline = (props: TimelineProps) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{mainFeed.map(e => (
|
{mainFeed.map(e => (
|
||||||
<Note key={e.id} searchedValue={props.subject.discriminator} data={e} related={relatedFeed(e.id)} ignoreModeration={props.ignoreModeration} depth={0} />
|
<Note
|
||||||
|
key={e.id}
|
||||||
|
searchedValue={props.subject.discriminator}
|
||||||
|
data={e}
|
||||||
|
related={relatedFeed(e.id)}
|
||||||
|
ignoreModeration={props.ignoreModeration}
|
||||||
|
depth={0}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
{(props.loadMore === undefined || props.loadMore === true) && (
|
{(props.loadMore === undefined || props.loadMore === true) && (
|
||||||
<div className="flex f-center">
|
<div className="flex f-center">
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
const HighlightedText = ({ content }: { content: string }) => {
|
const HighlightedText = ({ content }: { content: string }) => {
|
||||||
return (
|
return <strong className="highlighted-text">{content}</strong>;
|
||||||
<strong className="highlighted-text">
|
|
||||||
{content}
|
|
||||||
</strong>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default HighlightedText;
|
export default HighlightedText;
|
||||||
|
@ -49,20 +49,20 @@ export default function Text({
|
|||||||
const images = elements.filter(a => a.type === "media" && a.mimeType?.startsWith("image")).map(a => a.content);
|
const images = elements.filter(a => a.type === "media" && a.mimeType?.startsWith("image")).map(a => a.content);
|
||||||
|
|
||||||
function renderContentWithHighlightedText(content: string, textToHighlight: string) {
|
function renderContentWithHighlightedText(content: string, textToHighlight: string) {
|
||||||
const textToHighlightArray = textToHighlight.trim().toLowerCase().split(' ');
|
const textToHighlightArray = textToHighlight.trim().toLowerCase().split(" ");
|
||||||
const re = new RegExp(`(${textToHighlightArray.join('|')})`, 'gi');
|
const re = new RegExp(`(${textToHighlightArray.join("|")})`, "gi");
|
||||||
const splittedContent = content.split(re);
|
const splittedContent = content.split(re);
|
||||||
|
|
||||||
const fragments = splittedContent.map(c => {
|
const fragments = splittedContent.map(c => {
|
||||||
if (textToHighlightArray.includes(c.toLowerCase())) {
|
if (textToHighlightArray.includes(c.toLowerCase())) {
|
||||||
return {
|
return {
|
||||||
type: 'highlighted_text',
|
type: "highlighted_text",
|
||||||
content: c,
|
content: c,
|
||||||
} as ParsedFragment;
|
} as ParsedFragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
})
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -128,9 +128,11 @@ export default function Text({
|
|||||||
case "custom_emoji":
|
case "custom_emoji":
|
||||||
return <ProxyImg src={a.content} size={15} className="custom-emoji" />;
|
return <ProxyImg src={a.content} size={15} className="custom-emoji" />;
|
||||||
default:
|
default:
|
||||||
return <div className="text-frag">
|
return (
|
||||||
{highlighText ? renderContentWithHighlightedText(a.content, highlighText) : a.content}
|
<div className="text-frag">
|
||||||
</div>;
|
{highlighText ? renderContentWithHighlightedText(a.content, highlighText) : a.content}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user