Skip to content

Commit

Permalink
Fix story for address with wallet (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Ritter authored Nov 30, 2021
1 parent e3f921e commit 209e3c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 227 deletions.
10 changes: 7 additions & 3 deletions packages/components/src/components/Address/Address.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ const WithWallet = () => {
const { connected, connectWallet, connection } = useWallet();

return (
<Provider network='rinkeby'>
<>
<Address
value={connected ? connection.ens || connection.userAddress || '' : 'Not connected'}
/>
<Button onClick={connectWallet}>Connect wallet</Button>
</Provider>
</>
);
};

storiesOf('Address', module).add('WithWallet', () => <WithWallet />);
storiesOf('Address', module).add('WithWallet', () => (
<Provider network='rinkeby'>
<WithWallet />
</Provider>
));
2 changes: 1 addition & 1 deletion packages/hooks/src/hooks/useWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Web3Context } from '../Provider';

/**
* @dev Hook to get the current web3 context inlcuding information about the connection and other helper methods.
* @dev Hook to get the current web3 context including information about the connection and other helper methods.
*/
export function useWallet() {
const context = React.useContext(Web3Context);
Expand Down
Loading

0 comments on commit 209e3c4

Please sign in to comment.