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

Referral letter preview desktop #8954

Merged

Conversation

modamaan
Copy link
Contributor

@modamaan modamaan commented Oct 28, 2024

Proposed Changes

Referral letter preview desktop and responsive

Before
Image

After
Screenshot 2024-10-29 064626

@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 print functionality for referral letters with improved layout and visual appeal.
    • Introduced a new UI card system, including components for headers, titles, descriptions, content, and footers.
  • Improvements

    • QR code rendering updated for better presentation using QRCodeSVG.
    • Patient information now displayed in a structured grid layout.
  • User Interface

    • Minor adjustments to print mode toggle and button layout for improved usability.

@modamaan modamaan requested a review from a team as a code owner October 28, 2024 15:19
Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for care-ohc ready!

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

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Oct 28, 2024
@modamaan
Copy link
Contributor Author

@bodhish should i update anything?

@modamaan
Copy link
Contributor Author

Screenshot 2024-10-29 192122

@modamaan
Copy link
Contributor Author

@rithviknishad can you check

src/CAREUI/misc/PrintPreview.tsx Outdated Show resolved Hide resolved
@rithviknishad rithviknishad added changes required and removed Deploy-Failed Deplyment is not showing preview labels Oct 30, 2024
@nihal467
Copy link
Member

nihal467 commented Nov 4, 2024

image
@modamaan

  • the close and print buttons in the mobile responsive view is not properly aligned

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 (1)
src/components/Shifting/ShiftDetails.tsx (1)

299-303: Consider responsive QR code sizing

The QR code has a fixed size of 120px which might not scale well on smaller screens.

Consider making the QR code size responsive:

-size={120}
+size={window.innerWidth < 640 ? 80 : 120}
+className="mt-4 sm:mt-0 max-w-full"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 890161a and f04a1e8.

📒 Files selected for processing (1)
  • src/components/Shifting/ShiftDetails.tsx (3 hunks)
🧰 Additional context used
📓 Learnings (1)
src/components/Shifting/ShiftDetails.tsx (1)
Learnt from: modamaan
PR: ohcnetwork/care_fe#8954
File: src/components/Shifting/ShiftDetails.tsx:432-433
Timestamp: 2024-11-12T10:23:10.322Z
Learning: In `src/components/Shifting/ShiftDetails.tsx`, the `print` button is inside the `PrintPreview` component and the `close` button is outside, so aligning them with flexbox within the same container isn't feasible.
🔇 Additional comments (4)
src/components/Shifting/ShiftDetails.tsx (4)

10-12: LGTM! Clean import additions

The new imports for PrintPreview and Card components are properly organized and correctly sourced from their respective paths.


279-437: Well-structured print preview implementation

The print preview implementation is well-organized with:

  • Semantic HTML structure using Card components
  • Consistent use of translation functions
  • Clear visual hierarchy
  • Proper spacing and typography

448-448: LGTM! Clean print mode implementation

The print mode toggle is implemented correctly with proper conditional rendering.


372-374: ⚠️ Potential issue

Add null check for consultation date

The date formatting could throw an error if the consultation object is undefined.

Apply this diff to add a null check:

-{formatDateTime(
-  consultation.encounter_date || consultation.created_date,
-) || "-"}
+{consultation
+  ? formatDateTime(
+      consultation.encounter_date || consultation.created_date
+    )
+  : "-"}

Likely invalid or redundant comment.

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.

We do not have a shadow with border in other print previews used in care. Let's keep the design consistent with other usages too.

Existing Prescriptions Print Referral Letter Print
image image
image image

@modamaan
Copy link
Contributor Author

modamaan commented Dec 3, 2024

@rithviknishad what change should I make, please ?

@github-actions github-actions bot added needs-triage question Further information is requested labels Dec 3, 2024
@rithviknishad rithviknishad merged commit 59a584d into ohcnetwork:develop Dec 3, 2024
13 of 15 checks passed
Copy link

github-actions bot commented Dec 3, 2024

@modamaan 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: referral letter responsiveness
5 participants