Skip to content

Commit

Permalink
fix: Add style prop to Bullet component (#2008)
Browse files Browse the repository at this point in the history
  • Loading branch information
aharwood9 authored Mar 14, 2023
1 parent 973c21b commit 59b4b64
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions package/src/components/Message/MessageSimple/utils/renderText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ export const ListOutput = ({ node, output, state, styles }: ListOutputProps) =>
if (item === null) {
return (
<ListRow key={index} style={styles?.listRow} testID='list-item'>
<Bullet index={node.ordered && indexAfterStart} />
<Bullet
index={node.ordered && indexAfterStart}
style={node.ordered ? styles?.listItemNumber : styles?.listItemBullet}
/>
</ListRow>
);
}
Expand All @@ -338,7 +341,10 @@ export const ListOutput = ({ node, output, state, styles }: ListOutputProps) =>

return (
<ListRow key={index} style={styles?.listRow} testID='list-item'>
<Bullet index={node.ordered && indexAfterStart} />
<Bullet
index={node.ordered && indexAfterStart}
style={node.ordered ? styles?.listItemNumber : styles?.listItemBullet}
/>
<ListItem key={1} style={[styles?.listItemText, style]}>
{output(item, state)}
</ListItem>
Expand All @@ -354,13 +360,13 @@ interface BulletProps extends TextProps {
}

const Bullet = ({ index, style }: BulletProps) => (
<Text key={0} style={[style, defaultMarkdownStyles.listItemNumber]}>
<Text key={0} style={style}>
{index ? `${index}. ` : '\u2022 '}
</Text>
);

const ListRow = (props: PropsWithChildren<ViewProps>) => (
<Text style={[props.style, defaultMarkdownStyles.listRow]}>{props.children}</Text>
const ListRow = ({ children, style }: PropsWithChildren<ViewProps>) => (
<Text style={style}>{children}</Text>
);

const ListItem = ({ children, style }: PropsWithChildren<TextProps>) => (
Expand Down

0 comments on commit 59b4b64

Please sign in to comment.