From ee45375ccbb45c19af90db60347301ac909ac293 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Sun, 1 Jan 2023 23:45:15 +0100 Subject: [PATCH] fix: only apply padding if top/bottom axis labels are given --- src/AnimatedLineGraph.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/AnimatedLineGraph.tsx b/src/AnimatedLineGraph.tsx index 2b3a882..7681587 100644 --- a/src/AnimatedLineGraph.tsx +++ b/src/AnimatedLineGraph.tsx @@ -442,10 +442,15 @@ export function AnimatedLineGraph({ pulseTrigger ) + const axisLabelContainerStyle = { + paddingTop: TopAxisLabel != null ? 20 : 0, + paddingBottom: BottomAxisLabel != null ? 20 : 0, + } + return ( - + {/* Top Label (max price) */} {TopAxisLabel != null && ( @@ -548,9 +553,6 @@ const styles = StyleSheet.create({ container: { flex: 1, }, - axisLabelContainer: { - paddingVertical: 20, - }, axisRow: { height: 17, },