fix the MessageURl showing when there isn't hasContent or imageUrl
This commit is contained in:
parent
ae0a218a7a
commit
2c1a412fce
|
@ -124,27 +124,31 @@ const Url = React.memo(
|
||||||
|
|
||||||
const hasContent = !!url.title || !!url.description;
|
const hasContent = !!url.title || !!url.description;
|
||||||
|
|
||||||
return (
|
if (hasContent || imageUrl) {
|
||||||
<Touchable
|
return (
|
||||||
onPress={onPress}
|
<Touchable
|
||||||
onLongPress={onLongPress}
|
onPress={onPress}
|
||||||
style={[
|
onLongPress={onLongPress}
|
||||||
styles.button,
|
style={[
|
||||||
index > 0 && styles.marginTop,
|
styles.button,
|
||||||
styles.container,
|
index > 0 && styles.marginTop,
|
||||||
{
|
styles.container,
|
||||||
backgroundColor: themes[theme].chatComponentBackground,
|
{
|
||||||
borderColor: themes[theme].borderColor
|
backgroundColor: themes[theme].chatComponentBackground,
|
||||||
}
|
borderColor: themes[theme].borderColor
|
||||||
]}
|
}
|
||||||
background={Touchable.Ripple(themes[theme].bannerBackground)}
|
]}
|
||||||
>
|
background={Touchable.Ripple(themes[theme].bannerBackground)}
|
||||||
<>
|
>
|
||||||
<UrlImage image={imageUrl} hasContent={hasContent} />
|
<>
|
||||||
{hasContent ? <UrlContent title={url.title} description={url.description} theme={theme} /> : null}
|
<UrlImage image={imageUrl} hasContent={hasContent} />
|
||||||
</>
|
{hasContent ? <UrlContent title={url.title} description={url.description} theme={theme} /> : null}
|
||||||
</Touchable>
|
</>
|
||||||
);
|
</Touchable>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
(oldProps, newProps) => dequal(oldProps.url, newProps.url) && oldProps.theme === newProps.theme
|
(oldProps, newProps) => dequal(oldProps.url, newProps.url) && oldProps.theme === newProps.theme
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue