Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Add in-patient pictogram #1205

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:48](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L48)
[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:36](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L36)

___

Expand Down Expand Up @@ -1527,7 +1527,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:36](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L36)
[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:42](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L42)

___

Expand Down Expand Up @@ -1563,6 +1563,16 @@ ___

___

### InPatientPictogram

• `Const` **InPatientPictogram**: `MemoExoticComponent`<`ForwardRefExoticComponent`<[`PictogramProps`](API.md#pictogramprops) & `RefAttributes`<`SVGSVGElement`\>\>\>

#### Defined in

[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:48](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L48)

___

### InformationFilledIcon

• `Const` **InformationFilledIcon**: `MemoExoticComponent`<`ForwardRefExoticComponent`<[`IconProps`](API.md#iconprops) & `RefAttributes`<`SVGSVGElement`\>\>\>
Expand Down Expand Up @@ -1609,7 +1619,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:60](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L60)
[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:54](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L54)

___

Expand Down Expand Up @@ -1763,7 +1773,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:42](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L42)
[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:60](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L60)

___

Expand Down Expand Up @@ -1791,7 +1801,7 @@ ___

• `Const` **Pictogram**: `MemoExoticComponent`<`ForwardRefExoticComponent`<[`SvgPictogramProps`](API.md#svgpictogramprops) & `RefAttributes`<`SVGSVGElement`\>\>\>

This is a utility type for custom pictograms
This is a utility type for custom pictograms. Please maintain alphabetical order when adding new pictograms for readability.

#### Defined in

Expand Down Expand Up @@ -1885,7 +1895,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:54](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L54)
[packages/framework/esm-styleguide/src/pictograms/pictograms.tsx:72](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/pictograms/pictograms.tsx#L72)

___

Expand Down Expand Up @@ -2418,13 +2428,14 @@ ___

### getLocations

▸ **getLocations**(`tagUuidOrName?`): `Observable`<[`Location`](interfaces/Location.md)[]\>
▸ **getLocations**(`tagUuidOrName?`, `query?`): `Observable`<[`Location`](interfaces/Location.md)[]\>

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `tagUuidOrName` | ``null`` \| `string` | `null` |
| `query` | ``null`` \| `string` | `null` |

#### Returns

Expand Down Expand Up @@ -2908,13 +2919,14 @@ ___

### useLocations

▸ **useLocations**(`tagUuidOrName?`): [`Location`](interfaces/Location.md)[]
▸ **useLocations**(`tagUuidOrName?`, `query?`): [`Location`](interfaces/Location.md)[]

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `tagUuidOrName` | ``null`` \| `string` | `null` |
| `query` | ``null`` \| `string` | `null` |

#### Returns

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { addSvg } from '../svg-utils';
import appointments from './svgs/Appointments-2.svg';
import home from './svgs/Facility-2.svg';
import inPatient from './svgs/in-patient.svg';
import laboratory from './svgs/Labs.svg';
import appointments from './svgs/Appointments-2.svg';
import patientLists from './svgs/Patient Management_Patients.svg';
import serviceQueues from './svgs/service-queues.svg';
import patientRegistration from './svgs/registration.svg';
import serviceQueues from './svgs/service-queues.svg';

export function setupPictograms() {
addSvg('omrs-pict-home', home);
Expand All @@ -13,4 +14,5 @@ export function setupPictograms() {
addSvg('omrs-pict-appointments', appointments);
addSvg('omrs-pict-service-queues', serviceQueues);
addSvg('omrs-pict-registration', patientRegistration);
addSvg('omrs-pict-in-patient', inPatient);
}
38 changes: 22 additions & 16 deletions packages/framework/esm-styleguide/src/pictograms/pictograms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type SvgPictogramProps = {
};

/**
* This is a utility type for custom pictograms
* This is a utility type for custom pictograms. Please maintain alphabetical order when adding new pictograms for readability.
*/
export const Pictogram = memo(
forwardRef<SVGSVGElement, SvgPictogramProps>(function Pictogram({ pictogram, pictogramProps }, ref) {
Expand All @@ -33,27 +33,21 @@ export const Pictogram = memo(
}),
);

export const HomePictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function HomePictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-home" pictogramProps={props} />;
}),
);

export const PatientListsPictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function PatientListsPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-patient-lists" pictogramProps={props} />;
}),
);

export const AppointmentsPictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function AppointmentsPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-appointments" pictogramProps={props} />;
}),
);

export const ServiceQueuesPictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function ServiceQueuesPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-service-queues" pictogramProps={props} />;
export const HomePictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function HomePictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-home" pictogramProps={props} />;
}),
);

export const InPatientPictogram = memo(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be "Inpatient"?

Copy link
Member Author

@denniskigen denniskigen Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that's the established naming convention.

forwardRef<SVGSVGElement, PictogramProps>(function InPatientPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-in-patient" pictogramProps={props} />;
}),
);

Expand All @@ -63,8 +57,20 @@ export const LaboratoryPictogram = memo(
}),
);

export const PatientListsPictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function PatientListsPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-patient-lists" pictogramProps={props} />;
}),
);

export const RegistrationPictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function RegistrationPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-registration" pictogramProps={props} />;
}),
);

export const ServiceQueuesPictogram = memo(
forwardRef<SVGSVGElement, PictogramProps>(function ServiceQueuesPictogram(props, ref) {
return <Pictogram ref={ref} pictogram="omrs-pict-service-queues" pictogramProps={props} />;
}),
);
Loading