Skip to content

Commit

Permalink
Bump rainbowkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan DesRosier committed Jun 27, 2023
1 parent 3d8e858 commit d7edd81
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@pooltogether/v4-twab-delegator-js": "0.2.2",
"@pooltogether/v4-utils-js": "0.1.5",
"@pooltogether/wallet-connection": "1.0.3",
"@rainbow-me/rainbowkit": "0.12.15-canary.3",
"@rainbow-me/rainbowkit": "0.12.15",
"@reach/dialog": "^0.15.3",
"@reach/menu-button": "^0.15.3",
"@reach/tooltip": "^0.15.3",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Input/TxButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { getNetworkNiceNameByChainId } from '@pooltogether/utilities'
import {
TransactionState,
TransactionStatus,
useConnectWallet,
useIsWalletConnected,
useIsWalletOnChainId
} from '@pooltogether/wallet-connection'
import { useConnectModal } from '@rainbow-me/rainbowkit'
import { useTranslation } from 'next-i18next'
import React, { useMemo } from 'react'
import { useSwitchNetwork } from 'wagmi'
Expand Down Expand Up @@ -36,7 +36,7 @@ export const TxButton = (props: TxButtonProps) => {
...buttonProps
} = props
const isWalletConnected = useIsWalletConnected()
const connectWallet = useConnectWallet()
const { openConnectModal } = useConnectModal()
const { switchNetwork } = useSwitchNetwork()

const { t } = useTranslation()
Expand All @@ -53,7 +53,7 @@ export const TxButton = (props: TxButtonProps) => {
if (!!_connectWallet) {
return [t('connectWallet'), _connectWallet, 'button']
}
return [t('connectWallet'), connectWallet, 'button']
return [t('connectWallet'), openConnectModal, 'button']
} else if (status === TransactionStatus.pendingUserConfirmation) {
return [t('confirmInWallet'), () => null, 'button']
} else if (status === TransactionStatus.pendingBlockchainConfirmation) {
Expand All @@ -69,7 +69,7 @@ export const TxButton = (props: TxButtonProps) => {
isWalletOnProperNetwork,
_connectWallet,
t,
connectWallet,
openConnectModal,
networkName,
switchNetwork,
chainId,
Expand Down
5 changes: 4 additions & 1 deletion src/components/Modal/DepositModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
PrizePool
} from '@pooltogether/v4-client-js'
import { useTransaction } from '@pooltogether/wallet-connection'
import { useConnectModal } from '@rainbow-me/rainbowkit'
import { ApprovalType } from '@views/Deposit/DepositTrigger/DepositModal'
import { RSV } from 'eth-permit/dist/rpc'
import { useCallback, useEffect, useState } from 'react'
Expand Down Expand Up @@ -99,6 +100,8 @@ export const DepositModal: React.FC<{
setSelectedViewId(ViewIds.deposit)
}

const { openConnectModal } = useConnectModal()

return (
<BottomSheetWithViewState
snapPoints={snapToFull}
Expand Down Expand Up @@ -131,7 +134,7 @@ export const DepositModal: React.FC<{
// reviewView
sendDepositTransaction={sendDepositTransaction}
clearDepositTransaction={() => setDepositTransactionId('')}
connectWallet={() => setSelectedViewId(ViewIds.walletConnection)}
connectWallet={openConnectModal}
approvalType={approvalType}
setApprovalType={setApprovalType}
eip2612DepositPermit={eip2612DepositPermit}
Expand Down
8 changes: 6 additions & 2 deletions src/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ export const BRIDGE_URLS = Object.freeze({
{ url: 'https://app.optimism.io/bridge', title: 'Optimism bridge' },
{ url: 'https://wallet.polygon.technology/bridge', title: 'Polygon bridge' },
{ url: 'https://bridge.avax.network/', title: 'Avalanche bridge' },
{ url: 'https://bridge.arbitrum.io/', title: 'Arbitrum bridge' }
{ url: 'https://bridge.arbitrum.io/', title: 'Arbitrum bridge' },
{ url: 'https://across.to/bridge', title: 'Across bridge' }
// { url: 'https://zapper.fi/bridge', title: 'Zapper' },
// { url: 'https://app.hop.exchange/send?token=USDC', title: 'Hop Protocol' }
],
Expand All @@ -214,7 +215,10 @@ export const BRIDGE_URLS = Object.freeze({
// { url: 'https://app.hop.exchange/send?token=USDC', title: 'Hop Protocol' }
],
[CHAIN_ID.avalanche]: [{ url: 'https://bridge.avax.network/', title: 'Avalanche bridge' }],
[CHAIN_ID.optimism]: [{ url: 'https://app.optimism.io/bridge', title: 'Optimism bridge' }],
[CHAIN_ID.optimism]: [
{ url: 'https://app.optimism.io/bridge', title: 'Optimism bridge' },
{ url: 'https://across.to/bridge', title: 'Across bridge' }
],
[CHAIN_ID.arbitrum]: [{ url: 'https://bridge.arbitrum.io/', title: 'Arbitrum bridge' }]
})

Expand Down
4 changes: 0 additions & 4 deletions src/views/Account/V3DepositList/PrizePoolDepositView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
Transaction,
TransactionState,
TransactionStatus,
useConnectWallet,
useIsWalletConnected,
useTransaction,
useUsersAddress
} from '@pooltogether/wallet-connection'
Expand Down Expand Up @@ -162,8 +160,6 @@ const DepositFormView = (props: DepositFormViewProps) => {
const { chainId, ticket, token, amountToDeposit, form, depositTx, setReviewDepositView } = props

const { t } = useTranslation()
const connectWallet = useConnectWallet()
const isWalletConnected = useIsWalletConnected()

const {
handleSubmit,
Expand Down
5 changes: 4 additions & 1 deletion src/views/Deposit/DepositTrigger/DepositModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
PrizePool
} from '@pooltogether/v4-client-js'
import { useTransaction } from '@pooltogether/wallet-connection'
import { useConnectModal } from '@rainbow-me/rainbowkit'
import { RSV } from 'eth-permit/dist/rpc'
import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next'
Expand Down Expand Up @@ -83,6 +84,8 @@ export const DepositModal: React.FC<{

const { t } = useTranslation()

const { openConnectModal } = useConnectModal()

const views: ModalWithViewStateView[] = [
{
id: ViewIds.explore,
Expand Down Expand Up @@ -156,7 +159,7 @@ export const DepositModal: React.FC<{
// reviewView
sendDepositTransaction={sendDepositTransaction}
clearDepositTransaction={() => setDepositTransactionId('')}
connectWallet={() => setSelectedViewId(ViewIds.walletConnection)}
connectWallet={openConnectModal}
approvalType={approvalType}
setApprovalType={setApprovalType}
eip2612DepositPermit={eip2612DepositPermit}
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2607,10 +2607,10 @@
style-value-types "^3.1.7"
tslib "^1.10.0"

"@rainbow-me/[email protected]-canary.3":
version "0.12.15-canary.3"
resolved "https://registry.yarnpkg.com/@rainbow-me/rainbowkit/-/rainbowkit-0.12.15-canary.3.tgz#856b281f5fed5ed34026fa1c26e71df29867e92e"
integrity sha512-atPVgPty+WwKzAufXnuh+7LqwdsuW+cv8LPfwQXPVPEHSlFqaXLy8LFwOWwh0KpKY3rl+cpVnTBUmDKoXiqSoQ==
"@rainbow-me/[email protected]":
version "0.12.15"
resolved "https://registry.yarnpkg.com/@rainbow-me/rainbowkit/-/rainbowkit-0.12.15.tgz#b5c785ac1759a12fd3bdf58a94810c51e5cfeb5c"
integrity sha512-FL2EiH3Cr1Pjoda21cGexvcxzUGUB0eNojMeRpM5xu9tLVVGMwsaLLrmVztFRi77zcxTFzP5whbjo0LJb3r2bQ==
dependencies:
"@vanilla-extract/css" "1.9.1"
"@vanilla-extract/dynamic" "2.0.2"
Expand Down Expand Up @@ -4037,10 +4037,10 @@
abitype "^0.3.0"
eventemitter3 "^4.0.7"

"@wagmi/[email protected].14":
version "0.10.14"
resolved "https://registry.yarnpkg.com/@wagmi/core/-/core-0.10.14.tgz#5b07df06c5d5a29bcee76b1ad71695e88559955b"
integrity sha512-+iQj5YNdVQ/kLVpVMLmF71Y2vnW3ox4b4Na4S9fvQazGudhqfqfpQ+YPYmH6SIIuZ1VhRnBmjJIY88IZt/OkwA==
"@wagmi/[email protected].15":
version "0.10.15"
resolved "https://registry.yarnpkg.com/@wagmi/core/-/core-0.10.15.tgz#b9304bc0df07ebdddf6a9c26eef49825d4065964"
integrity sha512-rCrCVk28BxO8smLtBBnCZkvWFU1jI61x6DUidXAMagQ5yZdiDTr/YZpJzOkiR09fQCKq62INyRkJlRsk43SEoQ==
dependencies:
"@wagmi/chains" "0.2.22"
"@wagmi/connectors" "0.3.21"
Expand Down Expand Up @@ -15964,15 +15964,15 @@ w3c-xmlserializer@^2.0.0:
dependencies:
xml-name-validator "^3.0.0"

[email protected].16:
version "0.12.16"
resolved "https://registry.yarnpkg.com/wagmi/-/wagmi-0.12.16.tgz#4e5e2a29fd9d646b5a06e0ff8838be4d3459ed03"
integrity sha512-ZnQYC7wkcxNrfIZ+8LIYIXaEmnih8n4aUBZ5J+YI6QwnAWfo80jI79Z5F0BBML6wG7PYP2iIzMbIlnDIfx67uQ==
[email protected].17:
version "0.12.17"
resolved "https://registry.yarnpkg.com/wagmi/-/wagmi-0.12.17.tgz#ae6787acb747ddfc6d9da3335cec559c8051731e"
integrity sha512-0HArKpVI0nlek135d8LfrIQv38pzCSOZVVUOHGdPS8Mweypeb3niCAHbIjr5ERXhLsoZO8jf9eSUML6ErdXxog==
dependencies:
"@tanstack/query-sync-storage-persister" "^4.27.1"
"@tanstack/react-query" "^4.28.0"
"@tanstack/react-query-persist-client" "^4.28.0"
"@wagmi/core" "0.10.14"
"@wagmi/core" "0.10.15"
abitype "^0.3.0"
use-sync-external-store "^1.2.0"

Expand Down

0 comments on commit d7edd81

Please sign in to comment.