Skip to content

Commit

Permalink
address comments on the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyjemutai committed Jul 3, 2024
1 parent 0c48fab commit ea169b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import React from 'react';
import { useConfig } from '@openmrs/esm-framework';
import { getMenuItemTabConfiguration, TabsComponent } from '@ohri/openmrs-esm-ohri-commons-lib';
import { TabsComponent } from '@ohri/openmrs-esm-ohri-commons-lib';
import cacxConfigSchema from './cacx-config.json';

interface OverviewListProps {
patientUuid: string;
}

const CaCxCervicalCancerServices: React.FC<OverviewListProps> = ({ patientUuid }) => {
const config = useConfig();
const tabs = getMenuItemTabConfiguration(cacxConfigSchema, config);

return <TabsComponent patientUuid={patientUuid} tabsConfig={tabs} />;
return <TabsComponent patientUuid={patientUuid} configSchema={cacxConfigSchema} />;
};

export default CaCxCervicalCancerServices;
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React from 'react';
import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
import { EncounterList } from '@ohri/openmrs-esm-ohri-commons-lib';
import styles from './common.scss';
import { useConfig } from '@openmrs/esm-framework';
import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib';
import styles from './encounter-list-tabs.scss';

interface OverviewListProps {
interface TabsComponentProps {
patientUuid: string;
tabsConfig: any[];
configSchema: any;
}

export const TabsComponent: React.FC<OverviewListProps> = ({ patientUuid, tabsConfig }) => {
export const TabsComponent: React.FC<TabsComponentProps> = ({ patientUuid, configSchema }) => {
const config = useConfig();
const tabsConfig = getMenuItemTabConfiguration(configSchema, config);

return (
<div className={styles.tabContainer}>
<Tabs>
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-commons-lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export * from './utils/summary-card-config-builder';
export * from './utils/encounter-tile-config-builder';
export * from './utils/cohort-list-config-builder';
export * from './utils/patient-list-tabs-config-builder';
export * from './components/encounter-tabs/encounter-tabs.component';
export * from './components/encounter-list-tabs/encounter-list-tabs.component';
// Workspace registration moved to the index.ts and routes.json
const options = {
featureName: 'ohri-forms-workspace-item',
Expand Down

0 comments on commit ea169b5

Please sign in to comment.