From 04c10bb6804d15da62f16c5d6b4641c948fbe405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 22 Oct 2024 07:40:52 +0200 Subject: [PATCH 1/2] pl-fe: fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../pl-fe/src/features/status/components/detailed-status.tsx | 2 +- packages/pl-fe/src/locales/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pl-fe/src/features/status/components/detailed-status.tsx b/packages/pl-fe/src/features/status/components/detailed-status.tsx index 6e218db4c..826e6ea48 100644 --- a/packages/pl-fe/src/features/status/components/detailed-status.tsx +++ b/packages/pl-fe/src/features/status/components/detailed-status.tsx @@ -24,7 +24,7 @@ import StatusTypeIcon from './status-type-icon'; import type { SelectedStatus } from 'pl-fe/selectors'; const messages = defineMessages({ - applicationName: { id: 'status.application_name', defaultMessage: 'Sent form {name}' }, + applicationName: { id: 'status.application_name', defaultMessage: 'Sent from {name}' }, }); interface IDetailedStatus { diff --git a/packages/pl-fe/src/locales/en.json b/packages/pl-fe/src/locales/en.json index 94ffdf38f..1aeeb848a 100644 --- a/packages/pl-fe/src/locales/en.json +++ b/packages/pl-fe/src/locales/en.json @@ -1434,7 +1434,7 @@ "status.add_known_language": "Do not auto-translate posts in {language}.", "status.admin_account": "Moderate @{name}", "status.admin_status": "Open this post in the moderation interface", - "status.application_name": "Sent form {name}", + "status.application_name": "Sent from {name}", "status.approval.pending": "Pending approval", "status.approval.rejected": "Rejected", "status.bookmark": "Bookmark", From 775f6b1d2b8297d95b6e9b3397d04e8ab03efa02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 22 Oct 2024 07:44:38 +0200 Subject: [PATCH 2/2] pl-fe: avoid dangerouslySetInnerHTML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/features/admin/components/report.tsx | 7 +++---- .../pl-fe/src/features/chats/components/chat-list-item.tsx | 6 ++++-- .../pl-fe/src/features/chats/components/chat-message.tsx | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/pl-fe/src/features/admin/components/report.tsx b/packages/pl-fe/src/features/admin/components/report.tsx index d55d88f94..a5c51d717 100644 --- a/packages/pl-fe/src/features/admin/components/report.tsx +++ b/packages/pl-fe/src/features/admin/components/report.tsx @@ -127,10 +127,9 @@ const Report: React.FC = ({ id }) => { {!!report.comment && report.comment.length > 0 && ( - + + {report.comment} + )} {!!account && ( diff --git a/packages/pl-fe/src/features/chats/components/chat-list-item.tsx b/packages/pl-fe/src/features/chats/components/chat-list-item.tsx index 89b2db704..897ff0e6f 100644 --- a/packages/pl-fe/src/features/chats/components/chat-list-item.tsx +++ b/packages/pl-fe/src/features/chats/components/chat-list-item.tsx @@ -4,6 +4,7 @@ import { useHistory } from 'react-router-dom'; import { useRelationship } from 'pl-fe/api/hooks/accounts/useRelationship'; import DropdownMenu from 'pl-fe/components/dropdown-menu'; +import { ParsedContent } from 'pl-fe/components/parsed-content'; import RelativeTimestamp from 'pl-fe/components/relative-timestamp'; import Avatar from 'pl-fe/components/ui/avatar'; import HStack from 'pl-fe/components/ui/hstack'; @@ -124,8 +125,9 @@ const ChatListItem: React.FC = ({ chat, onClick }) => { truncate className='truncate-child pointer-events-none h-5 w-full' data-testid='chat-last-message' - dangerouslySetInnerHTML={{ __html: chat.last_message?.content }} - /> + > + + )} )} diff --git a/packages/pl-fe/src/features/chats/components/chat-message.tsx b/packages/pl-fe/src/features/chats/components/chat-message.tsx index 81842a725..c973a80aa 100644 --- a/packages/pl-fe/src/features/chats/components/chat-message.tsx +++ b/packages/pl-fe/src/features/chats/components/chat-message.tsx @@ -5,11 +5,11 @@ import React, { useMemo, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import DropdownMenu from 'pl-fe/components/dropdown-menu'; +import { ParsedContent } from 'pl-fe/components/parsed-content'; import HStack from 'pl-fe/components/ui/hstack'; import Icon from 'pl-fe/components/ui/icon'; import Stack from 'pl-fe/components/ui/stack'; import Text from 'pl-fe/components/ui/text'; -import Emojify from 'pl-fe/features/emoji/emojify'; import { MediaGallery } from 'pl-fe/features/ui/util/async-components'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { ChatKeys, useChatActions } from 'pl-fe/queries/chats'; @@ -240,7 +240,7 @@ const ChatMessage = (props: IChatMessage) => { tabIndex={0} > - +