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

Replaced ButtonV2's with Button in entire codebase #9736

Merged
merged 12 commits into from
Jan 5, 2025

Conversation

Mahendar0701
Copy link
Contributor

@Mahendar0701 Mahendar0701 commented Jan 4, 2025

Proposed Changes

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

Summary by CodeRabbit

Release Notes

  • Localization

    • Added new localization key for patient updates: "Add Patient Updates"
  • UI Components

    • Replaced ButtonV2 with a new Button component across multiple components
    • Added new button variants: warning and alert
    • Updated button styling and internationalization support
  • Button Variants

    • Changed some button variants from danger to destructive
    • Introduced more consistent button styling across the application
  • Layout Improvements

    • Refined button and component alignments in various screens
    • Improved responsive design for buttons and layout elements
  • Deprecation

    • Removed ButtonV2 component and associated type definitions
    • Deprecated Chip component in favor of Badge

@Mahendar0701 Mahendar0701 requested a review from a team as a code owner January 4, 2025 09:53
Copy link
Contributor

coderabbitai bot commented Jan 4, 2025

Walkthrough

This pull request introduces a comprehensive refactoring of button components across the codebase, replacing the custom ButtonV2 with a standardized Button component. The changes span multiple files and components, focusing on improving UI consistency, localization, and type safety. Key modifications include updating button variants, adding new localization keys, and streamlining button implementations across different parts of the application.

Changes

File Path Change Summary
public/locale/en.json Added new localization key "add_patient_updates"
src/CAREUI/display/Callout.tsx Updated variant prop type to explicit string literals
src/components/ui/button.tsx Added warning and alert button variants
Multiple files Replaced ButtonV2 with Button component from @/components/ui/button
Various patient detail tabs Updated button variants and styling

Assessment against linked issues

Objective Addressed Explanation
Uniform button variants Button variants standardized across patient detail tabs
Replace ButtonV2 with Button ButtonV2 components replaced throughout codebase
Button alignment on mobile Layout classes updated for responsive alignment

Possibly related PRs

Suggested labels

tested, reviewed, P1

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

🐰 Buttons dancing, variants bright,
Code refactored with pure delight!
ButtonV2 waves a fond goodbye,
New components now touch the sky!
Consistency reigns, clean and neat,
Our rabbit's code transformation is sweet! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 4, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 4ebf027
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/677ab2bbdcde5c000843bf1a
😎 Deploy Preview https://deploy-preview-9736--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (30)
src/hooks/useFileManager.tsx (3)

311-320: Consider using a destructive variant for the irreversible “proceed” action.
Archiving a file is irreversible, so it may be clearer to use a “danger” (destructive) variant or styling to emphasize the consequence. Verify with your design team if the “primary” variant is acceptable for destructive actions.

- <Button type="submit" variant="primary" disabled={archiving}>
+ <Button type="submit" variant="danger" disabled={archiving}>

397-403: Remove unused parameter to keep code concise.
The arrow function’s parameter _ is not used. Omitting it clarifies that the event object is unnecessary.

- onClick={(_) => setArchiveDialogueOpen(null)}
+ onClick={() => setArchiveDialogueOpen(null)}

444-461: Surface a loading indicator in addition to disabling the button.
You’re already disabling the submit button while editing is true, which is great. However, consider showing a small spinner or loading text to improve user feedback when the renaming process might be slow.

src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx (2)

65-65: Enhance reusability for this repeated container style
This change effectively ensures that the creation button is centered on smaller screens and right-aligned on medium screens and above. However, notice that the same Tailwind classes (i.e., "flex justify-center md:justify-end mt-2 mb-4") appear again at line 93. To adhere to the DRY principle, consider extracting these shared container styles into a reusable layout component or a utility variable.


93-93: Maintain consistent layout approach
Similar to line 65, this line ensures a responsive alignment for the creation button. Reusing these shared utility classes across different sections is a good approach, but it might be cleaner to define them in a single place. This helps with maintenance and keeps the layout consistent across the app.

src/components/Common/Menu.tsx (1)

104-116: Validate overlapping color variants

The new variants (e.g. danger and destructive) share the same color token. If that's intentional, documenting the distinction between them will help maintain clarity and consistency across the design system. Otherwise, consider assigning a unique style.

src/CAREUI/display/Callout.tsx (1)

18-32: Centralize variant class definitions.
Extracting variant classes into a dictionary is a clean approach; if multiple components need these same variant definitions, consider moving them to a shared theme file to avoid duplication.

src/CAREUI/interactive/Zoom.tsx (2)

72-75: Consider using the “icon” size variant
Since this button’s content is purely an icon, using the “icon” size variant (if available) could simplify styling and maintain consistent UI spacing across the application.

-<Button
-  disabled={props.disabled}
-  variant="ghost"
-  className="p-2.5 rounded-full"
-  onClick={ctx.zoomIn}
->
+<Button
+  disabled={props.disabled}
+  variant="ghost"
+  size="icon"
+  onClick={ctx.zoomIn}
+>

83-86: Apply the same icon button approach
Similarly consider the “icon” size variant for the zoom-out button to maintain consistency.

src/components/Patient/PatientConsentRecordBlock.tsx (1)

91-100: Avoid needing a full page reload
While this logic works fine, relying on window.location.reload() could be disruptive to user experience. Consider using local state or re-fetching data to update the UI without a full reload.

src/components/ui/button.tsx (2)

7-19: Document new variants
Consider adding short docstrings or comments for each variant in ButtonVariant to improve readability and consistency, especially for newer team members.


72-74: Provide a brief description for label
Adding a short docstring or TSDoc comment for the optional label prop would clarify how it should be used in conjunction with the button’s children.

src/components/Users/UserAvatar.tsx (1)

104-119: Tooltip-based disable is user-friendly, but consider accessibility
Wrapping a disabled button in a tooltip is a good UI pattern, but consider ensuring that screen readers announce why it’s disabled (e.g., via aria-disabled or an aria-describedby attribute referencing the tooltip content).

src/components/Patient/PatientDetailsTab/ResourceRequests.tsx (1)

63-63: Consider specifying a more uniform naming convention for variants.
It might be beneficial to adopt a standardized naming convention for button variants, such as outline vs. outline_primary, to make your system more predictable for future changes. You could rename outline_primary to something like outlinePrimary or simply outline for clarity.

src/CAREUI/display/PopupModal.tsx (2)

49-51: Ensure consistent labeling or user feedback upon save.
Everything appears correct for the save action. Consider providing immediate feedback or a loading state in the UI if the save operation might be lengthy.


153-155: Add loading or disabled feedback if necessary.
Similar to the mobile view, consider providing the user with a loading indicator or a disabled state if the submit operation involves backend calls.

src/components/Form/Form.tsx (1)

151-159: Review the submit workflow.
Overall usage is fine. Consider further enhancements, such as disabling the button once clicked or showing a spinner to indicate submission status if the form submission is asynchronous.

src/components/Common/Pagination.tsx (1)

174-185: Consider accessibility for tooltip text on the button.

When using the tooltip class with visually hidden or dynamic text, ensure users who rely on screen readers can access this tooltip content. One approach is to include accessible labels/aria attributes.

src/components/Common/UpdatableApp.tsx (1)

139-141: Localize the button text.

Currently, the strings "Updating..." and "Update" do not appear to use t() for localization. Consider localizing these strings for consistency with other text in this file.

src/components/Auth/ResetPassword.tsx (1)

177-190: Remove redundant onClick handler for the submit button.

Because the button is already of type "submit" and your form has an onSubmit handler, it is not strictly necessary to call handleSubmit again within onClick(). This minor cleanup can help reduce duplication.

<Button
  variant="primary"
  type="submit"
- onClick={(e) => handleSubmit(e)}
>
  <span>{t("reset")}</span>
</Button>
src/components/Files/CameraCaptureDialog.tsx (2)

167-186: Retake / Submit Buttons Realignment

Using the same primary styling for both "Retake" and "Submit" keeps them visually consistent. Consider whether one action might require a different variant (e.g., outline or secondary) based on UX guidelines if “Submit” should stand out more than “Retake.”


233-250: Retake / Submit Buttons for Larger Screens

Consistent usage of variant="primary" for both retake and submit. Please confirm with design if a secondary variant is desired for retake to keep the emphasis on submit.

src/components/Patient/PatientConsentRecords.tsx (1)

7-7: Ensure correct import path.
It seems there's a double slash in @/components//ui/button. Consider removing the extra slash to maintain consistency and avoid potential import resolution issues.

- import { Button } from "@/components//ui/button";
+ import { Button } from "@/components/ui/button";
src/components/Common/ExcelViewer.tsx (1)

81-90: Ensure the anchor text color matches the button's variant.
Inside the <Button> component, you’re including <a className="text-white"> that depends on a parent style context. If you switch button variants or theming in the future, the explicit text color in the anchor tag might conflict with the overall Button styling.

<Button>
-  <a href={downloadURL} className="text-white" download={selectedFile.name}>
+  <a href={downloadURL} download={selectedFile.name}>
     ...
   </a>
</Button>
src/components/Files/FileUpload.tsx (1)

296-319: Consider extracting loading logic into a separate component or HOC.
While the loading logic is functional, it might be cleaner to encapsulate the icon + opacity toggling to keep the code more readable.

src/components/Common/FilePreviewDialog.tsx (1)

214-223: Suggest removing the inline color class on anchor tag.
Similar to the pattern in other files, you can rely on the button’s variant to handle text color.

<Button variant="primary">
-  <a href={downloadURL} className="text-white" download="...">
+  <a href={downloadURL} download="...">
    ...
  </a>
</Button>
src/components/Patient/PatientHome.tsx (2)

Line range hint 164-181: Commented-out block containing the new Button.
If this block is no longer needed, consider removing it to keep the codebase clean.


Line range hint 253-267: Commented-out volunteer assignment code.
Same note as above. If it’s not relevant to this PR, removing it or placing it in a dedicated feature branch might reduce confusion.

src/components/Common/AvatarEditModal.tsx (1)

259-259: Consider using the new <Button> component instead of a styled <label>.
In many places, you are styling a <label> like a button. If feasible, this could be converted to an actual <Button> component for consistency and a better user experience. If not, ensure the styles match your design system and that user interactions are handled properly for accessibility.

src/components/Files/FileBlock.tsx (1)

Line range hint 124-133: Reevaluate variant choice for archiving.
Using "primary" for an archived file might be slightly confusing since archiving often implies caution or a destructive-like action. Consider "warning" or "destructive" to more clearly convey that it’s a permanent/semi-permanent action.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68c4c3d and a79fa1b.

📒 Files selected for processing (45)
  • public/locale/en.json (1 hunks)
  • src/CAREUI/display/Callout.tsx (2 hunks)
  • src/CAREUI/display/Chip.tsx (0 hunks)
  • src/CAREUI/display/PopupModal.tsx (3 hunks)
  • src/CAREUI/interactive/FiltersSlideover.tsx (1 hunks)
  • src/CAREUI/interactive/Zoom.tsx (2 hunks)
  • src/CAREUI/misc/PaginatedList.tsx (3 hunks)
  • src/Utils/AuthorizeFor.tsx (1 hunks)
  • src/components/Auth/ResetPassword.tsx (2 hunks)
  • src/components/Common/AuthorizedButton.tsx (1 hunks)
  • src/components/Common/AvatarEditModal.tsx (6 hunks)
  • src/components/Common/ButtonV2.tsx (0 hunks)
  • src/components/Common/ConfirmDialog.tsx (2 hunks)
  • src/components/Common/ExcelFIleDragAndDrop.tsx (4 hunks)
  • src/components/Common/ExcelViewer.tsx (4 hunks)
  • src/components/Common/FilePreviewDialog.tsx (9 hunks)
  • src/components/Common/Menu.tsx (3 hunks)
  • src/components/Common/Pagination.tsx (2 hunks)
  • src/components/Common/UpdatableApp.tsx (2 hunks)
  • src/components/Facility/FacilityHome.tsx (1 hunks)
  • src/components/Files/CameraCaptureDialog.tsx (4 hunks)
  • src/components/Files/FileBlock.tsx (3 hunks)
  • src/components/Files/FileUpload.tsx (2 hunks)
  • src/components/Form/Form.tsx (2 hunks)
  • src/components/Patient/PatientConsentRecordBlock.tsx (2 hunks)
  • src/components/Patient/PatientConsentRecords.tsx (4 hunks)
  • src/components/Patient/PatientDetailsTab/PatientUsers.tsx (1 hunks)
  • src/components/Patient/PatientDetailsTab/ResourceRequests.tsx (1 hunks)
  • src/components/Patient/PatientDetailsTab/patientUpdates.tsx (1 hunks)
  • src/components/Patient/PatientHome.tsx (4 hunks)
  • src/components/Patient/PatientIndex.tsx (1 hunks)
  • src/components/Resource/ResourceCommentSection.tsx (2 hunks)
  • src/components/Resource/ResourceCreate.tsx (2 hunks)
  • src/components/Resource/ResourceDetailsUpdate.tsx (2 hunks)
  • src/components/Resource/ResourceList.tsx (2 hunks)
  • src/components/Users/ConfirmFacilityModal.tsx (1 hunks)
  • src/components/Users/UnlinkFacilityDialog.tsx (1 hunks)
  • src/components/Users/UserAvatar.tsx (2 hunks)
  • src/components/Users/UserDeleteDialog.tsx (1 hunks)
  • src/components/Users/UserResetPassword.tsx (2 hunks)
  • src/components/Users/UserSummary.tsx (2 hunks)
  • src/components/ui/button.tsx (3 hunks)
  • src/hooks/useFileManager.tsx (4 hunks)
  • src/pages/Encounters/tabs/EncounterFeedTab.tsx (2 hunks)
  • src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx (2 hunks)
💤 Files with no reviewable changes (2)
  • src/CAREUI/display/Chip.tsx
  • src/components/Common/ButtonV2.tsx
✅ Files skipped from review due to trivial changes (5)
  • src/components/Patient/PatientIndex.tsx
  • src/components/Users/ConfirmFacilityModal.tsx
  • src/components/Users/UserDeleteDialog.tsx
  • src/components/Users/UnlinkFacilityDialog.tsx
  • src/pages/Encounters/tabs/EncounterFeedTab.tsx
🧰 Additional context used
📓 Learnings (3)
src/components/Patient/PatientDetailsTab/ResourceRequests.tsx (1)
Learnt from: Jacobjeevan
PR: ohcnetwork/care_fe#9327
File: src/components/Resource/ResourceDetails.tsx:88-94
Timestamp: 2024-12-12T19:27:20.394Z
Learning: Prefer using the primary `Button` component with the `variant="primary"` prop instead of `ButtonV2` for consistency across the application.
src/components/Users/UserSummary.tsx (1)
Learnt from: Jacobjeevan
PR: ohcnetwork/care_fe#9080
File: src/components/Users/UserSummary.tsx:53-71
Timestamp: 2024-11-22T12:04:39.044Z
Learning: In the `UserSummaryTab` component (`src/components/Users/UserSummary.tsx`), when there is an error during user deletion, the delete dialog is intentionally closed to prevent the user from immediately trying to delete the user again.
src/components/Resource/ResourceCommentSection.tsx (1)
Learnt from: Jacobjeevan
PR: ohcnetwork/care_fe#9327
File: src/components/Resource/ResourceDetails.tsx:88-94
Timestamp: 2024-12-12T19:27:20.394Z
Learning: Prefer using the primary `Button` component with the `variant="primary"` prop instead of `ButtonV2` for consistency across the application.
🔇 Additional comments (66)
src/components/Facility/FacilityHome.tsx (1)

195-195: Consistent use of the destructive variant.

Switching from "danger" to "destructive" aligns with the new design system’s semantics. Please verify that all corresponding styles are appropriately applied throughout the codebase.

src/hooks/useFileManager.tsx (2)

2-2: Consider verifying translation key availability in i18n files.
Importing t from i18next is a good approach for localization. However, ensure that all new translation keys (e.g., "cancel", "proceed") are present in the translation files and appropriately localized.


7-8: Use of standard Button component is well-aligned with the PR objectives.
Replacing custom button implementations with the new Button component helps maintain consistency across the application. Good job!

src/components/Common/Menu.tsx (3)

52-52: Maintain consistent icon sizing

This condition leverages "xs" to set a smaller text size, which is fine. However, ensure it remains consistent with the rest of your Tailwind config (e.g., if you override base text sizes somewhere else).


122-122: No functional changes detected

This added blank line does not introduce any functional changes.


6-6: Aligned import statement with new Button component

This change aligns with the PR objective of replacing ButtonV2 references and is consistent with the updated imports throughout the codebase.

Run this script to ensure references to ButtonV2 have been fully removed from the codebase:

✅ Verification successful

Migration to new Button component is complete

The verification results show that:

  1. No references to ButtonV2 exist in the codebase (case-insensitive search)
  2. All Button imports are consistently using the new path @/components/ui/button
  3. The import in Menu.tsx (ButtonSize, ButtonVariant) aligns with the new button component's types
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for any remaining references to ButtonV2
rg 'ButtonV2'

Length of output: 13


Script:

#!/bin/bash
# Let's verify the migration from ButtonV2 to Button using multiple approaches

# 1. Check for any files containing ButtonV2 (case-insensitive)
rg -i "buttonv2"

# 2. Check for Button-related imports to understand the migration pattern
rg "import.*Button.*from"

# 3. Look for Button type/interface definitions
ast-grep --pattern 'interface Button$_'
ast-grep --pattern 'type Button$_'

# 4. Check specifically in the components directory
fd . src/components -t f -e tsx -e ts --exec rg -l "Button"

Length of output: 17001

src/components/Common/AuthorizedButton.tsx (2)

9-11: Acknowledge the effective type composition.
Using Omit<AuthorizedElementProps, "authorizeFor"> & ButtonProps is a neat way to ensure that authorizeFor is required while retaining all other ButtonProps.


13-23: Validate the disabled state logic.
The disabled prop here is overridden by the negation of isAuthorized. This can be appropriate if the button should never be enabled for unauthorized users, but confirm that there's no scenario where you might want fine-grained control over the disabled state independent of isAuthorized.

src/components/Common/ConfirmDialog.tsx (2)

1-1: Check usage of ButtonVariant.
Now that ButtonVariant is imported from the new @/components/ui/button, ensure that other references to button variants in the existing codebase are consistently updated to avoid confusion.


34-45: Form submission consideration when using type="submit".
If this dialog is rendered within a <form>, a click on the confirm button will trigger a form submission, potentially conflicting with custom logic. Verify this behavior is intentional. If you only need a user acknowledgment, consider using type="button.

src/Utils/AuthorizeFor.tsx (1)

22-27: Confirm consistency of documentation example.
Your example for <AuthorizedButton /> references (role) => !role.includes('ReadOnly') and AuthorizeFor.Admins. Confirm these are valid patterns or define them in your doc for clarity.

src/CAREUI/display/Callout.tsx (1)

52-59: Ensure visual consistency between container and badge.
The container uses variantClasses[variant], and the badge uses badgeVariantClasses[variant]. Verify that the chosen color pairings for each variant (e.g., “destructive” outer with “destructive” badge) are aligned with your design system.

src/CAREUI/interactive/Zoom.tsx (1)

5-5: Confirm design consistency and variant usage
Using the ghost variant from the new Button component here is valid, but ensure that this variant aligns with the overall design system.

Would you like a verification script to scan for other potential variant mismatches in the codebase?

src/components/ui/button.tsx (1)

46-49: Review the color palette for “warning” and “alert”
Double-check that these color classes meet accessibility (contrast) requirements and align with your design guidelines.

src/components/Users/UserAvatar.tsx (1)

120-127: Good usage of the new Button
The direct usage of variant="white" here is consistent with the file’s design. No further issues observed.

src/CAREUI/display/PopupModal.tsx (2)

45-47: Button usage looks good.
Switching to the new Button component with variant="outline" is consistent with your UI library’s approach. No issues detected here.


149-151: Good use of the new Button.
This is consistent with the usage seen in the mobile view. Looks good.

src/CAREUI/misc/PaginatedList.tsx (1)

Line range hint 126-137: Refactored to the new Button looks great.
The code properly handles disabled states and visually indicates loading with a spinning icon. This is a good pattern for asynchronous operations.

src/components/Form/Form.tsx (1)

146-148: Good move to the new Button.
Replacing the old ButtonV2 with Button and variant="outline" is aligned with your refactor objective.

src/components/Patient/PatientDetailsTab/patientUpdates.tsx (1)

27-30: No concerns regarding the Button variant or icon usage.

The transition to Button with the outline_primary variant and the localized text plus icon is properly implemented. This is consistent with the new styling conventions and supports localization through t(...). Nice work!

src/components/Common/Pagination.tsx (1)

5-5: Import transition to new Button is straightforward.

The import statement cleanly replaces the old button reference with the new Button, aligning with the PR's objective.

src/components/Auth/ResetPassword.tsx (1)

5-6: The new Button import is correctly applied.

You have successfully replaced the old component with the new Button, following the PR’s objective.

src/components/Users/UserResetPassword.tsx (2)

6-7: Import Replacement Looks Good

Replacing ButtonV2 with Button from @/components/ui/button is consistent with the PR objective of standardizing button usage.


195-204: Consistent Variant Usage

Using variant="outline_primary" aligns with the rest of the app’s design system. Just verify that this variant is available and styled as expected in the new Button component.

src/components/Files/CameraCaptureDialog.tsx (7)

7-8: Import Statement Updated Successfully

The import from @/components/ui/button is in line with the overall replacement of ButtonV2. No issues noted.


138-144: Improved Clarity for Camera Switch Button

Using variant="primary" for the switch camera button maintains visual consistency for a primary action on small screens.


153-161: Capture Button Transition

This update correctly replaces the old button with the new Button component and a clear label. Functionality remains intact.


Line range hint 192-202: Close Button Outline Variant

Applying variant="outline" for the close button is a good choice to differentiate from primary actions.


208-211: Laptop Switch Camera Button Check

Ensure the camera-switch logic remains consistent and that it’s not hidden when it’s needed. Currently, it’s guarded by isLaptopScreen. Verify that users on certain screen sizes can still access this feature.


219-227: Capture Action Icon

The inclusion of the capture icon via <CareIcon icon="l-capture" /> is an effective visual cue. The code looks correct.


256-265: Close Button with Extended Label

Using ${t("close")} ${t("camera")} as a combined label is fine if it aligns with the localized user interface guidelines.

src/components/Resource/ResourceDetailsUpdate.tsx (3)

1-1: Translation Import Check

Bringing in t from i18next supports localized strings. No issues noted.


7-8: Button Import Aligned with Project Goals

Switching from ButtonV2 to the new Button is in line with the PR objective. Looks good.


285-290: Cancel / Submit Button Replacement

The replacement is correctly adopting variant="outline" for “cancel” and variant="primary" for “submit.” This approach preserves a clear visual distinction between these actions.

src/components/Common/ExcelFIleDragAndDrop.tsx (3)

7-8: Button Import Successfully Integrated

The import of Button from @/components/ui/button aligns with the PR objective of removing ButtonV2.


Line range hint 252-265: Close Button Implementation

Replacing a dedicated “Cancel” component with the new Button in outline variant is consistent with the codebase transition.


Line range hint 266-283: Submit Button Enhancement

Using a spinner icon for the loading state and a clear “Import” label clarifies user flow. Ensuring disabled state when no file is selected is a nice usability touch.

src/components/Patient/PatientConsentRecords.tsx (3)

2-2: Import usage confirmed.
Bringing in Loader2 from lucide-react is consistent with similar references across the codebase and appears correct.


130-130: Destructive variant usage.
The variant="destructive" property correctly conveys the high-impact nature of the action. This is consistent with good UX, aligning the color and styling with destructive intents.


Line range hint 181-219: Refine file upload button block.

  1. Good job setting variant="primary" for the upload button and variant="destructive" for the delete button to distinguish actions clearly.
  2. The condition fileUpload.uploading || (newConsent.type === 2 && newConsent.patient_code_status === 0) elegantly disables the button during uploads or invalid status; consider adding a quick inline comment clarifying the significant use case for clarity.
  3. Great implementation of spinner feedback (Loader2) when uploading.

Overall, the logic is consistent with best practices.

src/components/Patient/PatientDetailsTab/PatientUsers.tsx (1)

104-104: Use of "outline_primary" variant.
The outline_primary variant is consistent with a visually distinctive style while still appearing less forceful than a filled button. Ensure that theming is well-documented and consistent across other components.

src/components/Resource/ResourceCreate.tsx (2)

9-9: Updated import path for Button.
This change aligns with the standardized Button usage across the codebase.


320-325: Replaced custom Cancel/Submit with standardized Button.
Replacing the custom components with a standardized Button promotes consistency. Both the “Cancel” and “Submit” actions are clearly defined by their respective variants (outline and primary). This is correct and intuitive.

src/components/Resource/ResourceList.tsx (3)

7-7: Consolidated imports for Badge and Button.
Importing both Badge and Button from the appropriate ui folder is consistent with your approach to unify UI components.


93-103: Using secondary variant for "TRANSPORTATION TO BE ARRANGED".
The approach helps visually distinguish the special status. The icon and uppercase label provide clear user feedback.


108-124: Dynamic variant for "APPROVED" status.
Switching between primary or secondary for the Badge based on the resource status is a neat way to highlight approvals differently. The color-coded approach (e.g., bg-sky-200 for “APPROVED”) is user-friendly.

src/components/Common/ExcelViewer.tsx (2)

6-7: Good import changes.
The import of Button from @/components/ui/button looks correct.


266-268: Well-structured button usage.
The “Close” and “Import” buttons both handle localized text. This usage is consistent with the new button structure. Good job verifying the type (type="button" vs type="submit").

Also applies to: 269-281

src/components/Files/FileUpload.tsx (1)

8-9: Successful import of the new Button.
This aligns with the goal of replacing ButtonV2 with Button.

src/components/Common/FilePreviewDialog.tsx (6)

17-18: Import path changes look solid.
Using the new Button from @/components/ui/button and updating the FileUploadModel path improves consistency across the project.

Also applies to: 22-22


225-227: Consistent usage of “close” button.
Localizing the label and using type="button" is correct.


Line range hint 232-243: Keyboard accessibility is good.
Providing ArrowLeft in onKeyDown is a nice detail for keyboard navigation.


Line range hint 285-296: Next file button for multi-file preview.
Logic and constraints look correct.


Line range hint 337-351: Zooming feature is well-structured.
The approach for disabling the zoom control when reaching bounds is properly handled.


Line range hint 372-386: Page navigation for PDF is well-handled.
Incrementing/decrementing page numbers with boundary checks ensures no out-of-range errors.

src/components/Common/AvatarEditModal.tsx (4)

13-13: Well done replacing the import from ButtonV2 to Button.
This aligns with the new design system and helps maintain consistency across the codebase.


294-295: Good use of the destructive variant for a delete action.
This is consistent with typical design conventions for permanent or potentially harmful actions.


355-360: Camera buttons look consistent with the rest of the UI.
Switching and capturing events appear well-handled. Thanks for keeping the code clean and straightforward.


399-401: Smart approach resetting preview and camera states upon closing.
Everything seems to be correctly cleaned up, including the camera reference. Great job.

src/components/Resource/ResourceCommentSection.tsx (2)

5-6: Good transition to the new Button component.
This improves UI consistency with the rest of the application.


55-63: Button usage is straightforward and correct.
The asynchronous submit and subsequent refetch logic is properly handled within the onClick callback.

src/components/Files/FileBlock.tsx (3)

6-7: Nice job removing ButtonV2 in favor of Button.
This keeps the codebase consistent with the new standard.


94-110: Button actions for viewing and downloading are clear.
Using the secondary variant for these neutral actions makes sense.


114-121: Renaming functionality meets the design goals.
It’s good to see the button remain consistent with your secondary variant.

src/components/Users/UserSummary.tsx (2)

7-7: LGTM! Import changes align with PR objectives.

The replacement of ButtonV2 with AuthorizedButton maintains the required functionality while adding proper authorization checks.


175-185: LGTM! Button replacement enhances security.

The AuthorizedButton replacement:

  1. Maintains the delete functionality
  2. Adds proper authorization checks via authorizeFor
  3. Updates the variant from "danger" to "destructive" following the new button component's API

src/components/Common/Menu.tsx Outdated Show resolved Hide resolved
src/CAREUI/interactive/FiltersSlideover.tsx Outdated Show resolved Hide resolved
src/CAREUI/interactive/FiltersSlideover.tsx Outdated Show resolved Hide resolved
@Mahendar0701 Mahendar0701 changed the title Replaced Buttonv2 with Button in entire codebase Replaced ButtonV2's with Button in entire codebase Jan 4, 2025
Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

lgtm, some minor changes

src/components/Common/AuthorizedButton.tsx Outdated Show resolved Hide resolved
src/components/ui/button.tsx Show resolved Hide resolved
src/components/ui/button.tsx Outdated Show resolved Hide resolved
src/CAREUI/display/Callout.tsx Outdated Show resolved Hide resolved
src/components/Users/UserAvatar.tsx Outdated Show resolved Hide resolved
src/components/Users/UserResetPassword.tsx Outdated Show resolved Hide resolved
src/components/Users/UserSummary.tsx Outdated Show resolved Hide resolved
src/hooks/useFileManager.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 706eda9 and 9976e7f.

📒 Files selected for processing (10)
  • src/CAREUI/display/Callout.tsx (1 hunks)
  • src/CAREUI/misc/PaginatedList.tsx (3 hunks)
  • src/components/Common/ConfirmDialog.tsx (2 hunks)
  • src/components/Common/Menu.tsx (1 hunks)
  • src/components/Patient/PatientDetailsTab/EncounterHistory.tsx (1 hunks)
  • src/components/Users/UserAvatar.tsx (2 hunks)
  • src/components/Users/UserResetPassword.tsx (2 hunks)
  • src/components/Users/UserSummary.tsx (3 hunks)
  • src/components/ui/button.tsx (1 hunks)
  • src/hooks/useFileManager.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/components/ui/button.tsx
  • src/components/Users/UserResetPassword.tsx
  • src/components/Common/ConfirmDialog.tsx
  • src/hooks/useFileManager.tsx
  • src/CAREUI/misc/PaginatedList.tsx
  • src/components/Users/UserSummary.tsx
  • src/components/Users/UserAvatar.tsx
🔇 Additional comments (2)
src/components/Patient/PatientDetailsTab/EncounterHistory.tsx (1)

27-27: Removal of the unused _ parameter is appropriate.

Eliminating unused parameters cleans up the code and prevents confusion. This is a good improvement to maintain code clarity and readability.

src/CAREUI/display/Callout.tsx (1)

6-6: Good job defining fresh variants for Callout.

This change clearly separates the Callout’s look-and-feel from button styling concerns. It aligns with the feedback suggesting not to reuse the button's variant definitions.

src/components/Common/Menu.tsx Outdated Show resolved Hide resolved
@Mahendar0701
Copy link
Contributor Author

Mahendar0701 commented Jan 5, 2025

@rithviknishad I have added warning and alert variant in button.tsx as they are being used in 4 files. Should i keep them or remove it from button.tsx? if removed should i use className to make variant in corresponding buttons?

@github-actions github-actions bot added needs-triage question Further information is requested labels Jan 5, 2025
@rithviknishad
Copy link
Member

@rithviknishad I have added warning and alert variant in button.tsx as they are being used in 4 files. Should i keep them or remove it from button.tsx? if removed should i use className to make variant in corresponding buttons?

yup, that should be fine

@Mahendar0701
Copy link
Contributor Author

@rithviknishad I have added warning and alert variant in button.tsx as they are being used in 4 files. Should i keep them or remove it from button.tsx? if removed should i use className to make variant in corresponding buttons?

yup, that should be fine

I should keep alert and warning variants in button.tsx right? 👀

src/CAREUI/display/PopupModal.tsx Outdated Show resolved Hide resolved
src/components/Common/Menu.tsx Outdated Show resolved Hide resolved
@rithviknishad
Copy link
Member

I should keep alert and warning variants in button.tsx right? 👀

yup

src/components/Common/ConfirmDialog.tsx Outdated Show resolved Hide resolved
src/components/Common/AvatarEditModal.tsx Outdated Show resolved Hide resolved
src/components/Common/Menu.tsx Outdated Show resolved Hide resolved
@rithviknishad rithviknishad removed question Further information is requested needs-triage labels Jan 5, 2025
Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

you missed removing these

image

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
src/components/Common/Menu.tsx (1)

Remove unused button-related classes from CAREUI.css

The verification shows that:

  1. CAREUI.css still contains multiple button-related classes (button-primary, button-secondary, etc.)
  2. These button classes are not being used anywhere in the codebase
  3. The only ButtonV2 reference in AuthorizeFor.tsx is in the documentation/comments
  4. No other components are using these button styles

You can safely remove the following classes from CAREUI.css:

  • All a.button-* classes (primary, secondary, danger, warning, alert variants)
  • All button.button-* classes (primary, secondary, danger, warning, alert variants)
  • Keep the .cui-form-button-group class as it might still be in use
🔗 Analysis chain

Line range hint 1-1: Verify and remove button-related classes from CAREUI.css.

As mentioned in the review comments, we need to remove the button-related classes from CAREUI.css that were originally part of ButtonV2's implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for button-related classes in CAREUI.css
echo "Checking for button-related classes in CAREUI.css..."
rg -A 2 'button-' src/style/CAREUI.css

# Check for any remaining usages of these classes
echo "Checking for any remaining usages of these classes..."
rg -l 'button-(size|variant)-' -g '!CAREUI.css'

Length of output: 1682


Script:

#!/bin/bash
# Let's check for any remaining usages of the button-related classes found in CAREUI.css
echo "Checking for usages of button classes..."
rg -l 'button-(primary|secondary|danger|warning|alert)-(default|ghost)' -g '!CAREUI.css'

# Also check for any imports or references to ButtonV2
echo "Checking for ButtonV2 references..."
rg -l 'ButtonV2'

Length of output: 306


Script:

#!/bin/bash
# Let's check the content of AuthorizeFor.tsx to see how ButtonV2 is used
echo "Checking ButtonV2 usage in AuthorizeFor.tsx..."
rg -A 5 'ButtonV2' src/Utils/AuthorizeFor.tsx

# Let's also check if there are any other button-related styles or classes in use
echo "Checking for other button styles..."
rg 'class(Name)?="[^"]*button[^"]*"' -g '!CAREUI.css'

Length of output: 682

🧹 Nitpick comments (8)
src/components/Patient/PatientConsentRecords.tsx (2)

Line range hint 181-211: Consider simplifying the disabled state logic

The button implementation looks good overall with proper loading states and visual feedback. However, the disabled state condition could be simplified.

Consider this more readable version:

-                  disabled={
-                    fileUpload.uploading ||
-                    (newConsent.type === 2 &&
-                      newConsent.patient_code_status === 0)
-                  }
+                  disabled={
+                    fileUpload.uploading || 
+                    (newConsent.type === 2 && !newConsent.patient_code_status)
+                  }

Line range hint 224-228: Simplify file chooser button styling

The current className implementation is verbose and potentially includes redundant utility classes that might already be covered by buttonVariants.

Consider simplifying to:

-                  className={`${buttonVariants({ variant: "primary", size: "default" })} inline-flex h-min w-full cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out`}
+                  className={`${buttonVariants({ variant: "primary" })} w-full cursor-pointer gap-2`}

The buttonVariants helper likely already includes most of the utility classes you've specified.

src/components/Common/AvatarEditModal.tsx (3)

257-275: Consider restructuring the file input implementation

While the button works, having the file input nested inside the button could lead to click handling issues. Consider moving the file input outside the button for better maintainability.

+ <input
+   id="file-input"
+   title="changeFile"
+   type="file"
+   accept="image/*"
+   className="hidden"
+   onChange={onSelectFile}
+ />
  <Button
    id="upload-cover-image"
    variant="primary"
    type="button"
    onClick={() =>
      document.getElementById("file-input")?.click()
    }
  >
    <CareIcon icon="l-cloud-upload" className="text-lg" />
    {t("upload_an_image")}
-   <input
-     id="file-input"
-     title="changeFile"
-     type="file"
-     accept="image/*"
-     className="hidden"
-     onChange={onSelectFile}
-   />
  </Button>

287-297: Consider removing unnecessary event propagation stop

The e.stopPropagation() call might be unnecessary since the button is not within a parent click handler that would conflict with it.

  <Button
    variant="outline"
    onClick={(e) => {
-     e.stopPropagation();
      closeModal();
      dragProps.setFileDropError("");
    }}
    disabled={isProcessing}
  >
    {t("cancel")}
  </Button>

Line range hint 307-324: Consider using primary variant for the save button

Since saving is a primary action, consider using the primary variant instead of outline to maintain consistency with UI patterns.

  <Button
    id="save-cover-image"
-   variant="outline"
+   variant="primary"
    onClick={uploadAvatar}
    disabled={isProcessing || !selectedFile}
  >
src/components/Common/Menu.tsx (3)

24-26: Enhance the deprecation notice with migration guidance.

While the deprecation notice is good, it would be more helpful to include:

  • The target version for removal
  • A link to migration documentation
  • Reference to the replacement component
 /**
- * @deprecated This component will be replaced with ShadCN's dropdown.
+ * @deprecated This component will be replaced with ShadCN's dropdown menu component.
+ * @see https://ui.shadcn.com/docs/components/dropdown-menu
+ * @todo Remove in next major version
  */

37-43: Improve className handling and button styling.

A few suggestions to enhance the implementation:

  1. Use classNames utility for better className composition
  2. Consider making the height configurable
  3. Use type-safe buttonVariants
-          className={`inline-flex w-full cursor-pointer items-center justify-center gap-2 font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 lg:justify-between ${props.className} ${buttonVariants({ variant: "primary", size: "default" })}`}
+          className={classNames(
+            buttonVariants({ variant: "primary", size: "default" }),
+            "inline-flex w-full cursor-pointer items-center justify-center gap-2",
+            "font-medium outline-offset-1 transition-all duration-200",
+            "disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
+            "lg:justify-between",
+            props.className
+          )}
         >
-          <div className="flex items-center gap-2 whitespace-nowrap h-6">
+          <div className="flex items-center gap-2 whitespace-nowrap min-h-[1.5rem]">

83-88: Remove hardcoded styles in preparation for component replacement.

Since this component will be replaced with shadcn's dropdown menu:

  1. Remove the dropdown-item-primary class from CAREUI.css
  2. Consider using Tailwind classes directly for flexibility
-          `dropdown-item-primary`,
+          "hover:bg-secondary-100 active:bg-secondary-200",
           isAuthorized ? "pointer-events-auto cursor-pointer" : "!hidden",
           className,
         )}
       >
-        <i className="text-lg text-primary-500">{icon}</i>
+        <i className="text-lg text-secondary-700">{icon}</i>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf327a0 and 3f0a6a3.

📒 Files selected for processing (9)
  • public/locale/en.json (1 hunks)
  • src/CAREUI/display/PopupModal.tsx (0 hunks)
  • src/components/Common/AvatarEditModal.tsx (5 hunks)
  • src/components/Common/ConfirmDialog.tsx (2 hunks)
  • src/components/Common/Menu.tsx (4 hunks)
  • src/components/Facility/FacilityHome.tsx (1 hunks)
  • src/components/Patient/PatientConsentRecords.tsx (4 hunks)
  • src/components/ui/button.tsx (2 hunks)
  • src/style/CAREUI.css (0 hunks)
💤 Files with no reviewable changes (2)
  • src/style/CAREUI.css
  • src/CAREUI/display/PopupModal.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • public/locale/en.json
  • src/components/Facility/FacilityHome.tsx
  • src/components/Common/ConfirmDialog.tsx
  • src/components/ui/button.tsx
🔇 Additional comments (7)
src/components/Patient/PatientConsentRecords.tsx (3)

2-2: LGTM: Import changes align with PR objectives

The replacement of ButtonV2 with Button/buttonVariants and addition of Loader2 for loading states improves the component's functionality.

Also applies to: 7-7


130-130: LGTM: Appropriate variant name change

The change from "danger" to "destructive" better reflects the semantic meaning of the action and aligns with the new Button component's variant naming convention.


212-219: LGTM: Clear files button implementation

The clear files button correctly uses the destructive variant and properly handles the disabled state during upload.

src/components/Common/AvatarEditModal.tsx (4)

13-13: LGTM! Import of new Button component

The import statement correctly references the new standardized Button component.


277-285: LGTM! Camera button implementation

The button implementation is clean and correctly handles camera initialization.


299-305: LGTM! Delete button implementation

The button correctly uses the destructive variant and has proper conditional rendering.


Line range hint 360-415: LGTM! Camera control buttons implementation

The camera control buttons are well-implemented with appropriate variants, loading states, and translations.

@Mahendar0701
Copy link
Contributor Author

you missed removing these

image

@rithviknishad Done

src/CAREUI/interactive/FiltersSlideover.tsx Outdated Show resolved Hide resolved
src/CAREUI/interactive/FiltersSlideover.tsx Outdated Show resolved Hide resolved
src/components/Common/AvatarEditModal.tsx Outdated Show resolved Hide resolved
Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

lgtm, last thing

src/components/Common/AvatarEditModal.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/components/Common/AvatarEditModal.tsx (2)

257-272: Enhance accessibility of file upload button

While the implementation follows the asChild approach, it can be improved for better accessibility.

Apply these changes to establish an explicit label-input association:

  <Button id="upload-cover-image" variant="primary" asChild>
-   <label className="cursor-pointer">
+   <label htmlFor="avatar-file-input" className="cursor-pointer">
      <CareIcon
        icon="l-cloud-upload"
        className="text-lg mr-1"
      />
      {t("upload_an_image")}
      <input
+       id="avatar-file-input"
        title="changeFile"
        type="file"
        accept="image/*"
        className="hidden"
        onChange={onSelectFile}
      />
    </label>
  </Button>

Line range hint 357-397: Implement consistent loading states for camera operations

The submit button correctly shows a loading state, but other camera operation buttons could benefit from similar treatment to prevent multiple clicks during processing.

Consider adding loading states to camera operation buttons:

- <Button variant="primary" onClick={handleSwitchCamera}>
+ <Button 
+   variant="primary" 
+   onClick={handleSwitchCamera}
+   disabled={isProcessing}
+ >
    <CareIcon icon="l-camera-change" className="text-lg" />
    {`${t("switch")} ${t("camera")}`}
  </Button>
  <Button
    variant="primary"
+   disabled={isProcessing}
    onClick={() => {
      captureImage();
    }}
  >
    <CareIcon icon="l-capture" className="text-lg" />
    {t("capture")}
  </Button>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 444a8a5 and 4ebf027.

📒 Files selected for processing (3)
  • src/CAREUI/interactive/FiltersSlideover.tsx (1 hunks)
  • src/components/Common/AvatarEditModal.tsx (5 hunks)
  • src/components/Patient/PatientDetailsTab/patientUpdates.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/CAREUI/interactive/FiltersSlideover.tsx
  • src/components/Patient/PatientDetailsTab/patientUpdates.tsx
🔇 Additional comments (2)
src/components/Common/AvatarEditModal.tsx (2)

13-14: LGTM: Import change aligns with PR objective

The Button import change correctly supports the migration from ButtonV2.


Line range hint 284-321: LGTM: Well-implemented action buttons

The action buttons (save, cancel, delete) are well implemented with:

  • Appropriate variant usage
  • Proper loading states and disabled conditions
  • Consistent icon usage and translations

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

Yay! We are now one step towards cleaner codebase...

@bodhish bodhish merged commit dde6a03 into ohcnetwork:develop Jan 5, 2025
24 of 25 checks passed
Copy link

github-actions bot commented Jan 5, 2025

@Mahendar0701 Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

@Mahendar0701
Copy link
Contributor Author

Mahendar0701 commented Jan 6, 2025

Hey @rithviknishad i want to work on further cleaning up of code base.

We have 10 deprecated utilities such as Notification.Error, useTanStackQueryInstead, CarePatientTokenKey and others.

Please assign some of them to me if needed.

@Mahendar0701 Mahendar0701 deleted the replace-buttonv2 branch January 6, 2025 12:36
@rithviknishad
Copy link
Member

go ahead and handle notification first 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants