Skip to content

Commit

Permalink
Added Edit Patient Details Button in the Patient Actions Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vasharma05 committed Apr 21, 2021
1 parent 2c89a66 commit 18d7e73
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ function setupOpenMRS() {
slot: 'top-nav-actions-slot',
load: getAsyncLifecycle(() => import('./add-patient-link'), options),
},
{
id: 'edit-patient-details-button',
slot: 'patient-actions-slot',
load: getAsyncLifecycle(() => import('./widgets/edit-patient-details-button.component'), options),
},
],
};
}
Expand Down
19 changes: 19 additions & 0 deletions src/widgets/edit-patient-details-button.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { ConfigurableLink } from '@openmrs/esm-framework';
import { useTranslation } from 'react-i18next';

export default function EditPatientDetailsButton({ patientUuid }) {
const { t } = useTranslation();
return (
<li className="bx--overflow-menu-options__option">
<ConfigurableLink
to={`\${openmrsSpaBase}/patient/${patientUuid}/edit`}
className="bx--overflow-menu-options__btn"
title={t('Edit Patient Details', 'Edit Patient Details')}>
<span className="bx--overflow-menu-options__option-content">
{t('Edit Patient Details', 'Edit Patient Details')}
</span>
</ConfigurableLink>
</li>
);
}

0 comments on commit 18d7e73

Please sign in to comment.