Closed mohitb35 closed 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
planet-webapp | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 28, 2024 0:28am |
planet-webapp-multi-tenancy-setup | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 28, 2024 0:28am |
The IssueCodesForm.tsx
file in the BulkCodes
feature was updated to enhance efficiency and readability. The changes involved refactoring the getTotalAmount
function into a useMemo
hook named totalAmount
. Additionally, the logic controlling form submission was modified to account for new conditions based on totalAmount
. These updates optimize re-renders and add robustness to the form validation process.
File Path | Change Summary |
---|---|
src/features/user/BulkCodes/forms/... |
Renamed getTotalAmount function to totalAmount and converted it to a useMemo hook. |
src/features/user/BulkCodes/forms/... |
Updated dependencies of the totalAmount hook to include various form-related parameters. |
src/features/user/BulkCodes/forms/... |
Modified shouldDisableSubmission logic to include conditions related to totalAmount . |
src/features/user/BulkCodes/forms/... |
Replaced calls to getTotalAmount() with totalAmount in the BulkGiftTotal component. |
In codes we moved, a gentle shift,
getTotalAmount
received a lift.
WithuseMemo
now, the form does flow,
Calculations swift, like wind they go.
Dependencies aligned, submission's gate tight,
Enhancing our journey, day and night. 🌟
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?
This pull request fixes the logic for enabling/disabling the Issue Codes button in the IssueCodesForm component.
The logic was previously inverted i.e. the button was disabled when it should have been enabled, and vice versa.
In addition, a check on totalAmount has been added to ensure the button isn't enabled when the calculated total is 0.