update the style of code blocks
This commit is contained in:
parent
f40eb5a886
commit
ac9dce315d
File diff suppressed because one or more lines are too long
|
@ -158,8 +158,13 @@ export const Code = () => (
|
|||
<Markdown
|
||||
msg='Inline `code` has `back-ticks around` it.
|
||||
```
|
||||
Code block
|
||||
```'
|
||||
Code block 1
|
||||
```
|
||||
And other code block in sequence
|
||||
```
|
||||
Code block 2
|
||||
```
|
||||
'
|
||||
theme={theme}
|
||||
/>
|
||||
</View>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { PureComponent } from 'react';
|
||||
import { Image, StyleProp, Text, TextStyle } from 'react-native';
|
||||
import { Image, StyleProp, Text, TextStyle, View } from 'react-native';
|
||||
import { Parser } from 'commonmark';
|
||||
import Renderer from 'commonmark-react-renderer';
|
||||
import { MarkdownAST } from '@rocket.chat/message-parser';
|
||||
|
@ -171,19 +171,18 @@ class Markdown extends PureComponent<IMarkdownProps, any> {
|
|||
renderCodeBlock = ({ literal }: TLiteral) => {
|
||||
const { theme, style = [] } = this.props;
|
||||
return (
|
||||
<Text
|
||||
<View
|
||||
style={[
|
||||
{
|
||||
...styles.codeBlock,
|
||||
color: themes[theme!].bodyText,
|
||||
backgroundColor: themes[theme!].bannerBackground,
|
||||
borderColor: themes[theme!].bannerBackground
|
||||
borderColor: themes[theme!].borderColor
|
||||
},
|
||||
...style
|
||||
]}
|
||||
>
|
||||
{literal}
|
||||
</Text>
|
||||
<Text style={[styles.codeBlockText, { color: themes[theme!].bodyText }]}>{literal}</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue