-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* update(OH2-228): Add hospital info on print * fix: Fix e2e tests failing * refactor: Remove unused imports
- Loading branch information
Showing
6 changed files
with
100 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { FC, useEffect } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import logo from "../../../assets/logo-color.svg"; | ||
import "./styles.scss"; | ||
import { TProps } from "./types"; | ||
import { IState } from "../../../types"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { getHospital } from "../../../state/hospital/actions"; | ||
import { HospitalDTO } from "../../../generated"; | ||
|
||
export const HospitalInfo: FC<TProps> = ({}) => { | ||
const dispatch = useDispatch(); | ||
const { t } = useTranslation(); | ||
useEffect(() => { | ||
dispatch(getHospital()); | ||
}, [dispatch, getHospital]); | ||
|
||
const hospital = useSelector<IState>( | ||
(state) => state.hospital.getHospital.data | ||
) as HospitalDTO; | ||
|
||
return ( | ||
<div className="hospitalInfo"> | ||
<div className="hospitalInfo__background"> | ||
<div className="hospitalInfo__logo"> | ||
<img src={logo} alt="Open Hospital" height="45px" /> | ||
</div> | ||
<div className="hospitalInfo__main"> | ||
<div className="hospitalInfo__main__headline"> | ||
{hospital?.description ?? t("common.hospitalname")} | ||
</div> | ||
<div className="hospitalInfo__main__details"> | ||
{hospital?.city && <div>{hospital.city}</div>} | ||
{hospital?.address && <div>{hospital.address}</div>} | ||
{hospital?.fax && <div>{hospital.fax}</div>} | ||
{hospital?.email && <div>{hospital.email}</div>} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
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,44 @@ | ||
@import "../../../styles/variables"; | ||
@import "../../../../node_modules/susy/sass/susy"; | ||
|
||
.hospitalInfo { | ||
display: none; | ||
box-shadow: 0 4px 8px 0 rgba(48, 49, 51, 0.1); | ||
width: 100%; | ||
margin-bottom: 32px; | ||
.hospitalInfo__background { | ||
display: flex; | ||
align-items: flex-end; | ||
justify-content: space-between; | ||
background-color: $c-white; | ||
padding: 30px 30px 20px 30px; | ||
width: 100%; | ||
} | ||
|
||
.hospitalInfo__logo { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-right: 30px; | ||
} | ||
.hospitalInfo__main { | ||
display: flex; | ||
flex-flow: wrap column; | ||
align-items: end; | ||
.hospitalInfo__main__headline { | ||
font-size: x-large; | ||
font-weight: bolder; | ||
margin-bottom: 5px; | ||
} | ||
.hospitalInfo__main__details { | ||
display: flex; | ||
font-size: small; | ||
font-weight: 300; | ||
color: $c-grey-light; | ||
column-gap: 24px; | ||
} | ||
} | ||
@media print { | ||
display: flex; | ||
} | ||
} |
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,8 @@ | ||
import { TUserCredentials } from "../../../state/main/types"; | ||
import { TAPIResponseStatus } from "../../../state/types"; | ||
|
||
export type TBreadcrumbMap = Record<string, string>; | ||
|
||
export interface IOwnProps {} | ||
|
||
export type TProps = IOwnProps; |
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