Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
change to different styled component
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrik-Klijnsma-Work committed Dec 21, 2022
1 parent c145790 commit e1c6e01
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions packages/app/src/components/choropleth-legenda.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<LegendaColorProps>`
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')};
`;

0 comments on commit e1c6e01

Please sign in to comment.