Skip to content

Commit

Permalink
fix: use dialog from monorepo, ref leather-io/issues#108
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Jun 27, 2024
1 parent 53d1e6c commit de2b5a0
Show file tree
Hide file tree
Showing 29 changed files with 123 additions and 269 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"@leather.io/models": "0.10.0",
"@leather.io/query": "0.9.1",
"@leather.io/tokens": "0.6.0",
"@leather.io/ui": "1.5.0",
"@leather.io/ui": "1.5.1",
"@leather.io/utils": "0.9.0",
"@ledgerhq/hw-transport-webusb": "6.27.19",
"@noble/hashes": "1.4.0",
Expand Down
151 changes: 78 additions & 73 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import GenericError from '@assets/images/generic-error.png';
import { Flex, styled } from 'leather-styles/jsx';
import get from 'lodash.get';

import { Button } from '@leather.io/ui';
import { Button, Dialog } from '@leather.io/ui';

import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useCallback, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';

import { Dialog, Link } from '@leather.io/ui';
import { useFormikContext } from 'formik';
import { Stack, styled } from 'leather-styles/jsx';

import { Link } from '@leather.io/ui';

import { StacksSendFormValues, StacksTransactionFormValues } from '@shared/models/form.model';

import { useOnMount } from '@app/common/hooks/use-on-mount';
import { openInNewTab } from '@app/common/utils/open-in-new-tab';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { EditNonceForm } from './components/edit-nonce-form';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Suspense } from 'react';
import { Outlet, useLocation, useNavigate } from 'react-router-dom';

import { Formik } from 'formik';
import { Flex, Stack } from 'leather-styles/jsx';

import type { BitcoinTx } from '@leather.io/models';
import { Caption, Spinner } from '@leather.io/ui';
import { Caption, Dialog, Spinner } from '@leather.io/ui';
import { btcToSat, createMoney, formatMoney } from '@leather.io/utils';
import { Formik } from 'formik';
import { Flex, Stack } from 'leather-styles/jsx';

import { RouteUrls } from '@shared/route-urls';

Expand All @@ -16,7 +15,6 @@ import { BitcoinCustomFeeInput } from '@app/components/bitcoin-custom-fee/bitcoi
import { BitcoinTransactionItem } from '@app/components/bitcoin-transaction-item/bitcoin-transaction-item';
import { useBtcCryptoAssetBalanceNativeSegwit } from '@app/query/bitcoin/balance/btc-balance-native-segwit.hooks';
import { useCurrentAccountNativeSegwitIndexZeroSigner } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { Suspense, useCallback, useEffect } from 'react';
import { Outlet, useLocation, useNavigate, useParams } from 'react-router-dom';

import { type StacksTransaction } from '@stacks/transactions';
import BigNumber from 'bignumber.js';
import { Formik } from 'formik';
import { Flex, Stack } from 'leather-styles/jsx';
import * as yup from 'yup';

import {
useStacksRawTransaction,
useStxAvailableUnlockedBalance,
useTransactionById,
} from '@leather.io/query';
import { Caption, Spinner } from '@leather.io/ui';
import { Caption, Dialog, Spinner } from '@leather.io/ui';
import { microStxToStx, stxToMicroStx } from '@leather.io/utils';
import { type StacksTransaction } from '@stacks/transactions';
import BigNumber from 'bignumber.js';
import { Formik } from 'formik';
import { Flex, Stack } from 'leather-styles/jsx';
import * as yup from 'yup';

import { RouteUrls } from '@shared/route-urls';

Expand All @@ -27,7 +26,6 @@ import { useStacksBroadcastTransaction } from '@app/features/stacks-transaction-
import { useToast } from '@app/features/toasts/use-toast';
import { useCurrentStacksAccountAddress } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { useSubmittedTransactionsActions } from '@app/store/submitted-transactions/submitted-transactions.hooks';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { memo } from 'react';
import { Virtuoso } from 'react-virtuoso';

import { Button, Dialog } from '@leather.io/ui';
import { Box } from 'leather-styles/jsx';

import { Button } from '@leather.io/ui';

import { useCreateAccount } from '@app/common/hooks/account/use-create-account';
import { useWalletType } from '@app/common/use-wallet-type';
import { useCurrentAccountIndex } from '@app/store/accounts/account';
import { useFilteredBitcoinAccounts } from '@app/store/accounts/blockchain/bitcoin/bitcoin.ledger';
import { useStacksAccounts } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';
import { VirtuosoWrapper } from '@app/ui/components/virtuoso';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TransactionVersion, getAddressFromPublicKey } from '@stacks/transaction
import { LedgerError } from '@zondax/ledger-stacks';
import get from 'lodash.get';

import { Dialog } from '@leather.io/ui';
import { delay, isError } from '@leather.io/utils';

import { finalizeAuthResponse } from '@shared/actions/finalize-auth-response';
Expand All @@ -25,7 +26,6 @@ import {
useCurrentStacksAccount,
useStacksAccounts,
} from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { useLedgerNavigate } from '../../hooks/use-ledger-navigate';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { bytesToHex, signatureVrsToRsv } from '@stacks/common';
import { serializeCV } from '@stacks/transactions';
import { LedgerError } from '@zondax/ledger-stacks';

import { Dialog } from '@leather.io/ui';
import { delay, isError } from '@leather.io/utils';

import { UnsignedMessage, whenSignableMessageOfType } from '@shared/signature/signature-types';
Expand All @@ -20,7 +21,6 @@ import {
} from '@app/features/ledger/utils/stacks-ledger-utils';
import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { StacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.models';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { useLedgerAnalytics } from '../../hooks/use-ledger-analytics.hook';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Outlet } from 'react-router-dom';

import { Dialog } from '@leather.io/ui';

import { useScrollLock } from '@app/common/hooks/use-scroll-lock';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { useLedgerNavigate } from '../../hooks/use-ledger-navigate';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Outlet } from 'react-router-dom';

import { Dialog } from '@leather.io/ui';

import { useScrollLock } from '@app/common/hooks/use-scroll-lock';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { LedgerTxSigningContext, LedgerTxSigningProvider } from './ledger-sign-tx.context';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useNavigate } from 'react-router-dom';

import { Dialog } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';
import { closeWindow } from '@shared/utils';

import { doesBrowserSupportWebUsbApi, whenPageMode } from '@app/common/utils';
import { openIndexPageInNewTab } from '@app/common/utils/open-in-new-tab';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { immediatelyAttemptLedgerConnection } from '../../hooks/use-when-reattempt-ledger-connection';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { useNavigate } from 'react-router-dom';

import { Dialog, Link } from '@leather.io/ui';
import { styled } from 'leather-styles/jsx';

import { Link } from '@leather.io/ui';

import { UnsupportedBrowserImg } from '@app/features/ledger/illustrations/ledger-illu-unsupported-browser';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { LedgerTitle } from '../../components/ledger-title';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { BtcAvatarIcon, Button, Callout, Dialog } from '@leather.io/ui';
import { Flex, styled } from 'leather-styles/jsx';

import { BtcAvatarIcon, Button, Callout } from '@leather.io/ui';

import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';
import { Card } from '@app/ui/layout/card/card';
Expand Down
6 changes: 2 additions & 4 deletions src/app/features/settings/network/network.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { useNavigate } from 'react-router-dom';

import { SettingsSelectors } from '@tests/selectors/settings.selectors';

import { WalletDefaultNetworkConfigurationIds } from '@leather.io/models';
import { Button } from '@leather.io/ui';
import { Button, Dialog } from '@leather.io/ui';
import { SettingsSelectors } from '@tests/selectors/settings.selectors';

import { RouteUrls } from '@shared/route-urls';
import { analytics } from '@shared/utils/analytics';

import { NetworkListItem } from '@app/features/settings/network/network-list-item';
import { useCurrentNetworkState, useNetworksActions } from '@app/store/networks/networks.hooks';
import { useNetworks } from '@app/store/networks/networks.selectors';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

Expand Down
6 changes: 3 additions & 3 deletions src/app/features/settings/sign-out/sign-out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { SettingsSelectors } from '@tests/selectors/settings.selectors';
import { useFormik } from 'formik';
import { Flex, HStack, styled } from 'leather-styles/jsx';

import { Button, Callout } from '@leather.io/ui';
import { Button, Callout, Dialog } from '@leather.io/ui';

import { useWalletType } from '@app/common/use-wallet-type';
import { Dialog, DialogProps } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

interface SignOutDialogProps extends DialogProps {
interface SignOutDialogProps {
isShowing: boolean;
onUserDeleteWallet(): void;
onClose(): void;
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/features/settings/theme/theme-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useCallback } from 'react';

import { Dialog } from '@leather.io/ui';

import { analytics } from '@shared/utils/analytics';

import { UserSelectedTheme, themeLabelMap, useThemeSwitcher } from '@app/common/theme-provider';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { ThemeListItem } from './theme-list-item';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Button, Caption, Dialog, ErrorIcon, Link, Title } from '@leather.io/ui';
import { SendCryptoAssetSelectors } from '@tests/selectors/send.selectors';
import { useFormikContext } from 'formik';
import { HStack, Stack } from 'leather-styles/jsx';

import { Button, Caption, ErrorIcon, Link, Title } from '@leather.io/ui';

import { StacksSendFormValues } from '@shared/models/form.model';

import { openInNewTab } from '@app/common/utils/open-in-new-tab';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

Expand Down
4 changes: 1 addition & 3 deletions src/app/pages/receive/components/receive-tokens.layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import QRCode from 'react-qr-code';
import { useNavigate } from 'react-router-dom';

import { AddressDisplayer, Button, Dialog } from '@leather.io/ui';
import { SharedComponentsSelectors } from '@tests/selectors/shared-component.selectors';
import { Box, Flex, styled } from 'leather-styles/jsx';
import { token } from 'leather-styles/tokens';

import { AddressDisplayer, Button } from '@leather.io/ui';

import { useLocationState } from '@app/common/hooks/use-location-state';
import { useBackgroundLocationRedirect } from '@app/routes/hooks/use-background-location-redirect';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { Header } from '@app/ui/components/containers/headers/header';

Expand Down
4 changes: 1 addition & 3 deletions src/app/pages/receive/receive-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useLocation, useNavigate } from 'react-router-dom';

import { Dialog, Tabs } from '@leather.io/ui';
import { HomePageSelectors } from '@tests/selectors/home.selectors';
import { Box } from 'leather-styles/jsx';
import get from 'lodash.get';

import { Tabs } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';
import { analytics } from '@shared/utils/analytics';

Expand All @@ -14,7 +13,6 @@ import { useBackgroundLocationRedirect } from '@app/routes/hooks/use-background-
import { useZeroIndexTaprootAddress } from '@app/store/accounts/blockchain/bitcoin/bitcoin.hooks';
import { useCurrentAccountNativeSegwitAddressIndexZero } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
import { useCurrentStacksAccountAddress } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Header } from '@app/ui/components/containers/headers/header';

import { ReceiveCollectibles } from './components/receive-collectibles';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState } from 'react';
import { Outlet, useNavigate } from 'react-router-dom';

import type { BtcFeeType } from '@leather.io/models';
import { Dialog } from '@leather.io/ui';
import { createMoney } from '@leather.io/utils';

import { RouteUrls } from '@shared/route-urls';
Expand All @@ -13,7 +14,6 @@ import {
import { LoadingSpinner } from '@app/components/loading-spinner';
import { BitcoinChooseFee } from '@app/features/bitcoin-choose-fee/bitcoin-choose-fee';
import { useValidateBitcoinSpend } from '@app/features/bitcoin-choose-fee/hooks/use-validate-bitcoin-spend';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

import { useSendInscriptionState } from './components/send-inscription-container';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useNavigate } from 'react-router-dom';

import { Button, Dialog, OrdinalAvatarIcon } from '@leather.io/ui';
import { Form, Formik } from 'formik';
import { Box, Flex } from 'leather-styles/jsx';

import { Button, OrdinalAvatarIcon } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';

import { ErrorLabel } from '@app/components/error-label';
import { InscriptionPreview } from '@app/components/inscription-preview-card/components/inscription-preview';
import { InscriptionPreviewCard } from '@app/components/inscription-preview-card/inscription-preview-card';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useLocation, useNavigate } from 'react-router-dom';

import { useBitcoinBroadcastTransaction } from '@leather.io/query';
import { Button, Dialog } from '@leather.io/ui';
import { bytesToHex } from '@noble/hashes/utils';
import { Box, Flex, Stack } from 'leather-styles/jsx';
import get from 'lodash.get';

import { useBitcoinBroadcastTransaction } from '@leather.io/query';
import { Button } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';
import { analytics } from '@shared/utils/analytics';

Expand All @@ -16,7 +15,6 @@ import { InscriptionPreview } from '@app/components/inscription-preview-card/com
import { useCurrentNativeSegwitUtxos } from '@app/query/bitcoin/address/utxos-by-address.hooks';
import { useAppDispatch } from '@app/store';
import { inscriptionSent } from '@app/store/ordinals/ordinals.slice';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';
import { Card } from '@app/ui/layout/card/card';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useLocation, useNavigate } from 'react-router-dom';

import type { Blockchains, Inscription } from '@leather.io/models';
import { CheckmarkIcon, CopyIcon, Dialog, ExternalLinkIcon } from '@leather.io/ui';
import { Box, Flex, HStack, Stack } from 'leather-styles/jsx';
import get from 'lodash.get';

import type { Blockchains, Inscription } from '@leather.io/models';
import { CheckmarkIcon, CopyIcon, ExternalLinkIcon } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';
import { analytics } from '@shared/utils/analytics';

Expand All @@ -15,7 +14,6 @@ import { FormAddressDisplayer } from '@app/components/address-displayer/form-add
import { InfoCardBtn, InfoCardRow, InfoCardSeparator } from '@app/components/info-card/info-card';
import { InscriptionPreview } from '@app/components/inscription-preview-card/components/inscription-preview';
import { useToast } from '@app/features/toasts/use-toast';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';
import { Card } from '@app/ui/layout/card/card';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { Virtuoso } from 'react-virtuoso';

import { Box } from 'leather-styles/jsx';

import { Dialog } from '@leather.io/ui';

import { useFilteredBitcoinAccounts } from '@app/store/accounts/blockchain/bitcoin/bitcoin.ledger';
import { useStacksAccounts } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header';
import { VirtuosoWrapper } from '@app/ui/components/virtuoso';

Expand Down
Loading

0 comments on commit de2b5a0

Please sign in to comment.