Skip to content

Commit

Permalink
chore: useOutsideAlerter from @w3ux/hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Oct 26, 2024
1 parent 292a97f commit b35a094
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 44 deletions.
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@polkadot/rpc-provider": "12.0.2",
"@tanstack/react-query": "^5.53.3",
"@w3ux/extension-assets": "^0.3.1",
"@w3ux/hooks": "^1.1.0",
"@w3ux/hooks": "1.1.1",
"@w3ux/react-connect-kit": "^1.7.0",
"@w3ux/react-odometer": "^1.1.0",
"@w3ux/react-polkicon": "^1.3.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/app/src/contexts/WalletConnect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const WalletConnectProvider = ({
// Store whether the wallet connect session is active.
const [wcSessionActive, setWcSessionActive] = useState<boolean>(false);

// Store the set of chain ids the mot recent session is connected to.
// Store the set of chain ids the most recent session is connected to.
const sessionChains = useRef<Set<string>>(new Set());

// Init WalletConnect provider & modal, and update as wcInitialized.
Expand Down Expand Up @@ -106,6 +106,8 @@ export const WalletConnectProvider = ({
(chain) => `polkadot:${chain.genesisHash.substring(2).substring(0, 32)}`
);

console.log(caips);

// If there are no chains connected, return early.
if (!caips.length) {
return;
Expand Down
38 changes: 0 additions & 38 deletions packages/app/src/hooks/useOutsideAlerter/index.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/app/src/library/ConnectOverlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import { useEffect } from 'react';
import { Wrapper } from './Wrappers';
import { useOutsideAlerter } from 'hooks/useOutsideAlerter';
import { motion } from 'framer-motion';
import { TAB_TRANSITION_DURATION_MS } from 'contexts/Tabs/defaults';
import { useConnect } from 'contexts/Connect';
Expand All @@ -16,6 +15,7 @@ import { mobileCheck } from './Utils';
import extensions from '@w3ux/extension-assets';
import type { ExtensionArrayListItem } from '@w3ux/extension-assets/util';
import { useExtensions } from '@w3ux/react-connect-kit';
import { useOutsideAlerter } from '@w3ux/hooks';

export const ConnectOverlay = () => {
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/library/ContextMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { useEffect, useRef } from 'react';
import { useMenu } from 'contexts/Menu';
import { Wrapper } from './Wrappers';
import { useOutsideAlerter } from 'hooks/useOutsideAlerter';
import { useOutsideAlerter } from '@w3ux/hooks';
import { motion } from 'framer-motion';
import { TAB_TRANSITION_DURATION_MS } from 'contexts/Tabs/defaults';

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/library/SelectDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import type { SelectDropdownProps } from './types';
import { useEffect, useRef } from 'react';
import { useOutsideAlerter } from 'hooks/useOutsideAlerter';
import { useOutsideAlerter } from '@w3ux/hooks';
import { SelectDropdownWrapper } from 'library/Inputs/Wrappers';

export const SelectDropdown = ({
Expand Down
11 changes: 10 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ __metadata:
"@polkadot/rpc-provider": "npm:12.0.2"
"@tanstack/react-query": "npm:^5.53.3"
"@w3ux/extension-assets": "npm:^0.3.1"
"@w3ux/hooks": "npm:^1.1.0"
"@w3ux/hooks": "npm:1.1.1"
"@w3ux/react-connect-kit": "npm:^1.7.0"
"@w3ux/react-odometer": "npm:^1.1.0"
"@w3ux/react-polkicon": "npm:^1.3.0"
Expand Down Expand Up @@ -3957,6 +3957,15 @@ __metadata:
languageName: node
linkType: hard

"@w3ux/hooks@npm:1.1.1":
version: 1.1.1
resolution: "@w3ux/hooks@npm:1.1.1"
peerDependencies:
react: ^18
checksum: 10c0/abd315cd4cd5cb45f5dd73d1d661e82de64230d0c9b167d5cb64c768044efc9a52c7a2fe0a88cc951072b2295835738fae05abd1a8f9ac2e07cb811dba184375
languageName: node
linkType: hard

"@w3ux/hooks@npm:^1.1.0":
version: 1.1.0
resolution: "@w3ux/hooks@npm:1.1.0"
Expand Down

0 comments on commit b35a094

Please sign in to comment.