Skip to content

Commit 99e452a

Browse files
committed
Reorganize wallets/
* Move passphrase hooks into own file * Rename to draggable.js to dnd.js * Create wallets/lib/crypto.js * Move wallets/client/context stuff into ../hooks The distinction between context and hooks did not make sense. * Fix circular imports within wallets/client/hooks
1 parent dfe281d commit 99e452a

File tree

20 files changed

+472
-456
lines changed

20 files changed

+472
-456
lines changed

pages/_app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'nprogress/nprogress.css'
1919
import { ChainFeeProvider } from '@/components/chain-fee.js'
2020
import dynamic from 'next/dynamic'
2121
import { HasNewNotesProvider } from '@/components/use-has-new-notes'
22-
import WalletsProvider from '@/wallets/client/context'
22+
import { WalletsProvider } from '@/wallets/client/hooks'
2323
import FaviconProvider from '@/components/favicon'
2424

2525
const PWAPrompt = dynamic(() => import('react-ios-pwa-prompt'), { ssr: false })

pages/wallets/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { getGetServerSideProps } from '@/api/ssrApollo'
22
import { Button } from 'react-bootstrap'
3-
import { useWallets, useTemplates, DndProvider, KeyStatus, useWalletsLoading, useKeyError, useWalletsError } from '@/wallets/client/context'
3+
import {
4+
DndProvider, KeyStatus, useWallets, useTemplates, useWalletsLoading, useKeyError, useWalletsError,
5+
usePassphrasePrompt, useShowPassphrase, useSetWalletPriorities
6+
} from '@/wallets/client/hooks'
47
import { WalletCard, WalletLayout, WalletLayoutHeader, WalletLayoutLink, WalletLayoutSubHeader } from '@/wallets/client/components'
58
import styles from '@/styles/wallet.module.css'
6-
import { usePassphrasePrompt, useShowPassphrase, useSetWalletPriorities } from '@/wallets/client/hooks'
79
import { WalletSearch } from '@/wallets/client/components/search'
810
import { useMemo, useState } from 'react'
911
import { walletDisplayName } from '@/wallets/lib/util'

wallets/client/components/debug.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { formatBytes } from '@/lib/format'
22
import { useEffect, useState } from 'react'
3-
import { useKeyHash, useKeyUpdatedAt } from '@/wallets/client/context'
4-
import { useDiagnostics, useRemoteKeyHash, useRemoteKeyHashUpdatedAt, useWalletsUpdatedAt } from '@/wallets/client/hooks'
3+
import {
4+
useKeyHash, useKeyUpdatedAt, useDiagnostics, useRemoteKeyHash, useRemoteKeyHashUpdatedAt, useWalletsUpdatedAt
5+
} from '@/wallets/client/hooks'
56
import { timeSince } from '@/lib/time'
67

78
export function WalletDebugSettings () {

wallets/client/components/draggable.js renamed to wallets/client/components/dnd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useDndHandlers } from '@/wallets/client/context'
1+
import { useDndHandlers } from '@/wallets/client/hooks'
22
import classNames from 'classnames'
33
import styles from '@/styles/dnd.module.css'
44

wallets/client/components/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export * from './card'
2-
export * from './draggable'
2+
export * from './dnd'
33
export * from './form/index'
44
export * from './layout'
55
export * from './passphrase'

wallets/client/context/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

wallets/client/context/provider.js

Lines changed: 0 additions & 86 deletions
This file was deleted.

wallets/client/context/reducer.js

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)