Skip to content

Commit 5a8e2bf

Browse files
committed
fix: review
1 parent 455d1c5 commit 5a8e2bf

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/containers/markdown/components/Preview.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Text, type TextStyle } from 'react-native';
2+
import { type StyleProp, Text, type TextStyle } from 'react-native';
33

44
import { themes } from '../../../lib/constants/colors';
55
import { useTheme } from '../../../theme';
@@ -10,7 +10,7 @@ interface IMarkdownPreview {
1010
msg?: string;
1111
numberOfLines?: number;
1212
testID?: string;
13-
style?: TextStyle[];
13+
style?: StyleProp<TextStyle>;
1414
}
1515

1616
const MarkdownPreview = ({ msg, numberOfLines = 1, style = [], testID }: IMarkdownPreview) => {
@@ -24,7 +24,11 @@ const MarkdownPreview = ({ msg, numberOfLines = 1, style = [], testID }: IMarkdo
2424
return (
2525
<Text
2626
accessibilityLabel={m}
27-
style={[styles.text, { color: themes[theme].fontDefault, lineHeight: undefined }, ...style]}
27+
style={[
28+
styles.text,
29+
{ color: themes[theme].fontDefault, lineHeight: undefined },
30+
...(Array.isArray(style) ? style : [style])
31+
]}
2832
numberOfLines={numberOfLines}
2933
testID={testID || `markdown-preview-${m}`}>
3034
{m}

app/views/DiscussionsView/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const Item = ({ item, onPress }: IItem): React.ReactElement => {
7575
</View>
7676
<View style={styles.messageContainer}>
7777
{/* eslint-disable-next-line react-native/no-single-element-style-arrays */}
78-
{username ? <MarkdownPreview msg={makeThreadName(item)} numberOfLines={2} style={[styles.markdown]} /> : null}
78+
{username ? <MarkdownPreview msg={makeThreadName(item)} numberOfLines={2} style={styles.markdown} /> : null}
7979
</View>
8080
{messageDate ? <DiscussionDetails item={item} date={messageDate} /> : null}
8181
</View>

0 commit comments

Comments
 (0)