Fix new markdown and styles

This commit is contained in:
Gerzon Z 2021-09-27 12:41:17 -04:00
parent 47eeadc07f
commit 417ea353a9
4 changed files with 13 additions and 13 deletions

View File

@ -16,16 +16,16 @@ const Heading: React.FC<IHeadingProps> = ({ value, level }) => {
const textStyle = styles[`heading${level}`];
return (
<>
<Text style={[textStyle, { color: themes[theme].bodyText }]}>
{value.map(block => {
switch (block.type) {
case 'PLAIN_TEXT':
return <Text style={[textStyle, { color: themes[theme].bodyText }]}>{block.value}</Text>;
return block.value;
default:
return null;
}
})}
</>
</Text>
);
};

View File

@ -5,6 +5,7 @@ import { InlineCode as InlineCodeProps } from '@rocket.chat/message-parser';
import styles from '../styles';
import { themes } from '../../../constants/colors';
import { useTheme } from '../../../theme';
import Plain from './Plain';
interface IInlineCodeProps {
value: InlineCodeProps['value'];
@ -28,7 +29,7 @@ const InlineCode: React.FC<IInlineCodeProps> = ({ value, style }) => {
{(block => {
switch (block.type) {
case 'PLAIN_TEXT':
return block.value;
return <Plain value={block.value} />;
default:
return null;
}

View File

@ -14,16 +14,14 @@ interface IQuoteProps {
const Quote: React.FC<IQuoteProps> = ({ value }) => {
const { theme } = useTheme();
return (
<>
<View style={styles.container}>
<View style={[styles.quote, { backgroundColor: themes[theme].borderColor }]} />
<View style={styles.childContainer}>
{value.map(item => (
<Paragraph value={item.value} mentions={[]} />
))}
</View>
<View style={styles.container}>
<View style={[styles.quote, { backgroundColor: themes[theme].borderColor }]} />
<View style={styles.childContainer}>
{value.map(item => (
<Paragraph value={item.value} mentions={[]} />
))}
</View>
</>
</View>
);
};

View File

@ -51,6 +51,7 @@ const Content = React.memo(
// @ts-ignore
<Markdown
msg={props.msg}
md={props.md}
baseUrl={baseUrl}
getCustomEmoji={props.getCustomEmoji}
username={user.username}