From 0f33950e241d4b7810c13d490cdfdf36b3e5c8d4 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Sun, 18 Apr 2021 18:50:25 -0300 Subject: [PATCH] Adding null check in pluviometer for chart data points --- src/app/components/MapModal.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/app/components/MapModal.js b/src/app/components/MapModal.js index 937ee5b..72ebfa2 100644 --- a/src/app/components/MapModal.js +++ b/src/app/components/MapModal.js @@ -156,13 +156,25 @@ function reviews(props) { } function moreInfo(props) { + const hasData = props.data.values.length > 0; return ( - - + + {!hasData ? ( + + Nenhum dado disponível + + ) : ( + + )} ); } @@ -258,10 +270,6 @@ const styles = StyleSheet.create({ fontWeight: "500", fontSize: dimensions.text.default, }, - pluviometer_diary: { - height: chartHeight * 1.4, - paddingVertical: 20, - }, }); export default MapModal;