Skip to content

Commit b34be03

Browse files
Next Release (#2247)
* fix: long message content overflowing issue in overlay (#2244) * fix: missing Japanese translation (#2243) * Correct Japanese translation for thread * Add missing Japanese translation for thread * fix: url param serialisation issue on iOS 17 (#2246) --------- Co-authored-by: atsss <[email protected]>
1 parent cc096ef commit b34be03

File tree

6 files changed

+244
-203
lines changed

6 files changed

+244
-203
lines changed

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"path": "0.12.7",
8080
"react-native-markdown-package": "1.8.2",
8181
"react-native-url-polyfill": "^1.3.0",
82-
"stream-chat": "8.6.0"
82+
"stream-chat": "~8.12.2"
8383
},
8484
"peerDependencies": {
8585
"react-native-quick-sqlite": ">=5.1.0",

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,27 @@ export const renderText = <
198198
);
199199
};
200200

201-
const paragraphText: ReactNodeOutput = (node, output, { ...state }) => (
202-
<Text key={state.key} numberOfLines={messageTextNumberOfLines} style={styles.paragraph}>
203-
{output(node.content, state)}
204-
</Text>
205-
);
201+
const paragraphText: ReactNodeOutput = (node, output, { ...state }) => {
202+
if (messageTextNumberOfLines !== undefined) {
203+
// If we want to truncate the message text, lets only truncate the first paragraph
204+
// and simply not render rest of the paragraphs.
205+
if (state.key === '0' || state.key === 0) {
206+
return (
207+
<Text key={state.key} numberOfLines={messageTextNumberOfLines} style={styles.paragraph}>
208+
{output(node.content, state)}
209+
</Text>
210+
);
211+
} else {
212+
return null;
213+
}
214+
}
215+
216+
return (
217+
<Text key={state.key} style={styles.paragraph}>
218+
{output(node.content, state)}
219+
</Text>
220+
);
221+
};
206222

207223
const mentionedUsers = Array.isArray(mentioned_users)
208224
? mentioned_users.reduce((acc, cur) => {

0 commit comments

Comments
 (0)