Browse Source

Adding null check in pluviometer for chart data points

master
GabrielTrettel 4 years ago
parent
commit
0f33950e24
  1. 28
      src/app/components/MapModal.js

28
src/app/components/MapModal.js

@ -156,13 +156,25 @@ function reviews(props) {
} }
function moreInfo(props) { function moreInfo(props) {
const hasData = props.data.values.length > 0;
return ( return (
<View style={styles.pluviometer_diary}>
<PluviometerGraphics
chartHeight={chartHeight}
values={props.data.values}
labels={props.data.labels}
/>
<View
style={{
height: hasData ? chartHeight * 1.4 : 70,
paddingVertical: 20,
}}
>
{!hasData ? (
<Text style={{ ...styles.text, alignSelf: "center" }}>
Nenhum dado disponível
</Text>
) : (
<PluviometerGraphics
chartHeight={chartHeight}
values={props.data.values}
labels={props.data.labels}
/>
)}
</View> </View>
); );
} }
@ -258,10 +270,6 @@ const styles = StyleSheet.create({
fontWeight: "500", fontWeight: "500",
fontSize: dimensions.text.default, fontSize: dimensions.text.default,
}, },
pluviometer_diary: {
height: chartHeight * 1.4,
paddingVertical: 20,
},
}); });
export default MapModal; export default MapModal;
Loading…
Cancel
Save