From 7796fefe4f4dbea28eebeff84385e0cc89862824 Mon Sep 17 00:00:00 2001 From: ricale Date: Tue, 25 Apr 2023 11:31:18 +0900 Subject: [PATCH] [C03] onClickItem -> onPressItem, onClickLegendItem -> onPressLegendItem --- .../comps/LineChart/Legend/index.tsx | 6 +++--- .../C03LineChartWithLegendScreen/comps/LineChart/index.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx b/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx index b05286b..537d8a0 100644 --- a/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx +++ b/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx @@ -12,12 +12,12 @@ const NOT_VISIBLE_COLOR = 'gainsboro'; type LegendProps = LegendOptions & { series: TimeSeries[]; linesOptions?: LinesOptions; - onClickItem?: (sr: TimeSeries, idx: number) => void; + onPressItem?: (sr: TimeSeries, idx: number) => void; }; function Legend({ series, linesOptions, - onClickItem, + onPressItem, enabled = true, @@ -68,7 +68,7 @@ function Legend({ paddingBottom: itemPaddingBottom ?? itemPadding ?? 2, }, ]} - onPress={() => onClickItem?.(sr, i)} + onPress={() => onPressItem?.(sr, i)} > { + const onPressLegendItem = (sr: TimeSeries, idx: number) => { setState(dr => { dr.series = dr.series.map((sr, i) => i !== idx ? sr : { ...sr, visible: !sr.visible } @@ -114,7 +114,7 @@ function LineChart({