From e1c6e01f6d00af548178366b28da86aaef6210f9 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard18 <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Wed, 21 Dec 2022 11:58:22 +0100 Subject: [PATCH] change to different styled component --- .../app/src/components/choropleth-legenda.tsx | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/app/src/components/choropleth-legenda.tsx b/packages/app/src/components/choropleth-legenda.tsx index 47e02948bf..622172a259 100644 --- a/packages/app/src/components/choropleth-legenda.tsx +++ b/packages/app/src/components/choropleth-legenda.tsx @@ -1,5 +1,4 @@ import { ChoroplethThresholdsValue, colors } from '@corona-dashboard/common'; -import { css } from '@styled-system/css'; import styled from 'styled-components'; import { ValueAnnotation } from '~/components/value-annotation'; import { useIntl } from '~/intl'; @@ -57,19 +56,19 @@ export function ChoroplethLegenda({ title, thresholds, valueAnnotation, pageType ); } -const LegendaColor = styled.div<{ +type LegendaColorProps = { first?: boolean; last?: boolean; width?: string; color: string; -}>((x) => - css({ - width: '100%', - height: '10px', - flexGrow: 0, - flexShrink: 0, - flexBasis: x.width, - borderRadius: x.first ? '2px 0 0 2px' : x.last ? '0 2px 2px 0' : 0, - backgroundColor: x.color, - }) -); +}; + +const LegendaColor = styled.div` + width: 100%; + height: 10px; + flex-grow: 0; + flex-shrink: 0; + flex-basis: ${({ width }) => (width ? width : 'inherit')}; + border-radius: ${({ first, last }) => (first ? '2px 0 0 2px' : last ? '0 2px 2px 0' : 0)}; + background-color: ${({ color }) => (color ? color : 'inherit')}; +`;