This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/cor 1159 collapsible thermometer description (#4468)
* imported CollapsibleSection and imported IndicatorLevelDescription component * Sanity keys added for this ticket * added component structure and elements * Responsive and sizes * Adjusted to the right colors * Update packages/app/src/components/collapsible/collapsible-section.tsx Co-authored-by: VWSCoronaDashboard25 <[email protected]> * Update packages/app/src/domain/topical/components/indicator-level-description.tsx Co-authored-by: VWSCoronaDashboard25 <[email protected]> * fix: resolve review feedback * fix: solved PR feedback * chore: fix single character variable Co-authored-by: VWSCoronaDashboard21 <[email protected]> Co-authored-by: VWSCoronaDashboard25 <[email protected]>
- Loading branch information
1 parent
b323e2a
commit 7fde2dc
Showing
6 changed files
with
116 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/app/src/domain/topical/components/indicator-level-description.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import css from '@styled-system/css'; | ||
import { SeverityIndicatorLevel } from '~/components/severity-indicator-tile/components/severity-indicator-label'; | ||
import { SeverityLevel } from '~/components/severity-indicator-tile/types'; | ||
import { replaceVariablesInText } from '~/utils'; | ||
import { asResponsiveArray } from '~/style/utils'; | ||
import { Text, BoldText } from '~/components/typography'; | ||
import { space } from '~/style/theme'; | ||
import { Box } from '~/components/base'; | ||
|
||
interface IndicatorLevelDescriptionProps { | ||
level: SeverityLevel; | ||
label: string; | ||
description: string; | ||
} | ||
|
||
export const IndicatorLevelDescription = ({ level, label, description }: IndicatorLevelDescriptionProps) => { | ||
return ( | ||
<li value={level}> | ||
<Box | ||
display="grid" | ||
gridTemplateRows="auto" | ||
gridTemplateColumns={`${space[4]} auto`} | ||
alignItems="center" | ||
marginBottom={4} | ||
css={css({ columnGap: 3, rowGap: asResponsiveArray({ _: 3, sm: 1 }) })} | ||
> | ||
<SeverityIndicatorLevel level={level}>{level}</SeverityIndicatorLevel> | ||
<BoldText>{label}</BoldText> | ||
<Text css={css({ gridColumnStart: asResponsiveArray({ _: 1, sm: 2 }), gridColumnEnd: 3 })}> | ||
{replaceVariablesInText(description.split('**').join(''), { | ||
label: label.toLowerCase(), | ||
})} | ||
</Text> | ||
</Box> | ||
</li> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters