From 4c065a027b95a733218697fe7f5c993f995a8064 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Fri, 9 Feb 2024 12:56:43 +1300 Subject: [PATCH] Rename Chart -> AppLineChart Chart is too generic since several types of charts exist in the react-native-chart-kit. --- Chart.tsx => AppLineChart.tsx | 2 +- InsightsPage.tsx | 4 ++-- ViewGraph.tsx | 6 +++--- ViewWeightGraph.tsx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename Chart.tsx => AppLineChart.tsx (94%) diff --git a/Chart.tsx b/AppLineChart.tsx similarity index 94% rename from Chart.tsx rename to AppLineChart.tsx index c88f520..871dd85 100644 --- a/Chart.tsx +++ b/AppLineChart.tsx @@ -9,7 +9,7 @@ interface ChartProps { data: number[]; } -export default function Chart({ labels, data }: ChartProps) { +export default function AppLineChart({ labels, data }: ChartProps) { const { width } = useWindowDimensions(); const { colors } = useTheme(); diff --git a/InsightsPage.tsx b/InsightsPage.tsx index 10832e0..8842856 100644 --- a/InsightsPage.tsx +++ b/InsightsPage.tsx @@ -3,7 +3,7 @@ import { useCallback, useState } from "react"; import { ActivityIndicator, ScrollView, View } from "react-native"; import { IconButton, Text } from "react-native-paper"; import AppPieChart from "./AppPieChart"; -import Chart from "./Chart"; +import AppLineChart from "./AppLineChart"; import ConfirmDialog from "./ConfirmDialog"; import { MARGIN, PADDING } from "./constants"; import { AppDataSource } from "./data-source"; @@ -180,7 +180,7 @@ export default function InsightsPage() { {loadingHours ? ( ) : ( - hc.count)} labels={hourCounts.map((hc) => hourLabel(hc.hour))} /> diff --git a/ViewGraph.tsx b/ViewGraph.tsx index ef83df2..a419c15 100644 --- a/ViewGraph.tsx +++ b/ViewGraph.tsx @@ -7,7 +7,7 @@ import { IconButton, List } from "react-native-paper"; import Share from "react-native-share"; import { captureScreen } from "react-native-view-shot"; import { StackParams } from "./AppStack"; -import Chart from "./Chart"; +import AppLineChart from "./AppLineChart"; import Select from "./Select"; import StackHeader from "./StackHeader"; import { PADDING } from "./constants"; @@ -98,7 +98,7 @@ export default function ViewGraph() { if (weights.length === 0) return ; return ( - set.weight)} labels={weights.map((set) => format(new Date(set.created), "yyyy-MM-d") @@ -112,7 +112,7 @@ export default function ViewGraph() { if (volumes.length === 0) return ; return ( - volume.value)} labels={volumes.map((volume) => format(new Date(volume.created), "yyyy-MM-d") diff --git a/ViewWeightGraph.tsx b/ViewWeightGraph.tsx index 2b97133..3480384 100644 --- a/ViewWeightGraph.tsx +++ b/ViewWeightGraph.tsx @@ -5,7 +5,7 @@ import { FileSystem } from "react-native-file-access"; import { IconButton, List } from "react-native-paper"; import Share from "react-native-share"; import { captureScreen } from "react-native-view-shot"; -import Chart from "./Chart"; +import AppLineChart from "./AppLineChart"; import { PADDING } from "./constants"; import { weightRepo } from "./db"; import { Periods } from "./periods"; @@ -48,7 +48,7 @@ export default function ViewWeightGraph() { } return ( - set.value)} labels={weights.map((weight) => format(new Date(weight.created), "yyyy-MM-d")