-
Notifications
You must be signed in to change notification settings - Fork 560
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
Re-design Encounter Card #10579
Re-design Encounter Card #10579
Conversation
WalkthroughThis pull request updates two key components. In the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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/Facility/EncounterCard.tsx (2)
58-103
: Consider adjusting mobile margins.The layout improvements look great, but the
mx-3
class on mobile viewports might cause content overflow or uneven spacing.Consider this adjustment:
- <div key={i} className="w-full mx-3 sm:w-auto"> + <div key={i} className="w-full px-3 sm:w-auto sm:px-0">
104-117
: Streamline button styling.While the button placement and icon addition improve usability, the styling approach could be more consistent.
Consider removing the explicit border style and relying on the variant:
- className="p-2 border border-black" + className="p-2"This will maintain consistency with your design system's button styling.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Facility/EncounterCard.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: cypress-run (1)
🔇 Additional comments (3)
src/components/Facility/EncounterCard.tsx (3)
2-3
: LGTM! Clean dependency management.The switch from Link to Button+navigate and the addition of UI components align well with the card redesign objectives.
Also applies to: 8-9
22-31
: Great improvement to visual hierarchy!The new card structure with the left border and positioned badge creates an elegant timeline-like visualization for encounters.
33-56
: Excellent status visualization improvements!The enhanced badges with:
- Contextual colors (green for completed, purple for in-progress)
- Consistent icon usage
- Improved spacing and padding
make the encounter status much more intuitive and visually appealing.
@AdityaJ2305 please add screenshot or demo video for your PR's so that its really easier for the reviewer to see what chagned visually. |
There was a problem hiding this 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 (3)
src/components/Facility/EncounterCard.tsx (3)
36-51
: Simplify badge conditional rendering.The badge implementation can be simplified by extracting the conditional styles into a utility function or constant.
Consider refactoring to:
+ const getBadgeStyles = (status: string) => ({ + background: completedEncounterStatus.includes(status) + ? "bg-green-100 text-green-800 border-green-200" + : "bg-purple-100 text-indigo-800 border-purple-200", + icon: completedEncounterStatus.includes(status) + ? <BadgeCheck className="w-4 h-4 text-teal-700" /> + : <CircleDashed className="w-4 h-4 text-indigo-800" /> + }); <Badge variant="outline" className={cn( "inline-flex gap-2 py-1", - completedEncounterStatus.includes(encounter.status) - ? "bg-green-100 text-green-800 border-green-200" - : "bg-purple-100 text-indigo-800 border-purple-200", + getBadgeStyles(encounter.status).background )} > - {completedEncounterStatus.includes(encounter.status) ? ( - <BadgeCheck className="w-4 h-4 text-teal-700" /> - ) : ( - <CircleDashed className="w-4 h-4 text-indigo-800" /> - )} + {getBadgeStyles(encounter.status).icon} {t(`encounter_status__${encounter.status}`)} </Badge>
34-34
: Standardize spacing units.The layout uses inconsistent spacing units:
p-4 sm:p-2
in CardContentmx-3
in grid items
Consider using rem units consistently for better maintainability.- <CardContent className="p-4 sm:p-2 space-y-4"> + <CardContent className="p-4 space-y-4"> - <div className="w-full mx-3 sm:w-auto"> + <div className="w-full mx-4 sm:w-auto">Also applies to: 61-62
104-117
: Improve button implementation.The button implementation can be enhanced in several ways:
- Extract the onClick handler
- Use the design system's button variants instead of custom border styles
Consider refactoring to:
+ const handleViewEncounter = () => { + navigate(`/facility/${encounter.facility.id}/encounter/${encounter.id}/updates`); + }; <div className="w-full py-2 bg-gray-100 px-2"> <Button variant="outline" - onClick={() => - navigate( - `/facility/${encounter.facility.id}/encounter/${encounter.id}/updates`, - ) - } - className="p-2 border border-black" + onClick={handleViewEncounter} + className="p-2" > <Eye className="mr-2 h-4 w-4" /> {t("view_encounter")} </Button> </div>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Facility/EncounterCard.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test
- GitHub Check: cypress-run (1)
🔇 Additional comments (1)
src/components/Facility/EncounterCard.tsx (1)
1-16
: LGTM! Well-organized imports.The imports are logically grouped and all imported components are utilized effectively in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nihal467 , I've added the icon sync with encounter class like we do have it in "Initiate Patient Encounter" form .
I'm not able to understand above point |
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, minor thing
There was a problem hiding this 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/common/constants.tsx (1)
369-376
: Consider using a more intuitive icon for emergency encounters.While most icon mappings are intuitive, using
Building2
for emergency encounters (emer
) might not immediately convey urgency. Consider using a more appropriate icon likeSiren
orAlertTriangle
from thelucide-react
library to better represent emergency situations.export const encounterIcons = { imp: BedDouble, amb: Ambulance, obsenc: Stethoscope, - emer: Building2, + emer: AlertTriangle, // or Siren for better representation of emergency vr: MonitorSmartphone, hh: Home, } as const satisfies Record<EncounterClass, LucideIcon>;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/common/constants.tsx
(2 hunks)src/components/Facility/EncounterCard.tsx
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/Facility/EncounterCard.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test
- GitHub Check: cypress-run (1)
🔇 Additional comments (1)
src/common/constants.tsx (1)
1-9
: LGTM! Well-organized imports.The new imports are properly organized and grouped by their sources.
Also applies to: 13-13
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
|
LGTM |
@AdityaJ2305 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! 🙌 |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Style
Chores