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

fixed responsiveness #9166

Conversation

gurramkarthiknetha
Copy link

@gurramkarthiknetha gurramkarthiknetha commented Nov 20, 2024

image
image
image
image
image
image

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced button styling with added margins for improved layout.
    • Introduced a new prop for the timer button to set an initial countdown interval.
  • Improvements

    • Improved layout flexibility in the patient management interface.
    • Updated consent records handling for clearer user feedback during uploads.
  • Styling Updates

    • Added new CSS classes and media queries for better responsiveness and visual presentation across components.

These changes collectively enhance the user experience and interface consistency.

fixed responsiveness of the website with small changes
fixed the responsiveness and some file changes
@gurramkarthiknetha gurramkarthiknetha requested a review from a team as a code owner November 20, 2024 09:27
Copy link
Contributor

coderabbitai bot commented Nov 20, 2024

Walkthrough

This pull request introduces several modifications across various components in the codebase, primarily focusing on styling adjustments and minor functional enhancements. Changes include the addition of margin styles to buttons, updates to layout properties for better spacing, and new props for components to enhance functionality. Additionally, the CSS file has been updated with new media queries and class definitions to support these changes. Overall, the adjustments aim to improve the user interface without altering the core logic or functionality of the components.

Changes

File Path Change Summary
src/CAREUI/interactive/FiltersSlideover.tsx Updated AdvancedFilterButton to include mt-2 class for margin-top on ButtonV2.
src/components/Common/ButtonV2.tsx Added mtrequired class to button styles; introduced initialInverval prop for ButtonWithTimer.
src/components/Common/Menu.tsx Added mt-2 class to MenuButton for margin-top styling.
src/components/Facility/FacilityCard.tsx Updated layout classes to include gaps and center buttons.
src/components/Kanban/Board.tsx Added containerss and bshadow classes for styling adjustments in KanbanBoard and KanbanSection.
src/components/Patient/ManagePatients.tsx Modified button container class for flexible layout; updated onTabChange for user permissions.
src/components/Patient/PatientConsentRecords.tsx Updated button label with margin-top; refined handleUpload function for consent records.
src/style/index.css Added media query for max-width 915px; defined new classes .containerss, .bshadow, and .mtrequired.

Possibly related PRs

  • checks for username and username in card overflow fix #8940: This PR modifies the ButtonV2 component, which is also referenced in the main PR, specifically affecting the styling of buttons, including the addition of classes that may relate to the changes made in the main PR regarding button layout.
  • Fixed doctor calling button size #9130: This PR addresses the size of the "Doctor Calling" button, which is a ButtonV2 component, ensuring consistent button sizes across the interface, similar to the changes made in the main PR that involve styling adjustments to buttons.

Suggested labels

needs review, tested

Suggested reviewers

  • rithviknishad
  • shivankacker
  • Jacobjeevan

Poem

🐇 In the garden where buttons bloom,
With margins added to make room,
Flex and wrap, they dance with grace,
Enhancing every user’s space.
A little change, a joyful cheer,
For every click, we hold so dear! 🌼

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/CAREUI/interactive/FiltersSlideover.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.json': Cannot find module '@typescript-eslint/parser'
Require stack:

  • /.eslintrc.json
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)

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 Nov 20, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 4465945
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/673dab85dd6cfd000896b357
😎 Deploy Preview https://deploy-preview-9166--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

🧹 Outside diff range and nitpick comments (3)
src/components/Common/ButtonV2.tsx (1)

Line range hint 214-214: Fix typos and improve timer implementation

Several issues found in the ButtonWithTimer implementation:

  1. Prop name has a typo: 'initialInverval' → 'initialInterval'
  2. Missing type validation for the initial interval
  3. Potential memory leak in the interval cleanup
  4. Missing prop documentation

Suggested fixes:

- initialInverval?: number;
+ /** Initial countdown value in seconds. Must be a positive number. */
+ initialInterval?: number;
- const [seconds, setSeconds] = useState(initialInverval ?? interval);
+ const [seconds, setSeconds] = useState(() => {
+   const initial = initialInterval ?? interval;
+   return Math.max(0, initial);
+ });

  useEffect(() => {
-   let interval = undefined;
+   let intervalId: NodeJS.Timeout | undefined = undefined;
    if (seconds > 0) {
-     interval = setInterval(() => {
+     intervalId = setInterval(() => {
        setSeconds((prevSeconds) => prevSeconds - 1);
      }, 1000);
    } else {
      setIsButtonDisabled(false);
-     clearInterval(interval);
+     if (intervalId) clearInterval(intervalId);
    }
-   return () => clearInterval(interval);
+   return () => {
+     if (intervalId) clearInterval(intervalId);
+   };
  }, [seconds]);

Also applies to: 219-219, 223-235

src/style/index.css (2)

1318-1318: Consider using standard breakpoint

The media query breakpoint of 915px seems arbitrary. Consider using standard breakpoints (e.g., 768px for tablets, 1024px for desktop) for better consistency across devices.

- @media screen and (max-width:915px){
+ @media screen and (max-width:768px){

1324-1326: Improve border definition

The border property should specify all dimensions (width, style, color). Consider using CSS variables for colors to maintain consistency.

.bshadow{
-    border:solid rgb(168, 168, 168);
+    border: 1px solid var(--border-color, rgb(168, 168, 168));
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f79a2a4 and 4465945.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • src/CAREUI/interactive/FiltersSlideover.tsx (1 hunks)
  • src/components/Common/ButtonV2.tsx (1 hunks)
  • src/components/Common/Menu.tsx (1 hunks)
  • src/components/Facility/FacilityCard.tsx (2 hunks)
  • src/components/Kanban/Board.tsx (2 hunks)
  • src/components/Patient/ManagePatients.tsx (1 hunks)
  • src/components/Patient/PatientConsentRecords.tsx (1 hunks)
  • src/style/index.css (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/CAREUI/interactive/FiltersSlideover.tsx
  • src/components/Facility/FacilityCard.tsx
  • src/components/Kanban/Board.tsx
🧰 Additional context used
🪛 Biome
src/style/index.css

[error] 1330-1330: expected } but instead the file ends

the file ends here

(parse)

🔇 Additional comments (3)
src/components/Common/Menu.tsx (1)

39-39: LGTM! Responsive design improvement

The addition of mt-2 provides consistent vertical spacing, while lg:justify-between improves content distribution on larger screens. This aligns well with the PR's goal of fixing responsiveness.

Please verify that:

  • The button content alignment looks correct on both mobile and desktop views
  • The top margin (mt-2) provides adequate spacing in all contexts where this component is used
src/components/Patient/PatientConsentRecords.tsx (1)

235-235: LGTM! The margin adjustment improves mobile layout spacing.

The addition of mt-2 class provides better vertical spacing for the file upload button on mobile views, improving the overall responsive design.

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

844-844: LGTM! Improved responsive layout

The addition of flex-wrap class allows the button container to properly wrap its content on smaller screens, preventing horizontal overflow and improving the mobile experience.

@@ -101,7 +101,7 @@ export const buttonStyles = ({
shadow = !ghost,
}: ButtonStyleProps) => {
return classNames(
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 mtrequired",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Reconsider the global application of 'mtrequired' class

The addition of 'mtrequired' class raises several concerns:

  1. The class name appears to have a typo (should it be 'mt-required'?)
  2. Adding this class globally to all buttons might affect existing layouts
  3. If margin-top is needed, consider making it configurable via props instead

Consider this alternative approach:

- "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 mtrequired",
+ "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",

And add a new prop to ButtonStyleProps:

export type ButtonStyleProps = {
  // ... existing props
  marginTop?: boolean; // Add margin-top when needed
};

Comment on lines +1319 to +1323
.containerss{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Rename class to follow naming conventions

The class name 'containerss' appears to have a typo (double 's'). Consider renaming it to 'container' or 'containers' for better maintainability.

- .containerss{
+ .container{
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.containerss{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}
.container{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}

Comment on lines +1318 to +1330
@media screen and (max-width:915px){
.containerss{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}
.bshadow{
border:solid rgb(168, 168, 168);
}
.mtrequired{
margin-top: 0.5rem;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix syntax error: Missing closing curly brace

The file is missing a closing curly brace at the end, which could cause CSS parsing issues.

@media screen and (max-width:915px){
    .containerss{
        flex-wrap: wrap;
        gap: 5px;
        margin-bottom: 5px;
    }
    .bshadow{
        border:solid rgb(168, 168, 168);
    }
    .mtrequired{
        margin-top: 0.5rem;
    }
}
+ }

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome

[error] 1330-1330: expected } but instead the file ends

the file ends here

(parse)

@Jacobjeevan
Copy link
Contributor

Duplicate of #9161

If you want to make additional changes, please make it there.

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.

2 participants