diff --git a/packages/esm-billing-app/src/billing-dashboard.component.tsx b/packages/esm-billing-app/src/billing-dashboard.component.tsx index 83a61e45a..718a33d21 100644 --- a/packages/esm-billing-app/src/billing-dashboard.component.tsx +++ b/packages/esm-billing-app/src/billing-dashboard.component.tsx @@ -2,16 +2,23 @@ import React from 'react'; import { Layer, Tile } from '@carbon/react'; import { EmptyDataIllustration } from '@openmrs/esm-patient-common-lib'; import styles from './billing-dashboard.scss'; +import BillingHeader from './billing-header/billing-header.component'; +import { useTranslation } from 'react-i18next'; export function BillingDashboard() { + const { t } = useTranslation(); + return ( - - -
- -
-

There are no billing records to display.

-
-
+ <> + + + +
+ +
+

{t('noBillingRecords', 'There are no billing records to display')}

+
+
+ ); } diff --git a/packages/esm-billing-app/src/billing-header/billing-header.component.tsx b/packages/esm-billing-app/src/billing-header/billing-header.component.tsx new file mode 100644 index 000000000..b4e3b26e3 --- /dev/null +++ b/packages/esm-billing-app/src/billing-header/billing-header.component.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { formatDate, useSession } from '@openmrs/esm-framework'; +import styles from './billing-header.scss'; +import BillingIllustration from './billing-illustration.component'; +import { Calendar, Location, UserFollow } from '@carbon/react/icons'; + +interface BillingHeaderProps { + title: string; +} + +const BillingHeader: React.FC = ({ title }) => { + const { t } = useTranslation(); + const session = useSession(); + const location = session?.sessionLocation?.display; + + return ( +
+
+ +
+

{t('billing', 'Billing')}

+

{title}

+
+
+
+
+

{session?.user?.person?.display}

+ +
+
+ + {location} + · + + {formatDate(new Date(), { mode: 'standard' })} +
+
+
+ ); +}; + +export default BillingHeader; diff --git a/packages/esm-billing-app/src/billing-header/billing-header.scss b/packages/esm-billing-app/src/billing-header/billing-header.scss new file mode 100644 index 000000000..aecb5f375 --- /dev/null +++ b/packages/esm-billing-app/src/billing-header/billing-header.scss @@ -0,0 +1,81 @@ +@use '@carbon/colors'; +@use '@carbon/styles/scss/spacing'; +@use '@carbon/styles/scss/type'; +@import '~@openmrs/esm-styleguide/src/vars'; + +.header { + @include type.type-style('body-compact-02'); + color: $text-02; + height: spacing.$spacing-12; + background-color: $ui-02; + border-bottom: 1px solid $ui-03; + display: flex; + justify-content: space-between; +} + +.left-justified-items { + display: flex; + flex-direction: row; + align-items: center; + cursor: pointer; +} + +.right-justified-items { + @include type.type-style('body-compact-02'); + color: $text-02; + margin: spacing.$spacing-03; +} + +.page-name { + @include type.type-style('heading-04'); +} + +.page-labels { + margin: spacing.$spacing-05 0; + + p:first-of-type { + margin-bottom: spacing.$spacing-02; + } +} + +.date-and-location { + display: flex; + justify-content: flex-end; + align-items: center; +} + +.userContainer { + display: flex; + justify-content: flex-end; + margin-bottom: spacing.$spacing-03; + gap: spacing.$spacing-05; +} + +.value { + margin-left: spacing.$spacing-02; +} + +.middot { + margin: 0 spacing.$spacing-03; +} + +.view { + @include type.type-style('label-01'); +} + +// Overriding styles for RTL support +html[dir='rtl'] { + .date-and-location { + & > svg { + order: -1; + } + & > span:nth-child(2) { + order: -2; + } + } +} + +.userIcon { + fill: $ui-05; + margin: spacing.$spacing-01; +} diff --git a/packages/esm-billing-app/src/billing-header/billing-illustration.component.tsx b/packages/esm-billing-app/src/billing-header/billing-illustration.component.tsx new file mode 100644 index 000000000..94647f411 --- /dev/null +++ b/packages/esm-billing-app/src/billing-header/billing-illustration.component.tsx @@ -0,0 +1,30 @@ +import React from 'react'; + +const BillingIllustration: React.FC = () => { + return ( + + Billing module illustration + + + + + + + + ); +}; + +export default BillingIllustration; diff --git a/packages/esm-billing-app/src/routes.json b/packages/esm-billing-app/src/routes.json index 717c72524..e54f60e8b 100644 --- a/packages/esm-billing-app/src/routes.json +++ b/packages/esm-billing-app/src/routes.json @@ -21,4 +21,4 @@ "slot": "billing-dashboard-slot" } ] -} +} \ No newline at end of file