Skip to content

Commit

Permalink
replace navigate with goBack from appHistory for close button
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharsh05 committed Jan 11, 2024
1 parent 3a4cace commit 836a281
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Components/Facility/TreatmentSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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 { navigate } from "raviger";
import useAppHistory from "../../Common/hooks/useAppHistory";

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

Expand All @@ -28,6 +28,8 @@ const TreatmentSummary = (props: any) => {
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 @@ -107,14 +109,7 @@ const TreatmentSummary = (props: any) => {
>
<i className="fas fa-print mr-2"></i> Print Treatment Summary
</button>
<button
onClick={(_) =>
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`
)
}
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 836a281

Please sign in to comment.