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

Improved Button Responsiveness and Layout Adjustments #9332

Conversation

gurramkarthiknetha
Copy link

@gurramkarthiknetha gurramkarthiknetha commented Dec 7, 2024

Proposed Changes

  • Fixes fix the responsive ness #9156
    image
    here i changed the hap between the red button and green oulined button
  • Change 2
    -image
    here i changed the responsive-ness wrap
  • Change 3
  • image
  • here i improved the responsive ness of the buttons by align to center
  • Change 4
  • image
  • here i changed it level
  • Change 5
  • image
  • here i changed it level
    @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

  • New Features

    • Enhanced layout for various components, improving user interface consistency and responsiveness.
    • Added conditional checks for user roles in patient management, ensuring appropriate access to functionalities.
    • Introduced a confirmation dialog for changing patient code statuses in consent records.
  • Bug Fixes

    • Improved handling of existing consent records during file uploads to prevent errors.
  • Style

    • Updated spacing and layout styles across multiple components for better visual presentation.

@gurramkarthiknetha gurramkarthiknetha requested a review from a team as a code owner December 7, 2024 19:31
Copy link
Contributor

coderabbitai bot commented Dec 7, 2024

Walkthrough

The changes in this pull request primarily involve modifications to the layout and styling of various components within the application. Key updates include adjustments to the className properties for improved spacing and responsiveness in components such as AdvancedFilterButton, FacilityCard, KanbanBoard, ManagePatients, and PatientConsentRecords. These changes enhance the user interface without altering the underlying logic or functionality of the components.

Changes

File Path Change Summary
src/CAREUI/interactive/FiltersSlideover.tsx Updated className of AdvancedFilterButton to include mt-2 for margin-top styling.
src/components/Facility/FacilityCard.tsx Modified layout class for facility info and notification buttons to introduce gaps and center alignment.
src/components/Kanban/Board.tsx Added responsive design features to KanbanBoard and KanbanSection for better layout on larger screens.
src/components/Patient/ManagePatients.tsx Altered button layout for flexibility, updated tab change logic for access control, and improved spacing for export button.
src/components/Patient/PatientConsentRecords.tsx Introduced new state for modal visibility, updated upload logic, and modified button rendering based on consent records.

Assessment against linked issues

Objective Addressed Explanation
Fix the responsiveness of UI elements (#9156)
Improve button layout and spacing (#9156)

Possibly related PRs

Suggested labels

needs review, tested

Suggested reviewers

  • rithviknishad
  • Jacobjeevan
  • shivankacker

Poem

In a world of buttons, neat and bright,
We’ve added some margins, oh what a sight!
With gaps and flex, they dance with glee,
A responsive layout for all to see.
From filters to cards, they now align,
Hopping along, everything's just fine! 🐇✨


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 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 Dec 7, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit d166687
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/6754a27889714f0008756092
😎 Deploy Preview https://deploy-preview-9332--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: 0

🧹 Outside diff range and nitpick comments (4)
src/CAREUI/interactive/FiltersSlideover.tsx (1)

64-64: Improve className organization for better maintainability

Consider organizing utility classes by their purpose for better readability and maintainability.

-      className="w-full bg-white md:w-auto mt-2"
+      className="mt-2 w-full bg-white md:w-auto"
src/components/Kanban/Board.tsx (1)

149-149: Consider using standard breakpoint

The custom breakpoint max-[915px] might be better replaced with a standard Tailwind breakpoint for consistency.

-            "relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200 max-[915px]:border max-[915px]:border-solid max-[915px]:border-gray-400"
+            "relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200 md:border-none border border-solid border-gray-400"
src/components/Patient/PatientConsentRecords.tsx (1)

239-239: Consider extracting button styles into a reusable class

The long className string combines multiple styling concerns. Consider extracting these styles into a reusable class or using Tailwind's @apply directive for better maintainability.

Example using Tailwind's @apply in a CSS file:

.button-upload {
  @apply button-size-default button-shape-square button-primary-default inline-flex mt-2 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;
}

Then use it in the component:

-                    "button-size-default button-shape-square button-primary-default inline-flex mt-2 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"
+                    "button-upload"
src/components/Patient/ManagePatients.tsx (1)

917-917: Consider using gap utility instead of margin for consistent spacing

The mt-2 class on the export button might create inconsistent spacing when buttons wrap. Consider using the parent container's gap utility for uniform spacing.

-className="mr-5 w-full lg:w-fit mt-2"
+className="mr-5 w-full lg:w-fit"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fac77a7 and d166687.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • src/CAREUI/interactive/FiltersSlideover.tsx (1 hunks)
  • src/components/Facility/FacilityCard.tsx (2 hunks)
  • src/components/Kanban/Board.tsx (2 hunks)
  • src/components/Patient/ManagePatients.tsx (2 hunks)
  • src/components/Patient/PatientConsentRecords.tsx (1 hunks)
🔇 Additional comments (3)
src/components/Kanban/Board.tsx (1)

61-61: LGTM! Improved responsive layout with proper spacing

The changes effectively implement responsive spacing and layout using Tailwind's utility classes.

src/components/Facility/FacilityCard.tsx (1)

91-91: LGTM: Improved spacing between flex items

The addition of gap-2 class provides consistent spacing between flex items while maintaining the existing layout properties.

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

844-844: LGTM: Enhanced button container responsiveness

The addition of flex-wrap and gap-2 classes improves the responsive behavior of buttons, allowing them to wrap gracefully on smaller screens while maintaining consistent spacing.

Copy link
Member

Choose a reason for hiding this comment

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

let's switch to using Button component instead of ButtonV2.

Copy link
Member

Choose a reason for hiding this comment

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

discard changes made to the lockfile

Copy link
Author

Choose a reason for hiding this comment

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

discard changes made to the lockfile

ok

@rithviknishad
Copy link
Member

Closing as duplicate of #9161; Do make changes to the same PR instead of opening new ones. Helps keep track of requested changes better.

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

Successfully merging this pull request may close these issues.

fix the responsive ness
2 participants