From d17a52307fc3160c2251c43357f30ba6a68d80b4 Mon Sep 17 00:00:00 2001 From: keplyx Date: Wed, 11 Mar 2020 16:08:02 +0100 Subject: [PATCH] Do not display html component if description is only empty tags --- components/PreviewEventDashboardItem.js | 24 +++++++++++++----------- utils/PlanningEventManager.js | 7 +++++++ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/components/PreviewEventDashboardItem.js b/components/PreviewEventDashboardItem.js index d3781ed..83cdc8b 100644 --- a/components/PreviewEventDashboardItem.js +++ b/components/PreviewEventDashboardItem.js @@ -10,7 +10,7 @@ import PlanningEventManager from "../utils/PlanningEventManager"; function PreviewEventDashboardItem(props) { const {colors} = props.theme; - + const isEmpty = PlanningEventManager.isDescriptionEmpty(props.event['description']); if (props.event !== undefined && props.event !== null) { const hasImage = props.event['logo'] !== '' && props.event['logo'] !== null; const getImage = () => } - 70 ? 100 : 50, - overflow: 'hidden', - }}> - " + props.event['description'] + ""} - tagsStyles={{ - p: {color: colors.text,}, - div: {color: colors.text}, - }}/> + {!isEmpty ? + + " + props.event['description'] + ""} + tagsStyles={{ + p: {color: colors.text,}, + div: {color: colors.text}, + }}/> + + : null} - ', '') + .replace('

', '') + .replace('
', '').trim() === ''; + } + }