[FIX] Markdown not rendering as preview for threaded messages (#3465)

* Use older preview logic

* Stories
This commit is contained in:
Diego Mello 2021-10-27 10:09:09 -03:00 committed by GitHub
parent e98caea40b
commit e0a0a31257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 1 deletions

View File

@ -18121,6 +18121,26 @@ exports[`Storyshots Markdown Preview 1`] = `
>
Testing: 😃 👍 :marioparty:
</Text>
<Text
accessibilityLabel="Fallback from new md to old"
numberOfLines={1}
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 16,
"fontWeight": "400",
"textAlign": "left",
},
Object {
"color": "#2f343d",
},
]
}
>
Fallback from new md to old
</Text>
</View>
`;

View File

@ -369,7 +369,7 @@ class Markdown extends PureComponent<IMarkdownProps, any> {
return null;
}
if (this.isNewMarkdown) {
if (this.isNewMarkdown && !preview) {
return (
<NewMarkdown
username={username}

View File

@ -80,6 +80,24 @@ stories.add('Preview', () => (
username='rocket.cat'
/>
<Markdown msg='Testing: 😃 :+1: :marioparty:' getCustomEmoji={getCustomEmoji} theme={theme} numberOfLines={1} preview />
<Markdown
msg='Fallback from new md to old'
getCustomEmoji={getCustomEmoji}
theme={theme}
numberOfLines={1}
preview
md={[
{
type: 'PARAGRAPH',
value: [
{
type: 'PLAIN_TEXT',
value: 'This is Rocket.Chat'
}
]
}
]}
/>
</View>
));