mirror of
https://github.com/balzack/databag.git
synced 2025-04-20 00:25:16 +00:00
fixing message color
This commit is contained in:
parent
29ba7cbc55
commit
fa2905e82c
@ -55,7 +55,7 @@ export function Message({ topic, card, profile, host, select, selected }: { topi
|
|||||||
const words = parsed as string[];
|
const words = parsed as string[];
|
||||||
words.forEach((word, index) => {
|
words.forEach((word, index) => {
|
||||||
if (!!urlPattern.test(word)) {
|
if (!!urlPattern.test(word)) {
|
||||||
clickable.push(<Text key={index}>{ plain }</Text>);
|
clickable.push(<Text key={index} style={textStyle}>{ plain }</Text>);
|
||||||
plain = '';
|
plain = '';
|
||||||
const url = !!hostPattern.test(word) ? word : `https://${word}`;
|
const url = !!hostPattern.test(word) ? word : `https://${word}`;
|
||||||
clickable.push(<Text key={'link-' + index} onPress={() => Linking.openURL(sanitizeUrl(url))} style={{ fontStyle: 'italic' }}>{ sanitizeUrl(word) + ' ' }</Text>);
|
clickable.push(<Text key={'link-' + index} onPress={() => Linking.openURL(sanitizeUrl(url))} style={{ fontStyle: 'italic' }}>{ sanitizeUrl(word) + ' ' }</Text>);
|
||||||
@ -67,7 +67,7 @@ export function Message({ topic, card, profile, host, select, selected }: { topi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plain) {
|
if (plain) {
|
||||||
clickable.push(<Text key={parsed.length}>{ plain }</Text>);
|
clickable.push(<Text key={parsed.length} style={textStyle}>{ plain }</Text>);
|
||||||
}
|
}
|
||||||
setMessage(clickable)
|
setMessage(clickable)
|
||||||
}, [text, locked]);
|
}, [text, locked]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user