From 85b81ed56f023b6f13c839a53ba6dd2f308f1cba Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard18 <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:53:26 +0200 Subject: [PATCH] Update type naming for singlar and plural colorMatches --- .../variants/static-props/get-variant-order-colors.ts | 6 +++--- .../variants/static-props/get-variant-table-data.ts | 4 ++-- .../variants-stacked-area-tile.tsx | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts b/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts index 4e1d408ae9..c417612fdd 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts @@ -2,12 +2,12 @@ import { NlVariants, colors } from '@corona-dashboard/common'; import { isDefined } from 'ts-is-present'; import { VariantCode } from './' -type SingleColorMatchType = { +type ColorMatch = { variant: VariantCode; color: string; }; -export type ColorMatch = SingleColorMatchType[]; +export type ColorMatches = ColorMatch[]; const getColorForVariant = (variantCode: VariantCode, index: number): string => { if (variantCode === 'other_table') return colors.data.variants.other_table; @@ -18,7 +18,7 @@ const getColorForVariant = (variantCode: VariantCode, index: number): string => export function getVariantOrderColors( variants: NlVariants | undefined -): ColorMatch { +): ColorMatches { if (!isDefined(variants) || !isDefined(variants.values)) { return []; } diff --git a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts index feefe1586b..fe1a41946b 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts @@ -7,7 +7,7 @@ import { } from '@corona-dashboard/common'; import { first } from 'lodash'; import { isDefined, isPresent } from 'ts-is-present'; -import { ColorMatch } from './get-variant-order-colors'; +import { ColorMatches } from './get-variant-order-colors'; import { VariantCode } from '../static-props'; export type VariantRow = { @@ -22,7 +22,7 @@ export type VariantTableData = ReturnType; export function getVariantTableData( variants: NlVariants | undefined, namedDifference: NlNamedDifference, - variantColors: ColorMatch + variantColors: ColorMatches ) { const emptyValues = { variantTable: null, diff --git a/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx b/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx index 14b351ec9f..81b8e05dc7 100644 --- a/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx +++ b/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx @@ -19,7 +19,7 @@ import { VariantChartValue } from '~/domain/variants/static-props'; import { SiteText } from '~/locale'; import { useList } from '~/utils/use-list'; import { - ColorMatch, + ColorMatches, VariantCode, VariantCodesAll, } from '~/domain/variants/static-props'; @@ -32,7 +32,7 @@ type VariantsStackedAreaTileText = { type VariantsStackedAreaTileProps = { text: VariantsStackedAreaTileText; values?: VariantChartValue[] | null; - variantColors: ColorMatch; + variantColors: ColorMatches; metadata: MetadataProps; children?: ReactNode; noDataMessage?: ReactNode; @@ -76,7 +76,7 @@ type VariantStackedAreaTileWithDataProps = { text: VariantsStackedAreaTileText; values: VariantChartValue[]; metadata: MetadataProps; - variantColors: ColorMatch; + variantColors: ColorMatches; children?: ReactNode; }; @@ -208,7 +208,7 @@ function useFilteredSeriesConfig( function useSeriesConfig( text: VariantsStackedAreaTileText, values: VariantChartValue[], - variantColors: ColorMatch + variantColors: ColorMatches ) { return useMemo(() => { const baseVariantsFiltered = values