Skip to content

Commit

Permalink
feat: upgrade reef-knot
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeday committed Mar 14, 2024
1 parent 5780d14 commit fb863ad
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"react-hook-form": "^7.45.2",
"react-is": "^18.2.0",
"react-transition-group": "^4.4.2",
"reef-knot": "^2.1.1",
"reef-knot": "^3.0.0",
"remark": "^13.0.0",
"remark-external-links": "^8.0.0",
"remark-html": "^13.0.1",
Expand Down
2 changes: 2 additions & 0 deletions providers/web3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getStaticRpcBatchProvider } from '@lido-sdk/providers';
import { useClientConfig } from 'providers/client-config';
import { useGetRpcUrlByChainId } from 'config';
import { SDKLegacyProvider } from './sdk-legacy';
import { ConnectWalletModal } from 'shared/wallet/connect-wallet-modal';

const wagmiChainsArray = Object.values({ ...wagmiChains, holesky });

Expand Down Expand Up @@ -112,6 +113,7 @@ const Web3Provider: FC<PropsWithChildren> = ({ children }) => {
rpc={backendRPC}
>
{children}
<ConnectWalletModal />
</SDKLegacyProvider>
</ReefKnot>
</WagmiConfig>
Expand Down
4 changes: 1 addition & 3 deletions shared/wallet/connect-wallet-modal/connect-wallet-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { useThemeToggle } from '@lidofinance/lido-ui';
import { WalletsModalForEth } from 'reef-knot/connect-wallet-modal';
import { walletsMetrics } from 'config/matomoWalletsEvents';
import type { ModalComponentType } from 'providers/modal-provider';

export const ConnectWalletModal: ModalComponentType = (props) => {
export const ConnectWalletModal = () => {
const { themeName } = useThemeToggle();

return (
<WalletsModalForEth
{...props}
shouldInvertWalletIcon={themeName === 'dark'}
metrics={walletsMetrics}
/>
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions shared/wallet/connect/connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { Button, ButtonProps } from '@lidofinance/lido-ui';
import { wrapWithEventTrack } from '@lidofinance/analytics-matomo';
import { MATOMO_CLICK_EVENTS } from 'config';
import { useClientConfig } from 'providers/client-config';
import { useConnectWalletModal } from '../connect-wallet-modal/use-connect-wallet-modal';
import { useConnect } from 'reef-knot/core-react';

export const Connect: FC<ButtonProps> = (props) => {
const { isWalletConnectionAllowed } = useClientConfig();
const { onClick, ...rest } = props;
const { openModal } = useConnectWalletModal();
const { connect } = useConnect();

const handleClick = wrapWithEventTrack(
MATOMO_CLICK_EVENTS.connectWallet,
useCallback(() => {
if (!isWalletConnectionAllowed) return;
openModal({});
}, [isWalletConnectionAllowed, openModal]),
void connect();
}, [isWalletConnectionAllowed, connect]),
);

return (
Expand Down
38 changes: 19 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2559,10 +2559,10 @@
resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.24.tgz#58601079e11784d20f82d0585865bb42305c4df3"
integrity sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==

"@reef-knot/connect-wallet-modal@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@reef-knot/connect-wallet-modal/-/connect-wallet-modal-2.1.0.tgz#7f13d66f1bc5296ca84e33cf49cd23679de96857"
integrity sha512-1EKwEI+tcZ8wQVsZuAaXtEUyL+bVTnJyqEpvj8THHk16socm81k+GzoLMpBGXpqUzdiJ0iWd7jZnMdSaV/5wbg==
"@reef-knot/connect-wallet-modal@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@reef-knot/connect-wallet-modal/-/connect-wallet-modal-3.0.0.tgz#c5a2f45a1d92a5651998193e74e914eda2482f72"
integrity sha512-66cyINjohzRlrsYjQnR/NmLCUyPg3/LoofQfU3zUWwI+kx45d/PC4uDErB6Wy198h3OS81olepJvhcsPSysmQw==
dependencies:
"@ledgerhq/hw-app-eth" "^6.35.2"
"@ledgerhq/hw-transport" "^6.30.1"
Expand All @@ -2571,10 +2571,10 @@
"@types/react" "18.2.45"
"@types/react-dom" "18.2.17"

"@reef-knot/core-react@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@reef-knot/core-react/-/core-react-2.1.1.tgz#ee5bae446fe1d9b43c048ba3b73dd6a9cab491a1"
integrity sha512-wHacmKV636c9K0uIQJUUASaG3Cg2oNFJMef2N7mFfRyz4iO3GKhiAI/yISNkJYiU5I3AUmlDk+airbS61dfiwQ==
"@reef-knot/core-react@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@reef-knot/core-react/-/core-react-3.0.0.tgz#e15af52d05cfd9a32a4eb3ae7c2365facf01f99b"
integrity sha512-DUwZxmykiG95S2F7fLEoYtXEpDIxZVQRV4kT1O3DzxntSSn/Dlb3XV3BYE6qo0F/nbQpNeTLn+soDgyeN1yqBw==
dependencies:
ua-parser-js "1.0.33"

Expand Down Expand Up @@ -2726,10 +2726,10 @@
"@reef-knot/wallet-adapter-walletconnect" "1.2.4"
"@reef-knot/wallet-adapter-xdefi" "1.0.0"

"@reef-knot/web3-react@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@reef-knot/web3-react/-/web3-react-2.1.0.tgz#9a45b540e7b4cea3ec9632da4be41763b811cc6a"
integrity sha512-VVd3cAsZu9OXIz85lmrXnqWUtkFZ3GzEAWTF5OHAmD645BEWc4dJsqSNk899K6mcAVlxg2uRSjws1XkcWT0mpg==
"@reef-knot/web3-react@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@reef-knot/web3-react/-/web3-react-3.0.0.tgz#5550f6b0c43646c110eff20bb51795789910ede4"
integrity sha512-hiEVEe2BZxWi+PmSzMq5IUux6QZ0T2LKbHteKhb941/ABivLXJ71sSpkxVSKJfVSzXTX7PMWRwoGkDaEqmHz7Q==
dependencies:
tiny-invariant "^1.1.0"

Expand Down Expand Up @@ -9218,19 +9218,19 @@ redis-parser@^3.0.0:
dependencies:
redis-errors "^1.0.0"

reef-knot@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/reef-knot/-/reef-knot-2.1.1.tgz#cd90e9276aa351671a4516515895a88d52b21790"
integrity sha512-l9OHDOg7sWcZkql+3CF1DRAFBuWAZuP1CLFRq2CHJ3oNRsJC7+EFU8YNrvggtqSRM/FlKXI63vIl18ngAtpN/Q==
reef-knot@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/reef-knot/-/reef-knot-3.0.0.tgz#8bda612ca565b797c9170a0bd951b15c99bf8e8d"
integrity sha512-oZ1932d9lugGVeKkI8o6H1WzteErJn0Q9FafTT6f8jPPMCnRGMvltbs+8GmlAdH+x1DX06i22YVVHBgAIFgiBA==
dependencies:
"@reef-knot/connect-wallet-modal" "2.1.0"
"@reef-knot/core-react" "2.1.1"
"@reef-knot/connect-wallet-modal" "3.0.0"
"@reef-knot/core-react" "3.0.0"
"@reef-knot/ledger-connector" "3.0.0"
"@reef-knot/types" "1.5.0"
"@reef-knot/ui-react" "1.0.8"
"@reef-knot/wallets-helpers" "1.1.5"
"@reef-knot/wallets-list" "1.12.0"
"@reef-knot/web3-react" "2.1.0"
"@reef-knot/web3-react" "3.0.0"

reflect.getprototypeof@^1.0.4:
version "1.0.4"
Expand Down

0 comments on commit fb863ad

Please sign in to comment.