fix: only apply padding if top/bottom axis labels are given

This commit is contained in:
Christoph Pader
2023-01-01 23:45:15 +01:00
parent fe41b1f4de
commit ee45375ccb
+6 -4
View File
@@ -442,10 +442,15 @@ export function AnimatedLineGraph({
pulseTrigger
)
const axisLabelContainerStyle = {
paddingTop: TopAxisLabel != null ? 20 : 0,
paddingBottom: BottomAxisLabel != null ? 20 : 0,
}
return (
<View {...props}>
<GestureDetector gesture={enablePanGesture ? gesture : undefined}>
<ReanimatedView style={[styles.container, styles.axisLabelContainer]}>
<ReanimatedView style={[styles.container, axisLabelContainerStyle]}>
{/* Top Label (max price) */}
{TopAxisLabel != null && (
<View style={styles.axisRow}>
@@ -548,9 +553,6 @@ const styles = StyleSheet.create({
container: {
flex: 1,
},
axisLabelContainer: {
paddingVertical: 20,
},
axisRow: {
height: 17,
},