Skip to content

Commit

Permalink
minor cleanup, removed unwanted console logs, and added i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Sep 1, 2024
1 parent d2447cd commit 07ebbb3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/Components/ABDM/ABHAProfileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { AbhaNumberModel } from "./types/abha";
import { useTranslation } from "react-i18next";
import * as Notify from "../../Utils/Notifications";

interface IProps {
patientId?: string;
Expand All @@ -21,9 +22,9 @@ const ABHAProfileModal = ({ patientId, show, onClose, abha }: IProps) => {
const printRef = useRef(null);

const downloadAbhaCard = async (type: "pdf" | "png") => {
console.log("downloadAbhaCard", type, patientId, abha);
if (!patientId || !abha?.abha_number) return;
console.log("downloadAbhaCard", type, patientId, abha);

Notify.Success({ msg: t("downloading_abha_card") });

const { res, data } = await request(routes.abdm.healthId.getAbhaCard, {
query: { abha_id: abha?.abha_number },
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ export default function PatientInfoCard(props: {
close();
setShowABHAProfile(true);
triggerGoal("Patient Card Button Clicked", {
buttonName: "Show ABHA Profile",
buttonName: t("show_abha_profile"),
consultationId: consultation?.id,
userId: authUser?.id,
});
Expand All @@ -757,25 +757,25 @@ export default function PatientInfoCard(props: {
icon="l-user-square"
className="text-lg text-primary-500"
/>
<span>Show ABHA Profile</span>
<span>{t("show_abha_profile")}</span>
</div>
<div
className="dropdown-item-primary pointer-events-auto m-2 flex cursor-pointer items-center justify-start gap-2 rounded border-0 p-2 text-sm font-normal transition-all duration-200 ease-in-out"
onClick={() => {
close();
setShowFetchABDMRecords(true);
triggerGoal("Patient Card Button Clicked", {
buttonName: "Fetch Records over ABDM",
buttonName: t("hi__fetch_records"),
consultationId: consultation?.id,
userId: authUser?.id,
});
}}
>
<CareIcon
icon="l-user-square"
icon="l-file-network"
className="text-lg text-primary-500"
/>
<span>Fetch Records over ABDM</span>
<span>{t("hi__fetch_records")}</span>
</div>
</>
)}
Expand All @@ -796,7 +796,7 @@ export default function PatientInfoCard(props: {
icon="l-link"
className="text-lg text-primary-500"
/>
<p>Link ABHA Number</p>
<p>{t("link_abha_profile")}</p>
</span>
</div>
)}
Expand Down
6 changes: 5 additions & 1 deletion src/Locale/en/ABDM.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,9 @@
"health_facility__not_registered_1.1": "The ABDM health facility is successfully linked with care",
"health_facility__not_registered_1.2": "but not registered as a service in bridge",
"health_facility__not_registered_2": "Click on Link Health Facility to register the service",
"health_facility__not_registered_3": "Not Registered"
"health_facility__not_registered_3": "Not Registered",
"downloading_abha_card": "Generating ABHA Card, Please hold on",
"abha_profile": "ABHA Profile",
"show_abha_profile": "Show ABHA Profile",
"link_abha_profile": "Link ABHA Profile"
}

0 comments on commit 07ebbb3

Please sign in to comment.