From 7fde2dcc7e215ab2f30017ef3232cd6624593d70 Mon Sep 17 00:00:00 2001 From: J <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Mon, 24 Oct 2022 16:20:19 +0200 Subject: [PATCH] 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 <98813868+VWSCoronaDashboard25@users.noreply.github.com> * Update packages/app/src/domain/topical/components/indicator-level-description.tsx Co-authored-by: VWSCoronaDashboard25 <98813868+VWSCoronaDashboard25@users.noreply.github.com> * fix: resolve review feedback * fix: solved PR feedback * chore: fix single character variable Co-authored-by: VWSCoronaDashboard21 Co-authored-by: VWSCoronaDashboard25 <98813868+VWSCoronaDashboard25@users.noreply.github.com> --- .../collapsible/collapsible-section.tsx | 44 +++++++------------ .../components/severity-indicator-label.tsx | 18 ++------ .../indicator-level-description.tsx | 37 ++++++++++++++++ packages/app/src/domain/topical/index.ts | 4 +- packages/app/src/pages/index.tsx | 42 ++++++++++++++++-- packages/cms/src/lokalize/key-mutations.csv | 16 +++++++ 6 files changed, 116 insertions(+), 45 deletions(-) create mode 100644 packages/app/src/domain/topical/components/indicator-level-description.tsx diff --git a/packages/app/src/components/collapsible/collapsible-section.tsx b/packages/app/src/components/collapsible/collapsible-section.tsx index c7d6ee461b..b9205e65ec 100644 --- a/packages/app/src/components/collapsible/collapsible-section.tsx +++ b/packages/app/src/components/collapsible/collapsible-section.tsx @@ -6,20 +6,18 @@ import { isAtBottomOfPage } from '~/utils/is-at-bottom-of-page'; import { isElementAtTopOfViewport } from '~/utils/is-element-at-top-of-viewport'; import { useCollapsible } from '~/utils/use-collapsible'; import { Anchor } from '../typography'; +import { colors } from '@corona-dashboard/common'; interface CollapsibleSectionProps extends BoxProps { summary: string; children: ReactNode; id?: string; hideBorder?: boolean; + textColor?: string; + borderColor?: string; } -export const CollapsibleSection = ({ - summary, - children, - id, - hideBorder, -}: CollapsibleSectionProps) => { +export const CollapsibleSection = ({ summary, children, id, hideBorder, textColor = colors.blue8, borderColor = colors.gray2 }: CollapsibleSectionProps) => { const section = useRef(null); const collapsible = useCollapsible(); @@ -53,24 +51,13 @@ export const CollapsibleSection = ({ }, [toggle, id]); return ( - + {collapsible.button( - + {summary} {id && ( -