Closed AMIRKHANEF closed 2 weeks ago
The pull request introduces several enhancements to the governance components within the application. Key changes include the creation of a new tooltip component for displaying locked amounts, refactoring of the VotingInformation
component to improve prop handling, and adjustments to type safety in utility functions. Additionally, layout modifications are made to the MyVote
component for better alignment. The getLocks
function in the useAccountLocks
hook is simplified to ensure consistent handling of locked amounts. Overall, the changes focus on improving readability, maintainability, and type safety.
File Path | Change Summary |
---|---|
packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx |
Added AlreadyLockedTooltipText component; refactored VotingInformation to accept props directly; improved tooltip logic; streamlined imports and JSX structure. |
packages/extension-polkagate/src/fullscreen/governance/post/myVote/index.tsx |
Added alignItems='center' to <Grid> for vertical alignment; no changes to existing logic. |
packages/extension-polkagate/src/fullscreen/governance/post/myVote/util.tsx |
Updated isAye and getConviction functions for type handling; changed prior and delegating types from any to unknown . |
packages/extension-polkagate/src/hooks/useAccountLocks.ts |
Simplified getLocks function by unconditionally assigning the locked variable. |
Objective | Addressed | Explanation |
---|---|---|
Fix wrong locked amount information on Delegate page (#1562) | ✅ |
VotingInformation
component related to governance comment sections.VotingInformation
component.useLockedInReferenda
hook, aligning with account locks management.🐇 "In the fields where the votes sway,
A tooltip now shows what to say.
With locks and amounts, all clear as day,
Our governance shines in a better way!
So hop along, let’s make it bright,
For every vote counts, and that 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?
Close: #1562
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
getLocks
function for consistent handling of locked variables.