Skip to content

Commit

Permalink
feat: changed IPD page title [Ayush] (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush34957 committed Mar 29, 2024
1 parent 9ffbaed commit 2c4859a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ export const IPD_WARD_SEARCH_PLACEHOLDER_TEXT =

export const MOBILE_BREAKPOINT = 480;
export const TABLET_BREAKPOINT = 1024;

export const IPD_PAGE_TITLE = "IPD";
10 changes: 9 additions & 1 deletion src/entries/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { SliderContext } from "../../context/SliderContext";
import { IPDContext } from "../../context/IPDContext";
import { AllMedicationsContextProvider } from "../../context/AllMedications";
import { FormattedMessage } from "react-intl";
import { RESOLUTION_VALUE } from "../../constants";
import { RESOLUTION_VALUE, IPD_PAGE_TITLE } from "../../constants";

export default function Dashboard(props) {
const { hostData, hostApi } = props;
Expand Down Expand Up @@ -82,6 +82,14 @@ export default function Dashboard(props) {
};
}, []);

useEffect(() => {
const prevTitle = document.title;
document.title = IPD_PAGE_TITLE;
return () => {
document.title = prevTitle;
};
}, []);

const onClickSideNavExpand = () => {
updateSideNav(!isSideNavExpanded);
};
Expand Down

0 comments on commit 2c4859a

Please sign in to comment.