-
Notifications
You must be signed in to change notification settings - Fork 532
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
Fixes greyed out 'Active Manage Bed' button in Location Management Page #8814 #8827
Fixes greyed out 'Active Manage Bed' button in Location Management Page #8814 #8827
Conversation
✅ 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.
isn't this the proper fix?
@@ -289,7 +289,7 @@ const Location = ({ | |||
border | |||
className={cn( | |||
"mt-3 flex w-full items-center justify-between", | |||
totalBeds != null && "opacity-50", | |||
totalBeds != null && "opacity-100", |
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.
totalBeds != null && "opacity-100", | |
totalBeds == null && "opacity-50", |
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.
hey @rithviknishad
if opacity-50 manage bed button will greyed out
if you want
opacity behaves correctly based on the totalBeds condition ??
When totalBeds is null, the button will have opacity-50, making it look greyed out.
When totalBeds has a value, the button will display with opacity-100, appearing fully visible.
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.
I think we should disable the button, why hack the class? Set disabled: true?
Hey @bodhish , Screen.Recording.2024-10-21.114442.mp4Let me know if it can be modified or improved. Thanks! |
The button seems to be disabled if beds count is 0. How would I be able to add a bed for that location now?
we should disable only for |
Hey @rithviknishad , |
Now that it's disabled if null, we don't need to add conditional classes like @bodhish suggested right? |
hey @rithviknishad , But I'm open to further discussion if you think a simpler approach would be better. Let me know your thoughts! |
The ButtonV2 component already applies necessary classes for it when disabled. |
hey @rithviknishad , |
…thub.com/abhip161/care_fe into issues/8814/fix-active-manage-bed-button
Tested working fine @nihal467 |
LGTM |
)} | ||
href={`location/${id}/beds`} | ||
className={cn("mt-3 flex w-full items-center justify-between")} | ||
href={totalBeds != null ? `location/${id}/beds` : undefined} |
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.
Intresting, why are we having a button when its a link 🤔
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.
@bodhish the button component does wrap it in a Link
component if href
is present
hey @rithviknishad could you check this out? |
hey @rithviknishad
Let me know if this looks good! |
Co-authored-by: Bodhish Thomas <bodhish@gmail.com>
👋 Hi, @abhip161, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@abhip161 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
Fixes Bug: Active Manage Bed button in Location Management Page is greyed out #8814
Change 1 Resolved issue where the 'Active Manage Bed' button was greyed out in the Location Management Page.
@ohcnetwork/care-fe-code-reviewers
Merge Checklist