Skip to content

Commit 52f5bff

Browse files
fix: UIKit block messages rendering with smaller font size (#7531)
* fix: UIKit block messages rendering with smaller font size * fix: snapshot
1 parent 6cead90 commit 52f5bff

4 files changed

Lines changed: 834 additions & 609 deletions

File tree

app/containers/UIKit/UiKitMessage.stories.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ScrollView, View } from 'react-native';
22
import { type ReactElement } from 'react';
33

44
import { UiKitMessage } from '.';
5+
import Markdown from '../markdown';
56
import { colors } from '../../lib/constants/colors';
67
import { longText } from '../../../.rnstorybook/utils';
78
import {
@@ -54,6 +55,39 @@ export const SectionMarkdownList = () =>
5455
]);
5556
SectionMarkdownList.storyName = 'Section + Markdown List';
5657

58+
// App messages are rendered from blocks, so their mrkdwn goes through
59+
// MessageParser.mrkdwn instead of the regular message Markdown path. Both must
60+
// render at the same font size, otherwise app messages look smaller than the
61+
// user's messages in the same list.
62+
const appMessageText =
63+
'Updating workspace from 8.7.0-rc.1 to 8.7.0-rc.2\n\t\tchanges: https://github.com/RocketChat/Rocket.Chat/compare/8.7.0-rc.1...8.7.0-rc.2\n\t';
64+
65+
export const SectionFontSizeParity = () => (
66+
<View>
67+
<Markdown msg='Regular message: the reference font size' />
68+
{UiKitMessage([
69+
{
70+
type: 'section',
71+
text: {
72+
type: 'mrkdwn',
73+
text: 'Section mrkdwn: must match the message above'
74+
}
75+
}
76+
])}
77+
<Markdown msg={appMessageText} />
78+
{UiKitMessage([
79+
{
80+
type: 'section',
81+
text: {
82+
type: 'mrkdwn',
83+
text: appMessageText
84+
}
85+
}
86+
])}
87+
</View>
88+
);
89+
SectionFontSizeParity.storyName = 'Section + Message font size parity';
90+
5791
export const SectionOverflow = () =>
5892
UiKitMessage([
5993
{

0 commit comments

Comments
 (0)