Skip to content

Commit

Permalink
Next Release (#2247)
Browse files Browse the repository at this point in the history
* 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 <atsushi0623itoh@gmail.com>
  • Loading branch information
vishalnarkhede and atsss authored Oct 3, 2023
1 parent cc096ef commit b34be03
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 203 deletions.
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"path": "0.12.7",
"react-native-markdown-package": "1.8.2",
"react-native-url-polyfill": "^1.3.0",
"stream-chat": "8.6.0"
"stream-chat": "~8.12.2"
},
"peerDependencies": {
"react-native-quick-sqlite": ">=5.1.0",
Expand Down
26 changes: 21 additions & 5 deletions package/src/components/Message/MessageSimple/utils/renderText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,27 @@ export const renderText = <
);
};

const paragraphText: ReactNodeOutput = (node, output, { ...state }) => (
<Text key={state.key} numberOfLines={messageTextNumberOfLines} style={styles.paragraph}>
{output(node.content, state)}
</Text>
);
const paragraphText: ReactNodeOutput = (node, output, { ...state }) => {
if (messageTextNumberOfLines !== undefined) {
// If we want to truncate the message text, lets only truncate the first paragraph
// and simply not render rest of the paragraphs.
if (state.key === '0' || state.key === 0) {
return (
<Text key={state.key} numberOfLines={messageTextNumberOfLines} style={styles.paragraph}>
{output(node.content, state)}
</Text>
);
} else {
return null;
}
}

return (
<Text key={state.key} style={styles.paragraph}>
{output(node.content, state)}
</Text>
);
};

const mentionedUsers = Array.isArray(mentioned_users)
? mentioned_users.reduce((acc, cur) => {
Expand Down
Loading

0 comments on commit b34be03

Please sign in to comment.