From 2c1a412fce16b3beeebfc40e47d72b5384ce8d85 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Wed, 11 Jan 2023 17:07:43 -0300 Subject: [PATCH] fix the MessageURl showing when there isn't hasContent or imageUrl --- app/containers/message/Urls.tsx | 46 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/app/containers/message/Urls.tsx b/app/containers/message/Urls.tsx index 3b161a1c4..756d17c11 100644 --- a/app/containers/message/Urls.tsx +++ b/app/containers/message/Urls.tsx @@ -124,27 +124,31 @@ const Url = React.memo( const hasContent = !!url.title || !!url.description; - return ( - 0 && styles.marginTop, - styles.container, - { - backgroundColor: themes[theme].chatComponentBackground, - borderColor: themes[theme].borderColor - } - ]} - background={Touchable.Ripple(themes[theme].bannerBackground)} - > - <> - - {hasContent ? : null} - - - ); + if (hasContent || imageUrl) { + return ( + 0 && styles.marginTop, + styles.container, + { + backgroundColor: themes[theme].chatComponentBackground, + borderColor: themes[theme].borderColor + } + ]} + background={Touchable.Ripple(themes[theme].bannerBackground)} + > + <> + + {hasContent ? : null} + + + ); + } + + return null; }, (oldProps, newProps) => dequal(oldProps.url, newProps.url) && oldProps.theme === newProps.theme );