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.
- Loading branch information
1 parent
1e545ad
commit b7fdc19
Showing
3 changed files
with
49 additions
and
33 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
42 changes: 22 additions & 20 deletions
42
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 |
---|---|---|
@@ -1,35 +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 } from '~/components/typography'; | ||
import { Box } from '~/components/base'; | ||
import css from '@styled-system/css'; | ||
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) => { | ||
export const IndicatorLevelDescription = ({ level, label, description }: IndicatorLevelDescriptionProps) => { | ||
return ( | ||
<Box | ||
display="grid" | ||
gridTemplateRows="auto" | ||
gridTemplateColumns={`${space[4]} auto`} | ||
alignItems="center" | ||
mb={4} | ||
css={css({ columnGap: 3, rowGap: asResponsiveArray({ _: 3, sm: 1 }) })} | ||
> | ||
<SeverityIndicatorLevel level={level}>{level}</SeverityIndicatorLevel> | ||
<Text fontWeight="bold">{label}</Text> | ||
<Text css={css({ gridColumnStart: asResponsiveArray({ _: 1, sm: 2 }), gridColumnEnd: 3 })}> | ||
{replaceVariablesInText(description.split('**').join(''), { | ||
label: label.toLowerCase(), | ||
})} | ||
</Text> | ||
</Box> | ||
<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 fontWeight="bold">{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