-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (feat) Add a page header * Remove breadcrumbs registration * Update svg illustration
- Loading branch information
1 parent
4f5ef97
commit a47074d
Showing
15 changed files
with
235 additions
and
59 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
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
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,43 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Calendar, Location, UserFollow } from '@carbon/react/icons'; | ||
import { formatDate, useSession } from '@openmrs/esm-framework'; | ||
import Illustration from './illo.component'; | ||
import styles from './header.scss'; | ||
|
||
interface HeaderProps { | ||
title: string; | ||
} | ||
|
||
const Header: React.FC<HeaderProps> = ({ title }) => { | ||
const { t } = useTranslation(); | ||
const session = useSession(); | ||
const location = session?.sessionLocation?.display; | ||
|
||
return ( | ||
<div className={styles.header}> | ||
<div className={styles['left-justified-items']}> | ||
<Illustration /> | ||
<div className={styles['page-labels']}> | ||
<p>{t('formBuilder', 'Form builder')}</p> | ||
<p className={styles['page-name']}>{title}</p> | ||
</div> | ||
</div> | ||
<div className={styles['right-justified-items']}> | ||
<div className={styles.userContainer}> | ||
<p>{session?.user?.person?.display}</p> | ||
<UserFollow size={16} className={styles.userIcon} /> | ||
</div> | ||
<div className={styles['date-and-location']}> | ||
<Location size={16} /> | ||
<span className={styles.value}>{location}</span> | ||
<span className={styles.middot}>·</span> | ||
<Calendar size={16} /> | ||
<span className={styles.value}>{formatDate(new Date(), { mode: 'standard' })}</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Header; |
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,67 @@ | ||
@use '@carbon/layout'; | ||
@use '@carbon/type'; | ||
@import '~@openmrs/esm-styleguide/src/vars'; | ||
|
||
.header { | ||
@include type.type-style('body-compact-02'); | ||
color: $text-02; | ||
height: layout.$spacing-12; | ||
background-color: $ui-02; | ||
border-bottom: 1px solid $ui-03; | ||
display: flex; | ||
justify-content: space-between; | ||
padding: layout.$spacing-05; | ||
} | ||
|
||
.left-justified-items { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
cursor: pointer; | ||
align-items: center; | ||
} | ||
|
||
.right-justified-items { | ||
@include type.type-style('body-compact-02'); | ||
color: $text-02; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
|
||
.page-name { | ||
@include type.type-style('heading-04'); | ||
} | ||
|
||
.page-labels { | ||
margin: layout.$spacing-03; | ||
|
||
p:first-of-type { | ||
margin-bottom: layout.$spacing-02; | ||
} | ||
} | ||
|
||
.date-and-location { | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
} | ||
|
||
.userContainer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
gap: layout.$spacing-05; | ||
} | ||
|
||
.value { | ||
margin-left: layout.$spacing-02; | ||
} | ||
|
||
.middot { | ||
margin: 0 layout.$spacing-03; | ||
} | ||
|
||
.view { | ||
@include type.type-style('label-01'); | ||
} |
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,34 @@ | ||
import React from 'react'; | ||
|
||
const Illustration: React.FC = () => { | ||
return ( | ||
<svg | ||
height="64" | ||
width="64" | ||
viewBox="0 0 32 32" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlSpace="preserve" | ||
fill-rule="evenodd" | ||
clipRule="evenodd" | ||
strokeLinejoin="round" | ||
strokeMiterlimit="2" | ||
> | ||
<path | ||
d="M27 31.36H8a.36.36 0 0 1-.36-.36v-1.64H6a.36.36 0 0 1-.36-.36v-1.64H5a.36.36 0 0 1-.36-.36V3A.36.36 0 0 1 5 2.64h4.64V2a.36.36 0 0 1 .36-.36h1.64V1A.36.36 0 0 1 12 .64h4a.36.36 0 0 1 .36.36v.64H18a.36.36 0 0 1 .36.36v.64H23a.36.36 0 0 1 .36.36v1.64H25a.36.36 0 0 1 .36.36v1.64H27a.36.36 0 0 1 .36.36v24a.36.36 0 0 1-.36.36Z" | ||
fill="#d2e5e5" | ||
/> | ||
<path d="M8.36 30.64h18.28V7.36h-1.28V29a.36.36 0 0 1-.36.36H8.36v1.28Z" fill="#8abab8" /> | ||
<path | ||
d="M5.36 26.64h17.28V3.36h-4.28V4a.36.36 0 0 1-.36.36h-8A.36.36 0 0 1 9.64 4v-.64H5.36v23.28Z" | ||
fill="#8abab8" | ||
/> | ||
<path fill="#fff" d="M7.5 12.64h13v.72h-13zM7.5 8.64h13v.72h-13zM7.5 20.64h13v.72h-13zM7.5 16.64h13v.72h-13z" /> | ||
<path | ||
d="M10.36 3.64h7.28V2.36H16a.36.36 0 0 1-.36-.36v-.64h-3.28V2a.36.36 0 0 1-.36.36h-1.64v1.28ZM6.36 28.64h18.28V5.36h-1.28V27a.36.36 0 0 1-.36.36H6.36v1.28Z" | ||
fill="#8abab8" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default Illustration; |
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.