From 8f3c276f00108e74ca5011b4e4a125ff79fc59d5 Mon Sep 17 00:00:00 2001 From: Daphne210 Date: Sat, 14 Oct 2023 13:57:52 +0300 Subject: [PATCH] Making the icon on the header configurable --- .../header/home-header.component.tsx | 6 ++-- src/components/header/home-header.scss | 12 +++++++ .../header/home-illustration.component.tsx | 35 +++++-------------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/components/header/home-header.component.tsx b/src/components/header/home-header.component.tsx index 71d623a..abf4b36 100644 --- a/src/components/header/home-header.component.tsx +++ b/src/components/header/home-header.component.tsx @@ -1,6 +1,6 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Calendar, Location } from "@carbon/react/icons"; +import { Calendar, Events, Location } from "@carbon/react/icons"; import { formatDate, useSession } from "@openmrs/esm-framework"; import { HomeIllustration } from "./home-illustration.component"; import styles from "./home-header.scss"; @@ -26,7 +26,7 @@ export const HomeHeader: React.FC = ({ <>
- + } />

{t("home", "Home")}

{headerTitle}

@@ -34,7 +34,7 @@ export const HomeHeader: React.FC = ({
- {icon} + {userLocation} · diff --git a/src/components/header/home-header.scss b/src/components/header/home-header.scss index f74531a..b69416a 100644 --- a/src/components/header/home-header.scss +++ b/src/components/header/home-header.scss @@ -80,3 +80,15 @@ left: -10.15rem; } } + +svg.iconOverrides { + width: 72px !important; + height: 72px !important; + fill: var(--brand-03); +} + +.svgContainer svg { + width: 72px; + height: 72px; + fill: var(--brand-03); +} diff --git a/src/components/header/home-illustration.component.tsx b/src/components/header/home-illustration.component.tsx index 2c9d9c9..fce5476 100644 --- a/src/components/header/home-illustration.component.tsx +++ b/src/components/header/home-illustration.component.tsx @@ -1,29 +1,12 @@ import React from "react"; +import styles from "./home-header.scss"; -export const HomeIllustration: React.FC = () => { - return ( - - - - - - - - - - - ); +export interface HomeIllustrationProps { + icon: React.ReactNode; +} + +export const HomeIllustration: React.FC = ({ icon }) => { + return
{icon}
; }; + +export default HomeIllustration;