-
Notifications
You must be signed in to change notification settings - Fork 437
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
πͺ Adds type safety for CareIcon
names + β¨ reduced index.css size by 95% + Refactor string interpolated tw classes
#6034
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
β Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
CareIcon
names + Refactor string interpolated tw classes + β¨ index.css down -7.6mbCareIcon
names + β¨ reduced index.css size by 95% + Refactor string interpolated tw classes
LGTM |
@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us π₯. We always welcome your contribution π, so feel free to contribute to anything anytime, and never lose that spirit of innovation π. |
WHAT
π€ Generated by Copilot at 3ff1fd2
This pull request improves the UI components and icons used in various screens of the application. It refactors the
CareIcon
,Chip
,CountBlock
, andButtonV2
components to use the Unicon icon library, theIconName
type, and thevariant
prop for consistent and type-safe styling. It also simplifies the code for generating class names and removes unnecessary props. It updates the components that use these common UI elements to reflect the changes and to enhance the appearance and functionality. It moves theChip
andCountBlock
components from./src/CAREUI/display
to./src/Components/Common/components
to make them more accessible.Proposed Changes
index.css
before: 506 kb;index.css
after: 25.6 kB;Updated usage of
CareIcon
Backwards compatible too
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
π€ Generated by Copilot at 3ff1fd2
Chip
andCountBlock
components to./src/Components/Common/components
folder to make them reusable (link, link)CareIcon
component to accepticon
prop of typeIconName
and useeffectiveClassName
variable for icon transformation and re-rendering (link, link)IconName
type and Unicon icons forFACILITY_FEATURE_TYPES
array in./src/Common/constants.tsx
(link, link)color
prop withvariant
prop and use Unicon icons forChip
component in various components (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)CountBlock
component and Unicon icons for displaying total counts in various components (link, link, link, link, link)ButtonVariant
type from./src/Components/Common/components/ButtonV2
to./src/Components/Common/PatientCategoryBadge.tsx
for definingPATIENT_CATEGORIES
array (link)align
prop fromButtonV2
component and its type definition as it was causing layout issues (link, link, link)variant
prop andclassNames
helper function for icon color inDropdownItem
component in./src/Components/Common/components/Menu.tsx
(link)classNames
helper function for generating dynamic class names inFacilityCard
component in./src/Components/Facility/FacilityCard.tsx
andPatientCategorySelect
component in./src/Components/Patient/PatientCategorySelect.tsx
(link, link, link, link)ButtonV2
component and wrap icon and text in adiv
element with flex classes for alignment inPrescriptionBuilder
component in./src/Components/Medicine/PrescriptionBuilder.tsx
and various components in./src/Components/Patient/PatientHome.tsx
(link, link, link, link, link, link, link, link, link, link, link, link, link)align
prop fromButtonV2
component in./src/Components/Patient/PatientInfoCard.tsx
(link)span
element with flex classes for alignment inButtonV2
component in./src/Components/Patient/PatientInfoCard.tsx
(link, link)