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

Sidebar Duotone icons #9281

Merged
merged 3 commits into from
Dec 5, 2024
Merged

Sidebar Duotone icons #9281

merged 3 commits into from
Dec 5, 2024

Conversation

shivankacker
Copy link
Member

@shivankacker shivankacker commented Dec 3, 2024

Waiting for facilities icon

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

  • New Features

    • Introduced duo-tone icons, enhancing the visual representation of icons in the application.
    • Added a new JSON file for duo-tone icon paths, expanding available icon options.
  • Bug Fixes

    • Updated navigation icons in the sidebar for improved semantic clarity.
  • Improvements

    • Enhanced notification handling with better state management for read/unread statuses.
    • Improved UI interactions and loading indicators for notifications.
    • Updated various components to use new icon representations, ensuring consistency across the application.

@shivankacker shivankacker requested a review from a team as a code owner December 3, 2024 11:43
Copy link
Contributor

coderabbitai bot commented Dec 3, 2024

Walkthrough

The pull request introduces significant modifications to the CareIcon component, enhancing its functionality to support duo-tone icons by incorporating a new JSON file, DuoTonePaths.json, which defines various icon paths. Additionally, the StatelessSidebar component is updated to reflect new icon names, transitioning from a prefix of "l-" to "d-". The NotificationsList component also undergoes changes to improve notification handling and UI representation, including updates to state management and rendering logic for notifications.

Changes

File Path Change Summary
src/CAREUI/icons/CareIcon.tsx - Added import for duoToneIconData.
- Updated IconName type to include duo-tone icons.
- Modified rendering logic to support secondaryPath.
src/CAREUI/icons/DuoTonePaths.json - Introduced new JSON file with icon definitions for duo-tone icons.
src/components/Common/Sidebar/Sidebar.tsx - Updated BaseNavItems to change icon prefixes from "l-" to "d-" for multiple navigation items.
src/components/Notifications/NotificationsList.tsx - Changed icon prop in Item component.
- Enhanced notification handling logic with asynchronous functions.
- Updated rendering logic for notifications.
src/components/Assets/AssetsList.tsx - Updated icon in CountBlock from "l-monitor-heart-rate" to "d-folder".
src/components/Facility/DischargedPatientsList.tsx - Updated icon in CountBlock from "l-user-injured" to "d-patient".
src/components/Facility/FacilityList.tsx - Updated icon in CountBlock from "l-hospital" to "d-hospital".
src/components/Facility/FacilityUsers.tsx - Updated icon in CountBlock from "l-user-injured" to "d-people".
src/components/Patient/ManagePatients.tsx - Updated icon in CountBlock from "l-user-injured" to "d-patient".
- Enhanced phone number handling logic.
src/components/Patient/SampleViewAdmin.tsx - Updated icon in CountBlock from "l-thermometer" to "d-microscope".
src/components/Users/ManageUsers.tsx - Updated icon in CountBlock from "l-user-injured" to "d-people".

Assessment against linked issues

Objective Addressed Explanation
Update side navigation icons with new duotone design (#9216)

Possibly related PRs

Suggested labels

needs review, tested

Suggested reviewers

  • rithviknishad
  • nihal467
  • khavinshankar

🐰 In the world of icons, bright and new,
Duo-tones sparkle, a vibrant view.
From "l-" to "d-", a change we see,
In the sidebar's charm, oh so free!
Notifications now dance with delight,
Hopping along, everything feels right! 🌟


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

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 6193100
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/674ff8dbaa056c0008e5f1e4
😎 Deploy Preview https://deploy-preview-9281--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.

@shivankacker shivankacker marked this pull request as draft December 3, 2024 11:44
Copy link

cloudflare-workers-and-pages bot commented Dec 3, 2024

Deploying care-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6193100
Status: ✅  Deploy successful!
Preview URL: https://40c17828.care-fe.pages.dev
Branch Preview URL: https://sidebar-icons.care-fe.pages.dev

View logs

@shivankacker shivankacker self-assigned this Dec 3, 2024
Copy link

cypress bot commented Dec 3, 2024

CARE    Run #3986

Run Properties:  status check passed Passed #3986  •  git commit 6193100587: Sidebar Duotone icons
Project CARE
Branch Review sidebar-icons
Run status status check passed Passed #3986
Run duration 05m 10s
Commit git commit 6193100587: Sidebar Duotone icons
Committer Shivank Kacker
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 135
View all changes introduced in this branch ↗︎

src/CAREUI/icons/CareIcon.tsx Outdated Show resolved Hide resolved
src/CAREUI/icons/CareIcon.tsx Show resolved Hide resolved
@shivankacker shivankacker marked this pull request as ready for review December 3, 2024 15:30
@shivankacker shivankacker requested a review from sainak December 3, 2024 15:32
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 (2)
src/CAREUI/icons/CareIcon.tsx (1)

31-34: Consider memoizing the icon data selection.

The type assertion and conditional selection of icon data on each render could impact performance for frequently re-rendered components.

Consider memoizing the icon data selection:

-  const [viewBox, path, fill, strokeWidth, secondaryPath] = (
-    (icon.startsWith("d-") ? duoToneIconData : iconData) as typeof iconData &
-      typeof duoToneIconData
-  )[icon] as [
+  const iconSource = useMemo(() => 
+    (icon.startsWith("d-") ? duoToneIconData : iconData) as typeof iconData &
+      typeof duoToneIconData
+  , [icon]);
+  const [viewBox, path, fill, strokeWidth, secondaryPath] = iconSource[icon] as [
src/components/Facility/DischargedPatientsList.tsx (1)

Line range hint 484-487: Update PatientListItem to use duotone icon.

The PatientListItem component still uses the legacy "l-user-injured" icon while the parent component has been updated to use duotone icons.

Apply this change for consistency:

-          icon="l-user-injured"
+          icon="d-patient"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between caf751b and c9857e6.

📒 Files selected for processing (10)
  • src/CAREUI/icons/CareIcon.tsx (3 hunks)
  • src/CAREUI/icons/DuoTonePaths.json (1 hunks)
  • src/components/Assets/AssetsList.tsx (1 hunks)
  • src/components/Common/Sidebar/Sidebar.tsx (1 hunks)
  • src/components/Facility/DischargedPatientsList.tsx (1 hunks)
  • src/components/Facility/FacilityList.tsx (1 hunks)
  • src/components/Facility/FacilityUsers.tsx (1 hunks)
  • src/components/Patient/ManagePatients.tsx (1 hunks)
  • src/components/Patient/SampleViewAdmin.tsx (1 hunks)
  • src/components/Users/ManageUsers.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • src/components/Facility/FacilityUsers.tsx
  • src/components/Facility/FacilityList.tsx
  • src/components/Patient/SampleViewAdmin.tsx
  • src/components/Assets/AssetsList.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Common/Sidebar/Sidebar.tsx
🔇 Additional comments (7)
src/CAREUI/icons/CareIcon.tsx (3)

1-1: LGTM: Import statement is correctly placed.

The new import for duotone icons is appropriately placed alongside the existing icon data import.


5-5: LGTM: Type definition is correctly updated.

The IconName type now properly includes both regular and duotone icons through a union type.


59-67: LGTM: Secondary path implementation is correct.

The conditional rendering of the secondary path with opacity is well implemented. The opacity value of 0.32 creates the duotone effect.

src/CAREUI/icons/DuoTonePaths.json (1)

1-72: LGTM: Icon definitions are well-structured.

The JSON file follows a consistent structure for all icons with appropriate naming conventions using the "d-" prefix.

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

291-291: LGTM: CountBlock icon updated to use duotone style.

The icon prop is correctly updated to use the new duotone patient icon.

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

557-557: Icon update aligns with duotone design system

The change from "l-user-injured" to "d-people" is semantically appropriate for representing users and follows the new duotone icon design system.

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

983-983: Icon update improves semantic representation

The change from "l-user-injured" to "d-patient" is a better semantic representation for patients and aligns with the new duotone icon design system.

@nihal467
Copy link
Member

nihal467 commented Dec 4, 2024

LGTM

@khavinshankar khavinshankar merged commit 72fcf8d into develop Dec 5, 2024
57 checks passed
@khavinshankar khavinshankar deleted the sidebar-icons branch December 5, 2024 07:12
Copy link

github-actions bot commented Dec 5, 2024

@shivankacker 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! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Update side navigation icons with new duotone design
5 participants