-
Notifications
You must be signed in to change notification settings - Fork 6
fix(web): improve onClick functionality #74
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
Conversation
✅ Deploy Preview for kleros-escrow-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
WalkthroughThe updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DesktopHeader
participant ConnectWalletContainer
User->>DesktopHeader: Open Header
DesktopHeader->>ConnectWalletContainer: Check isConnected and isDefaultChain
ConnectWalletContainer-->>User: Display wallet connection options
User->>ConnectWalletContainer: Click to connect wallet
ConnectWalletContainer-->>DesktopHeader: toggleIsSettingsOpen (if valid)
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 as PR comments)
Additionally, you can add 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/src/layout/Header/DesktopHeader.tsx (4 hunks)
Additional comments not posted (4)
web/src/layout/Header/DesktopHeader.tsx (4)
6-6: Confirm the necessity and correct usage of new imports.The
useAccountanduseChainIdhooks fromwagmiare imported. Ensure that these hooks are necessary and correctly used in the code.
8-8: Confirm the necessity and correct usage of the constant.The
DEFAULT_CHAINconstant is imported fromconsts/chains. Ensure that this constant is necessary and correctly used in the code.
73-79: Confirm the correct usage of the new prop and conditional styles.The
ConnectWalletContainerstyled component now accepts an additional prop,isCorrectChain, and conditionally applies styles based on bothisConnectedandisCorrectChain. Ensure that the new prop is correctly used and the styles are applied as expected.
92-94: Confirm the correct implementation of the logic and expected behavior.The
DesktopHeadercomponent uses theuseChainIdhook to get the current chain ID and compares it withDEFAULT_CHAINto deriveisCorrectChain. TheisCorrectChainis used to conditionally render theConnectWalletContainerand handle theonClickevent. Ensure that the logic is correctly implemented and the component behaves as expected.Also applies to: 120-120
kemuru
left a comment
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.
doesn't work either. refer to kleros/curate-v2#52 (review)
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/src/layout/Header/DesktopHeader.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- web/src/layout/Header/DesktopHeader.tsx
PR-Codex overview
The focus of this PR is to update the
DesktopHeadercomponent to conditionally render the settings based on the default chain.Detailed summary
useNetworkimport from "wagmi"DEFAULT_CHAINfrom "consts/chains"isDefaultChainstate based on the current chainConnectWalletContainerstyling based onisDefaultChainConnectWalletContaineronClick logic based onisDefaultChainandisConnectedSummary by CodeRabbit