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

Wallet disconnect #728

Merged
merged 10 commits into from
Sep 25, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const ChatViewComponentTest = () => {
<div>
<h2>Chat UI Test page</h2>
<ChatViewComponentCard>
<ChatViewComponent onGetTokenClick={() => console.log("BOIIII RETURNNNSSSSS")} chatId='b8e068e02fe12d7136bc2f24408835573f30c6fbf0b65ea26ab4c7055a2c85f1' limit={10} isConnected={true} autoConnect={true}/>

<ChatViewComponent onGetTokenClick={() => console.log("BOIIII RETURNNNSSSSS")} chatId='b8e068e02fe12d7136bc2f24408835573f30c6fbf0b65ea26ab4c7055a2c85f1' limit={10} isConnected={true} autoConnect={false}/>


</ChatViewComponentCard>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions packages/uiweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@livepeer/react": "^2.6.0",
"@pushprotocol/socket": "^0.5.0",
"@unstoppabledomains/resolution": "^8.5.0",
"@web3-onboard/coinbase": "^2.2.5",
"@web3-onboard/core": "^2.21.1",
"@web3-onboard/injected-wallets": "^2.10.5",
"@web3-onboard/react": "^2.8.9",
Expand Down
14 changes: 10 additions & 4 deletions packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { IChatTheme } from '../theme';

import coinbaseWalletModule from '@web3-onboard/coinbase'
import { ConnectButtonSub } from './ConnectButton';
import { InfuraAPIKey } from '../../../config';
import { Web3OnboardProvider } from '@web3-onboard/react';
import injectedModule from '@web3-onboard/injected-wallets';
import injectedModule, { ProviderLabel } from '@web3-onboard/injected-wallets';
import walletConnectModule from '@web3-onboard/walletconnect'
import init from '@web3-onboard/core';
import { ethers } from 'ethers';
Expand All @@ -23,6 +24,7 @@ const wcv2InitOptions = {
}

const walletConnect = walletConnectModule(wcv2InitOptions)
const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true })
const chains = [
{
id: '0x1',
Expand Down Expand Up @@ -61,11 +63,15 @@ const chains = [
rpcUrl: 'https://rpc.ankr.com/arbitrum'
}
]
const wallets = [injectedModule(), walletConnect]

const wallets = [injectedModule({
displayUnavailable: [ProviderLabel.MetaMask]
}), walletConnect, coinbaseWalletSdk]


const appMetadata = {
name: 'Push Protocol',
icon: 'https://files.slack.com/files-pri/T011WQBLH39-F05QWQA0MSR/pushlogoblocknative.png',
icon: 'https://push.org/static/media/PushLogoTextBlack.fa01629c2ebd2149bab979861756591d.svg',
description: 'Example showcasing how to connect a wallet.',

recommendedInjectedWallets: [
Expand Down Expand Up @@ -94,7 +100,7 @@ interface IConnectButtonCompProps {
autoConnect?: boolean;
}

export const ConnectButtonComp:React.FC<IConnectButtonCompProps> = ({ autoConnect }) => {
export const ConnectButtonComp: React.FC<IConnectButtonCompProps> = ({ autoConnect }) => {
return (
<Web3OnboardProvider web3Onboard={web3OnBoard}>
<ConnectButtonSub autoConnect={autoConnect} />
Expand Down
Loading