Skip to content

Refactor(web)/delete web3 react files #949

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

Merged
merged 22 commits into from
Jun 23, 2023

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented Jun 16, 2023

maybe this is not done correctly:

image

and I don't know if we need the files utils/switchChain.ts and WrongChainBoundary.tsx etc anymore

@alcercu
Copy link
Contributor

alcercu commented Jun 19, 2023

yep, the connector is not needed, and regarding the utils/switchchain let's go with the default wagmi hook to switch network (check if it can add new networks to the wallet)

Base automatically changed from refactor(web)/migrate-to-wagmi to dev June 21, 2023 10:38
@netlify
Copy link

netlify bot commented Jun 21, 2023

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit 0d717b6
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/64957376f5db4c00079b8f32
😎 Deploy Preview https://deploy-preview-949--kleros-v2.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 21, 2023

Deploy Preview for kleros-v2-contracts ready!

Name Link
🔨 Latest commit 0d717b6
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-contracts/deploys/649573767fd4e9000855a3b6
😎 Deploy Preview https://deploy-preview-949--kleros-v2-contracts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

<Button disabled={isOpen} small text={"Connect"} onClick={async () => await open({ route: "ConnectWallet" })} />
);
const { open, isOpen } = useWeb3Modal();
if (isConnected && chain && chain.id !== DEFAULT_CHAIN) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Break this statement in two:

if (isConnected)
  if (chain && chain.id !== DEFAULT_CHAIN)
    switchButton
  else
    display
else
  connect

return <AccountDisplay />;
} else {
return (
<Button disabled={isOpen} small text={"Connect"} onClick={async () => await open({ route: "ConnectWallet" })} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abstract this into a component

/>
);
};

const ConnectButton: React.FC = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename component and file to ConnectWallet

}
}}
/>
{chain && chain.id === DEFAULT_CHAIN ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abstract this into ensureChain function, that receives a ReactNode and wraps it with the check

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@alcercu alcercu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alcercu alcercu merged commit 5acd04a into dev Jun 23, 2023
@alcercu alcercu deleted the refactor(web)/delete-web3-react-files branch June 23, 2023 10:31
@jaybuidl jaybuidl added this to the alpha-1 milestone Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants