From fc38049b878987e2cc1035aada010821f1d2f26e Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 29 Sep 2023 15:55:55 +0000 Subject: [PATCH] chore: Update translations --- packages/app/src/Element/Feed/Timeline.tsx | 9 ++++++++- packages/app/src/Element/HighlightedText.tsx | 6 +----- packages/app/src/Element/Text.tsx | 16 +++++++++------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/app/src/Element/Feed/Timeline.tsx b/packages/app/src/Element/Feed/Timeline.tsx index 9b90fe9c1..fc1e9997d 100644 --- a/packages/app/src/Element/Feed/Timeline.tsx +++ b/packages/app/src/Element/Feed/Timeline.tsx @@ -107,7 +107,14 @@ const Timeline = (props: TimelineProps) => { )} {mainFeed.map(e => ( - + ))} {(props.loadMore === undefined || props.loadMore === true) && (
diff --git a/packages/app/src/Element/HighlightedText.tsx b/packages/app/src/Element/HighlightedText.tsx index fa305e003..fd301f0ec 100644 --- a/packages/app/src/Element/HighlightedText.tsx +++ b/packages/app/src/Element/HighlightedText.tsx @@ -1,9 +1,5 @@ const HighlightedText = ({ content }: { content: string }) => { - return ( - - {content} - - ); + return {content}; }; export default HighlightedText; diff --git a/packages/app/src/Element/Text.tsx b/packages/app/src/Element/Text.tsx index 02a5d990e..5d3cbb643 100644 --- a/packages/app/src/Element/Text.tsx +++ b/packages/app/src/Element/Text.tsx @@ -49,20 +49,20 @@ export default function Text({ const images = elements.filter(a => a.type === "media" && a.mimeType?.startsWith("image")).map(a => a.content); function renderContentWithHighlightedText(content: string, textToHighlight: string) { - const textToHighlightArray = textToHighlight.trim().toLowerCase().split(' '); - const re = new RegExp(`(${textToHighlightArray.join('|')})`, 'gi'); + const textToHighlightArray = textToHighlight.trim().toLowerCase().split(" "); + const re = new RegExp(`(${textToHighlightArray.join("|")})`, "gi"); const splittedContent = content.split(re); const fragments = splittedContent.map(c => { if (textToHighlightArray.includes(c.toLowerCase())) { return { - type: 'highlighted_text', + type: "highlighted_text", content: c, } as ParsedFragment; } return c; - }) + }); return ( <> @@ -128,9 +128,11 @@ export default function Text({ case "custom_emoji": return ; default: - return
- {highlighText ? renderContentWithHighlightedText(a.content, highlighText) : a.content} -
; + return ( +
+ {highlighText ? renderContentWithHighlightedText(a.content, highlighText) : a.content} +
+ ); } } }