Fix new markdown and styles
This commit is contained in:
parent
47eeadc07f
commit
417ea353a9
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue