From 93893f0a275b35df5b4a372493604b5e7212cea9 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 14:27:23 +0100 Subject: [PATCH] fix player chart mobile support --- src/components/player/player-rank-chart.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/player/player-rank-chart.tsx b/src/components/player/player-rank-chart.tsx index 0155d11..8911375 100644 --- a/src/components/player/player-rank-chart.tsx +++ b/src/components/player/player-rank-chart.tsx @@ -110,7 +110,7 @@ const generateDataset = ( borderColor, fill: false, lineTension: 0.5, - spanGaps: false, // Set to false to allow gaps + spanGaps: false, // Set to false, so we can allow gaps yAxisID, }); @@ -122,6 +122,7 @@ type DatasetConfig = { axisConfig: { reverse: boolean; display: boolean; + hideOnMobile?: boolean; displayName: string; position: AxisPosition; }; @@ -165,6 +166,7 @@ const datasetConfig: DatasetConfig[] = [ axisConfig: { reverse: false, display: true, + hideOnMobile: true, displayName: "PP", position: "right", }, @@ -255,7 +257,9 @@ export default function PlayerRankChart({ player }: Props) { axes[config.axisId] = generateAxis( config.axisId, config.axisConfig.reverse, - isMobile ? false : config.axisConfig.display, + isMobile && config.axisConfig.hideOnMobile + ? false + : config.axisConfig.display, config.axisConfig.position, config.axisConfig.displayName, );