Skip to content

Commit 13214a7

Browse files
committed
fix: quoted message layout
1 parent 96872fd commit 13214a7

16 files changed

Lines changed: 26 additions & 5 deletions

File tree

package/src/components/Message/MessageItemView/__tests__/__snapshots__/MessageTextContainer.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ exports[`MessageTextContainer should render message text container 1`] = `
4444
"color": "#1a1b25",
4545
"fontSize": 17,
4646
"lineHeight": 20,
47+
"writingDirection": "ltr",
4748
}
4849
}
4950
>

package/src/components/Message/MessageItemView/utils/renderText.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { PropsWithChildren, ReactNode, useCallback, useMemo } from 'react';
22
import {
33
GestureResponderEvent,
4+
I18nManager,
45
Linking,
56
Platform,
67
Text,
@@ -294,6 +295,7 @@ export const renderText = (params: RenderTextParams) => {
294295
...defaultMarkdownStyles.text,
295296
color: isMyMessage ? semantics.chatTextOutgoing : semantics.chatTextIncoming,
296297
...markdownStyles?.text,
298+
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
297299
},
298300
};
299301

package/src/components/Reply/Reply.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { useMessageComposer } from '../../contexts/messageInputContext/hooks/useMessageComposer';
1919
import { MessagesContextValue } from '../../contexts/messagesContext/MessagesContext';
2020
import { useTheme } from '../../contexts/themeContext/ThemeContext';
21+
import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
2122
import { useStateStore } from '../../hooks';
2223
import { primitives } from '../../theme';
2324
import { FileTypes } from '../../types/types';
@@ -96,6 +97,7 @@ export type ReplyPropsWithContext = Pick<ChatContextValue, 'ImageComponent'> &
9697
};
9798

9899
export const ReplyWithContext = (props: ReplyPropsWithContext) => {
100+
const { t } = useTranslationContext();
99101
const {
100102
isMyMessage,
101103
ImageComponent,
@@ -122,13 +124,13 @@ export const ReplyWithContext = (props: ReplyPropsWithContext) => {
122124
const title = useMemo(
123125
() =>
124126
mode === 'edit'
125-
? 'Edit Message'
127+
? t('Edit Message')
126128
: isMyMessage
127-
? 'You'
129+
? t('You')
128130
: quotedMessage?.user?.name
129-
? `Reply to ${quotedMessage?.user?.name}`
130-
: 'Reply',
131-
[mode, isMyMessage, quotedMessage?.user?.name],
131+
? t('Reply to {{name}}', { name: quotedMessage?.user?.name })
132+
: t('Reply'),
133+
[mode, isMyMessage, quotedMessage?.user?.name, t],
132134
);
133135

134136
if (!quotedMessage) {

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ exports[`Thread should match thread snapshot 1`] = `
592592
"color": "#1a1b25",
593593
"fontSize": 17,
594594
"lineHeight": 20,
595+
"writingDirection": "ltr",
595596
}
596597
}
597598
>
@@ -929,6 +930,7 @@ exports[`Thread should match thread snapshot 1`] = `
929930
"color": "#1a1b25",
930931
"fontSize": 17,
931932
"lineHeight": 20,
933+
"writingDirection": "ltr",
932934
}
933935
}
934936
>
@@ -1299,6 +1301,7 @@ exports[`Thread should match thread snapshot 1`] = `
12991301
"color": "#1a1b25",
13001302
"fontSize": 17,
13011303
"lineHeight": 20,
1304+
"writingDirection": "ltr",
13021305
}
13031306
}
13041307
>
@@ -1627,6 +1630,7 @@ exports[`Thread should match thread snapshot 1`] = `
16271630
"color": "#1a1b25",
16281631
"fontSize": 17,
16291632
"lineHeight": 20,
1633+
"writingDirection": "ltr",
16301634
}
16311635
}
16321636
>

package/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Questions": "Questions",
9494
"Reconnecting...": "Reconnecting...",
9595
"Reply": "Reply",
96+
"Reply to {{name}}": "Reply to {{name}}",
9697
"Reply to Message": "Reply to Message",
9798
"Resend": "Resend",
9899
"SEND": "SEND",

package/src/i18n/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Questions": "Preguntas",
9494
"Reconnecting...": "Reconectando...",
9595
"Reply": "Responder",
96+
"Reply to {{name}}": "Responder a {{name}}",
9697
"Reply to Message": "Responder al mensaje",
9798
"Resend": "Reenviar",
9899
"SEND": "ENVIAR",

package/src/i18n/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Questions": "Questions",
9494
"Reconnecting...": "Se Reconnecter...",
9595
"Reply": "Répondre",
96+
"Reply to {{name}}": "Répondre à {{name}}",
9697
"Reply to Message": "Répondre au message",
9798
"Resend": "Renvoyer",
9899
"SEND": "ENVOYER",

package/src/i18n/he.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Questions": "שאלות",
9494
"Reconnecting...": "מתחבר מחדש...",
9595
"Reply": "השב/י",
96+
"Reply to {{name}}": "השב/י ל-{{name}}",
9697
"Reply to Message": "השב/י להודעה",
9798
"Resend": "שלח/י שוב",
9899
"SEND": "שלח",

package/src/i18n/hi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Questions": "प्रश्न",
9494
"Reconnecting...": "पुनः कनेक्ट हो...",
9595
"Reply": "मैसेज को रिप्लाई करे",
96+
"Reply to {{name}}": "{{name}} को जवाब दें",
9697
"Reply to Message": "संदेश का जवाब दें",
9798
"Resend": "पुन: भेजें",
9899
"SEND": "भेजें",

package/src/i18n/it.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Questions": "Domande",
9494
"Reconnecting...": "Ricollegarsi...",
9595
"Reply": "Rispondi",
96+
"Reply to {{name}}": "Rispondi a {{name}}",
9697
"Reply to Message": "Rispondi al messaggio",
9798
"Resend": "Invia di nuovo",
9899
"SEND": "INVIA",

0 commit comments

Comments
 (0)