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

FIX: Facility Issues: Cover Not Functioning Properly and Minor Suggestions for the Facility Page #10021

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

abhimanyurajeesh
Copy link
Contributor

@abhimanyurajeesh abhimanyurajeesh commented Jan 16, 2025

Proposed Changes

Summary by CodeRabbit

  • New Features

    • Added optional hint prop to AvatarEditModal for customizable image upload guidance
    • Introduced cover image upload instructions with size and format recommendations
  • Style

    • Adjusted MapPin vertical spacing
    • Updated text alignment for facility description
    • Modified button background and hover states in dropdown menu

@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

  • New Features

    • Added optional hint property to the AvatarEditModal component for customizable guidance messages.
    • Introduced cover image upload guidance hint in the Facility Home section.
  • Style

    • Adjusted vertical spacing of the MapPin component.
    • Updated button background and hover states in the dropdown menu for improved visual consistency.
  • Localization

    • Enhanced English localization with dynamic placeholders for image upload guidelines.
    • Removed specific localization entries regarding image upload guidelines in Hindi, Kannada, and Tamil.
    • Updated Malayalam translations with new healthcare-related terms.

@abhimanyurajeesh abhimanyurajeesh requested a review from a team as a code owner January 16, 2025 18:56
Copy link
Contributor

coderabbitai bot commented Jan 16, 2025

Walkthrough

The pull request introduces enhancements to the AvatarEditModal component by adding an optional hint property for customizable hint messages. In the FacilityHome component, a new coverImageHint constant is created to provide guidance on image upload requirements. Additionally, minor UI adjustments are made, including changing the margin of the map pin and updating button background colors for improved visual consistency.

Changes

File Change Summary
src/components/Common/AvatarEditModal.tsx - Added optional hint prop to Props interface
- Renamed commonHint to defaultHint
- Updated hint message logic to prioritize custom hint
src/components/Facility/FacilityHome.tsx - Added coverImageHint constant for image upload guidance
- Passed hint prop to AvatarEditModal
- Adjusted MapPin margin from mt-1 to mt-2
- Updated button background colors
public/locale/en.json - Updated strings to include dynamic placeholders for formats, max size, and aspect ratio
public/locale/hi.json - Removed keys for allowed formats, max size, and recommended aspect ratio
public/locale/kn.json - Removed key for allowed formats
public/locale/ml.json - Updated translations, no public entity changes
public/locale/ta.json - Removed keys for allowed formats, max size, and recommended aspect ratio

Assessment against linked issues

Objective Addressed Explanation
Create hint for cover image upload
Adjust UI elements for better alignment

Possibly related PRs

Suggested labels

tested, needs review, changes required

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

🐰 A rabbit's tale of UI delight,
Hints and margins now shine so bright!
Cover images with guidance clear,
Text aligned with technical cheer,
Code transforms with playful might! 🖥️


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dfd1ba0 and 5f4d5b2.

📒 Files selected for processing (7)
  • public/locale/en.json (3 hunks)
  • public/locale/hi.json (0 hunks)
  • public/locale/kn.json (0 hunks)
  • public/locale/ml.json (0 hunks)
  • public/locale/ta.json (0 hunks)
  • src/components/Common/AvatarEditModal.tsx (5 hunks)
  • src/components/Facility/FacilityHome.tsx (4 hunks)
💤 Files with no reviewable changes (4)
  • public/locale/kn.json
  • public/locale/ta.json
  • public/locale/hi.json
  • public/locale/ml.json
✅ Files skipped from review due to trivial changes (1)
  • public/locale/en.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/Common/AvatarEditModal.tsx
  • src/components/Facility/FacilityHome.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: cypress-run (1)

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 16, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 5f4d5b2
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/678b8095f15bbf0009f155d6
😎 Deploy Preview https://deploy-preview-10021--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

🧹 Nitpick comments (1)
src/components/Facility/FacilityHome.tsx (1)

347-347: Consider readability impact of text justification.

While text-justify provides a clean look, it can create inconsistent word spacing and affect readability, especially for non-Latin scripts or when the text contains long words. Consider using text-left for better readability across different languages and content types.

-<CardContent className="mt-4 text-justify">
+<CardContent className="mt-4 text-left">
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a4b4206 and 43af5cf.

📒 Files selected for processing (2)
  • src/components/Common/AvatarEditModal.tsx (6 hunks)
  • src/components/Facility/FacilityHome.tsx (5 hunks)
🔇 Additional comments (7)
src/components/Common/AvatarEditModal.tsx (4)

27-27: LGTM! Well-structured prop addition.

The new optional hint prop is properly typed as React.ReactNode, maintaining backward compatibility while allowing for flexible content.


55-55: LGTM! Clean prop destructuring.

The hint prop is properly destructured along with other props, maintaining consistent code style.


Line range hint 170-180: LGTM! Clean implementation of customizable hints.

The hint message implementation follows React best practices with a clear fallback pattern. The rename from commonHint to defaultHint improves code clarity.


202-202: LGTM! Consistent hint message placement.

The hint message is consistently used in both the image preview and no-image states, providing clear guidance to users.

Also applies to: 253-253

src/components/Facility/FacilityHome.tsx (3)

212-212: LGTM! Enhanced visual feedback.

The gradient overlay transition provides smooth visual feedback on hover, improving the user experience.


239-239: LGTM! Improved button visibility.

The increased background opacity values provide better contrast while maintaining a consistent visual hierarchy in the hover states.


168-175: Verify aspect ratio recommendation consistency.

While the hint implementation is clean and well-internationalized, there's an inconsistency in the recommended aspect ratios:

  • FacilityHome.tsx recommends 16:9
  • AvatarEditModal's default hint recommends 1:1

This might confuse users if they see different recommendations in different contexts.

Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
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; just minor suggestion

{t("max_size_for_image_uploaded_should_be")} 1mb.
<br />
{t("allowed_formats_are")} jpg,png,jpeg.{" "}
{t("recommended_aspect_ratio_for")} the image is 16:9
Copy link
Member

Choose a reason for hiding this comment

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

i don't think mixing english with translation language is a good idea. pass it as variables. check how to pass variables to i18n's t function and other existing usages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya even I thought of doing that, since code was already existing, I didn't wanna do that but If this t is not use anywhere else update it or else create a new one.

Copy link
Member

Choose a reason for hiding this comment

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

update it; update it in existing ones too if any;

@abhimanyurajeesh
Copy link
Contributor Author

lgtm; just minor suggestion

No worries 😉 let's do that minor suggestion.

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.

Facility Issues: Cover Not Functioning Properly and Minor Suggestions for the Facility Page
2 participants