Skip to content

Commit

Permalink
Fixed close Button in Treatment Summary (#7001)
Browse files Browse the repository at this point in the history
* fix close Button in Treatment Summary

* replace navigate with goBack from appHistory for close button
  • Loading branch information
sriharsh05 authored Jan 31, 2024
1 parent fa4abbe commit 2fe3b2d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Components/Facility/TreatmentSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { PatientModel } from "../Patient/models";

import { GENDER_TYPES } from "../../Common/constants";
import { formatAge, formatDate, formatDateTime } from "../../Utils/utils";
import useSlug from "../../Common/hooks/useSlug";
import useAppHistory from "../../Common/hooks/useAppHistory";

const Loading = lazy(() => import("../Common/Loading"));

Expand All @@ -25,6 +27,9 @@ const TreatmentSummary = (props: any) => {
const [isLoading, setIsLoading] = useState(false);
const [investigations, setInvestigations] = useState<Array<any>>([]);
const [dailyRounds, setDailyRounds] = useState<any>({});
const facilityId = useSlug("facility");
const { goBack } = useAppHistory();
const url = `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`;

const fetchPatientData = useCallback(
async (status: statusType) => {
Expand Down Expand Up @@ -104,10 +109,7 @@ const TreatmentSummary = (props: any) => {
>
<i className="fas fa-print mr-2"></i> Print Treatment Summary
</button>
<button
onClick={(_) => window.history.go(-1)}
className="btn btn-default"
>
<button onClick={(_) => goBack(url)} className="btn btn-default">
<i className="fas fa-times mr-2"></i> Close
</button>
</div>
Expand Down

0 comments on commit 2fe3b2d

Please sign in to comment.