Skip to content
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

Re-enable WalletConnect and add TypeScript definitions #37

Merged
merged 11 commits into from
Jun 29, 2020
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ Configuration for the different connectors. If you use a connector that requires
- `portis`: `{ dAppId }`
- `authereum`: no configuration needed.
- `squarelink`: `{ clientId, options }`
- `walletconnect`: `{ rpcUrl }`
- `walletlink`: `{ url, appName, appLogoUrl }`

See the [web3-react documentation](https://github.com/NoahZinsmeister/web3-react/tree/v6/docs) for more details.

Expand Down
36 changes: 28 additions & 8 deletions examples/nextjs/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,20 @@ function App() {
}

return (
<p>
<span>Connect:</span>
<button onClick={() => activate('injected')}>injected</button>
<button onClick={() => activate('frame')}>frame</button>
<button onClick={() => activate('portis')}>portis</button>
<button onClick={() => activate('fortmatic')}>fortmatic</button>
</p>
<div className="connect">
<div className="connect-label">Connect:</div>
<div className="connect-buttons">
<button onClick={() => activate('injected')}>injected</button>
<button onClick={() => activate('frame')}>frame</button>
<button onClick={() => activate('portis')}>portis</button>
<button onClick={() => activate('fortmatic')}>fortmatic</button>
<button onClick={() => activate('torus')}>torus</button>
<button onClick={() => activate('walletconnect')}>
walletconnect
</button>
<button onClick={() => activate('walletlink')}>walletlink</button>
</div>
</div>
)
})()}

Expand Down Expand Up @@ -103,6 +110,8 @@ function HomePage() {
connectors={{
fortmatic: { apiKey: '' },
portis: { dAppId: '' },
walletconnect: { rpcUrl: 'https://mainnet.eth.aragon.network/' },
walletlink: { url: 'https://mainnet.eth.aragon.network/' },
}}
>
<App />
Expand Down Expand Up @@ -131,12 +140,23 @@ function HomePage() {
margin: 2rem 0;
}
button {
width: 7rem;
height: 3rem;
cursor: pointer;
font-size: 1rem;
padding: 0;
}
.connect-label {
margin-bottom: 1rem;
}
.connect-buttons {
display: grid;
gap: 10px;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.connect-buttons button {
width: 100%;
height: 4rem;
}
`}
</style>
</UseWalletProvider>
Expand Down
1 change: 1 addition & 0 deletions examples/simple-connect/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
<title>Simple connect</title>
<meta name="viewport" content="width=device-width" />
</head>
<body>
Expand Down
37 changes: 28 additions & 9 deletions examples/simple-connect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ function App() {
}

return (
<p>
<span>Connect:</span>
<button onClick={() => activate('injected')}>injected</button>
<button onClick={() => activate('frame')}>frame</button>
<button onClick={() => activate('portis')}>portis</button>
<button onClick={() => activate('fortmatic')}>fortmatic</button>
<button onClick={() => activate('torus')}>torus</button>
</p>
<div className="connect">
<div className="connect-label">Connect:</div>
<div className="connect-buttons">
<button onClick={() => activate('injected')}>injected</button>
<button onClick={() => activate('frame')}>frame</button>
<button onClick={() => activate('portis')}>portis</button>
<button onClick={() => activate('fortmatic')}>fortmatic</button>
<button onClick={() => activate('torus')}>torus</button>
<button onClick={() => activate('walletconnect')}>
walletconnect
</button>
<button onClick={() => activate('walletlink')}>walletlink</button>
</div>
</div>
)
})()}

Expand Down Expand Up @@ -107,6 +113,8 @@ ReactDOM.render(
connectors={{
fortmatic: { apiKey: '' },
portis: { dAppId: '' },
walletconnect: { rpcUrl: 'https://mainnet.eth.aragon.network/' },
walletlink: { url: 'https://mainnet.eth.aragon.network/' },
}}
>
<App />
Expand Down Expand Up @@ -135,12 +143,23 @@ ReactDOM.render(
margin: 2rem 0;
}
button {
width: 7rem;
height: 3rem;
cursor: pointer;
font-size: 1rem;
padding: 0;
}
.connect-label {
margin-bottom: 1rem;
}
.connect-buttons {
display: grid;
gap: 10px;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.connect-buttons button {
width: 100%;
height: 4rem;
}
`}
</style>
</UseWalletProvider>,
Expand Down
Loading