[FIX] Markdown links coloured same as normal text for old markdown (#4905)
Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
This commit is contained in:
parent
b4f8dfb84e
commit
00b8263913
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -126,6 +126,12 @@ export const Links = () => (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Markdown msg='[Markdown link](https://rocket.chat): `[description](url)`' theme={theme} />
|
<Markdown msg='[Markdown link](https://rocket.chat): `[description](url)`' theme={theme} />
|
||||||
<Markdown msg='<https://rocket.chat|Formatted Link>: `<url|description>`' theme={theme} />
|
<Markdown msg='<https://rocket.chat|Formatted Link>: `<url|description>`' theme={theme} />
|
||||||
|
<Markdown msg='[Markdown link](https://rocket.chat) and the text with default style' theme={theme} />
|
||||||
|
<Markdown
|
||||||
|
msg='[Markdown link](https://rocket.chat) and the text with a color specific as auxiliaryText'
|
||||||
|
theme={theme}
|
||||||
|
style={[{ color: themes[theme].auxiliaryText }]}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -140,10 +140,10 @@ class Markdown extends PureComponent<IMarkdownProps, any> {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderText = ({ context, literal }: { context: []; literal: string }) => {
|
renderText = ({ context, literal }: { context: []; literal: string }) => {
|
||||||
const { numberOfLines, style = [] } = this.props;
|
const { numberOfLines } = this.props;
|
||||||
const defaultStyle = [this.isMessageContainsOnlyEmoji ? styles.textBig : {}, ...context.map(type => styles[type])];
|
const defaultStyle = [this.isMessageContainsOnlyEmoji ? styles.textBig : {}, ...context.map(type => styles[type])];
|
||||||
return (
|
return (
|
||||||
<Text accessibilityLabel={literal} style={[styles.text, defaultStyle, ...style]} numberOfLines={numberOfLines}>
|
<Text accessibilityLabel={literal} style={[styles.text, defaultStyle]} numberOfLines={numberOfLines}>
|
||||||
{literal}
|
{literal}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
|
@ -193,12 +193,12 @@ class Markdown extends PureComponent<IMarkdownProps, any> {
|
||||||
};
|
};
|
||||||
|
|
||||||
renderParagraph = ({ children }: any) => {
|
renderParagraph = ({ children }: any) => {
|
||||||
const { numberOfLines, style, theme } = this.props;
|
const { numberOfLines, style = [], theme } = this.props;
|
||||||
if (!children || children.length === 0) {
|
if (!children || children.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Text style={[styles.text, style, { color: themes[theme!].bodyText }]} numberOfLines={numberOfLines}>
|
<Text style={[styles.text, { color: themes[theme!].bodyText }, ...style]} numberOfLines={numberOfLines}>
|
||||||
{children}
|
{children}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue