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.
COR-1135: dynamic-thermometer (#4464)
* feat: new descriptions added to thermometer * feat: fixed color mapping and changes some logic * feat: add icon direction function and type Co-authored-by: VWSCoronaDashboard27 <[email protected]> Co-authored-by: VWSCoronaDashboard19 <[email protected]>
- Loading branch information
1 parent
9647e20
commit b323e2a
Showing
15 changed files
with
377 additions
and
322 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
"Close", | ||
"CloseThick", | ||
"ContactBeroepen", | ||
"Coronathermometer", | ||
"Coronavirus", | ||
"Cross", | ||
"Database", | ||
|
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
2 changes: 1 addition & 1 deletion
2
packages/app/src/components/severity-indicator-tile/constants.ts
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,4 +1,4 @@ | ||
export const TOPICAL_SEVERITY_INDICATOR_TILE_MAX_WIDTH = 930; | ||
export const SEVERITY_INDICATOR_TILE_COLUMN_MIN_WIDTH = 250; | ||
export const SEVERITY_LEVELS_LIST = ['1', '2', '3', '4']; | ||
export const THERMOMETER_ICON_NAME = 'Stopwatch'; | ||
export const THERMOMETER_ICON_NAME = 'Coronathermometer'; |
15 changes: 15 additions & 0 deletions
15
packages/app/src/components/severity-indicator-tile/logic/map-string-to-colors.ts
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,15 @@ | ||
import { colors } from "@corona-dashboard/common"; | ||
import { ICON_COLOR_GREEN, ICON_COLOR_RED } from "~/domain/topical/common"; | ||
|
||
/** | ||
* Match strings from Sanity to certain color codes | ||
*/ | ||
|
||
export const mapStringToColors = (color: string | undefined) => { | ||
switch (color) { | ||
case ICON_COLOR_RED: | ||
return colors.red2; | ||
case ICON_COLOR_GREEN: | ||
return colors.green3; | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/app/src/components/severity-indicator-tile/logic/set-trend-icon.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,11 @@ | ||
import { Down, Up } from '@corona-dashboard/icons'; | ||
import { ICON_DIRECTION_DOWN } from '~/domain/topical/common'; | ||
|
||
/** | ||
* Set the correction icon for specific direction that is beign passed. | ||
* */ | ||
|
||
export const setTrendIcon = (direction: string) => { | ||
if (direction === ICON_DIRECTION_DOWN) return <Down />; | ||
return <Up />; | ||
}; |
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
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,6 @@ | ||
import { ICON_DIRECTION_DOWN, ICON_DIRECTION_UP } from '~/domain/topical/common'; | ||
|
||
export type TrendIcon = { | ||
direction: typeof ICON_DIRECTION_UP | typeof ICON_DIRECTION_DOWN; | ||
color: string; | ||
}; |
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
Oops, something went wrong.