-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,143 additions
and
916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,6 @@ | |
"@emotion/server": "latest", | ||
"@emotion/styled": "11.10.4", | ||
"@gelatonetwork/relay-sdk": "^5.5.5", | ||
"@gnosis.pm/safe-apps-web3-react": "^1.2.0", | ||
"@heroicons/react": "^1.0.6", | ||
"@lingui/react": "^3.14.0", | ||
"@mui/icons-material": "^5.10.14", | ||
|
@@ -61,19 +60,8 @@ | |
"@visx/tooltip": "^2.16.0", | ||
"@walletconnect/ethereum-provider": "^2.13.3", | ||
"@walletconnect/modal": "2.7.0", | ||
"@web3-react/abstract-connector": "^6.0.7", | ||
"@web3-react/coinbase-wallet": "^8.2.3", | ||
"@web3-react/core": "^8.2.3", | ||
"@web3-react/frame-connector": "^6.0.9", | ||
"@web3-react/injected-connector": "^6.0.7", | ||
"@web3-react/metamask": "^8.2.4", | ||
"@web3-react/network": "^8.2.3", | ||
"@web3-react/store": "^8.2.3", | ||
"@web3-react/torus-connector": "^6.2.9", | ||
"@web3-react/types": "^8.2.3", | ||
"@web3-react/walletconnect-v2": "^8.5.1", | ||
"@web3-react/walletlink-connector": "^6.2.14", | ||
"blo": "^1.1.1", | ||
"connectkit": "^1.8.2", | ||
"d3-array": "^3.2.0", | ||
"d3-time-format": "^4.1.0", | ||
"dayjs": "^1.11.5", | ||
|
@@ -96,6 +84,8 @@ | |
"reflect-metadata": "^0.1.13", | ||
"remark-gfm": "^3.0.1", | ||
"tiny-invariant": "^1.3.1", | ||
"viem": "2.x", | ||
"wagmi": "^2.13.5", | ||
"zustand": "^4.1.4" | ||
}, | ||
"devDependencies": { | ||
|
@@ -137,10 +127,7 @@ | |
"jest-environment-jsdom": "^29.7.0", | ||
"lint-staged": "^13.0.3", | ||
"prettier": "^2.8.1", | ||
"typescript": "^4.9.4" | ||
}, | ||
"resolutions": { | ||
"@web3-react/walletlink-connector/@coinbase/wallet-sdk": "3.1.0" | ||
"typescript": "^5.0.4" | ||
}, | ||
"contributors": [ | ||
"Anastasia Khovaeva <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,44 @@ | ||
import { Trans } from '@lingui/macro'; | ||
import { Button } from '@mui/material'; | ||
import dynamic from 'next/dynamic'; | ||
import { ConnectKitButton } from 'connectkit'; | ||
import { useWalletModalContext } from 'src/hooks/useWalletModal'; | ||
import { useRootStore } from 'src/store/root'; | ||
import { AUTH } from 'src/utils/mixPanelEvents'; | ||
|
||
const WalletModal = dynamic(() => import('./WalletModal').then((module) => module.WalletModal)); | ||
import { AvatarSize } from '../Avatar'; | ||
import { UserDisplay } from '../UserDisplay'; | ||
|
||
export interface ConnectWalletProps { | ||
funnel?: string; | ||
} | ||
|
||
export const ConnectWalletButton: React.FC<ConnectWalletProps> = ({ funnel }) => { | ||
const { setWalletModalOpen } = useWalletModalContext(); | ||
const trackEvent = useRootStore((store) => store.trackEvent); | ||
|
||
return ( | ||
<> | ||
<Button | ||
variant="gradient" | ||
onClick={() => { | ||
trackEvent(AUTH.CONNECT_WALLET, { funnel: funnel }); | ||
setWalletModalOpen(true); | ||
<ConnectKitButton.Custom> | ||
{({ isConnected, show }) => { | ||
return ( | ||
<Button | ||
variant={isConnected ? 'surface' : 'gradient'} | ||
onClick={() => { | ||
show && show(); | ||
}} | ||
> | ||
{isConnected ? ( | ||
<UserDisplay | ||
avatarProps={{ size: AvatarSize.SM }} | ||
oneLiner={true} | ||
titleProps={{ variant: 'buttonM' }} | ||
/> | ||
) : ( | ||
<Trans>Connect wallet</Trans> | ||
)} | ||
</Button> | ||
); | ||
}} | ||
> | ||
<Trans>Connect wallet</Trans> | ||
</Button> | ||
<WalletModal /> | ||
</ConnectKitButton.Custom> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.