-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: add label to cast vote checking progress #1587
Conversation
WalkthroughThe changes introduce a new case in the Changes
Possibly related PRs
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
packages/extension-polkagate/src/fullscreen/governance/post/castVote/index.tsx (3)
124-126
: LGTM! Consider adding a period for consistency.The addition of the
CHECK_SCREEN
case in thetitle
computation improves the user interface by providing a clear indication of the current step. Good use of the translation function for internationalization support.For consistency with other title strings, consider adding a period at the end:
- return t('Checking'); + return t('Checking.');
Line range hint
232-236
: LGTM! Consider using early return for improved readability.The addition of this
useEffect
hook improves the flow of the voting process by automatically transitioning to the appropriate step based on the user's voting status. Good job on checking thatnotVoted !== undefined
to ensure the transition only occurs when the voting status has been determined.For improved readability, consider using an early return:
useEffect(() => { - if (step === STEPS.CHECK_SCREEN && notVoted !== undefined) { - notVoted ? setStep(STEPS.INDEX) : setStep(STEPS.PREVIEW); - } + if (step !== STEPS.CHECK_SCREEN || notVoted === undefined) { + return; + } + setStep(notVoted ? STEPS.INDEX : STEPS.PREVIEW); }, [notVoted, step]);This refactoring makes the logic more explicit and easier to follow.
Line range hint
253-258
: LGTM! Consider adding a showCube prop to other WaitScreen instances for consistency.The addition of the
WaitScreen
component for theCHECK_SCREEN
step improves the user experience by providing visual feedback during the checking process. Good use of the translation function for internationalization support.For consistency with other
WaitScreen
instances in the component, consider adding theshowCube
prop to theWaitScreen
component used in theWAIT_SCREEN
step:{step === STEPS.WAIT_SCREEN && - <WaitScreen /> + <WaitScreen + showCube + /> }This will ensure a consistent visual appearance across different waiting states in the application.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/extension-polkagate/src/fullscreen/governance/post/castVote/index.tsx (1 hunks)
🧰 Additional context used
## [0.18.3](v0.18.2...v0.18.3) (2024-10-13) ### Bug Fixes * add label to cast vote checking progress ([#1587](#1587)) ([c746ea6](c746ea6))
Summary by CodeRabbit