Skip to content

Commit

Permalink
chore: import DialogHeader from monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Aug 1, 2024
1 parent 796b79d commit 21b14c4
Show file tree
Hide file tree
Showing 30 changed files with 63 additions and 97 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"@leather.io/models": "0.10.2",
"@leather.io/query": "2.1.0",
"@leather.io/tokens": "0.7.0",
"@leather.io/ui": "1.9.0",
"@leather.io/ui": "1.9.2",
"@leather.io/utils": "0.11.0",
"@ledgerhq/hw-transport-webusb": "6.27.19",
"@noble/hashes": "1.4.0",
Expand Down
39 changes: 33 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

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

import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';

export function BroadcastErrorDialog() {
const navigate = useNavigate();
Expand Down
36 changes: 0 additions & 36 deletions src/app/components/layout/dialog-header.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions src/app/features/container/headers/popup.header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ interface PopupHeaderProps {
export function PopupHeader({ showSwitchAccount, balance }: PopupHeaderProps) {
const { isShowingSwitchAccount, setIsShowingSwitchAccount } =
useOutletContext<SwitchAccountOutletContext>();

// Popup switch account not showing anything now

return (
<Header>
<HeaderGrid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import { useLocation, useNavigate } from 'react-router-dom';
import { useFormikContext } from 'formik';
import { Stack, styled } from 'leather-styles/jsx';

import { Dialog, Link } from '@leather.io/ui';
import { Dialog, DialogHeader, 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 { DialogHeader } from '@app/components/layout/dialog-header';

import { EditNonceForm } from './components/edit-nonce-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Formik } from 'formik';
import { Flex, Stack } from 'leather-styles/jsx';

import type { BitcoinTx } from '@leather.io/models';
import { Caption, Dialog, Spinner } from '@leather.io/ui';
import { Caption, Dialog, DialogHeader, Spinner } from '@leather.io/ui';
import { btcToSat, createMoney, formatMoney } from '@leather.io/utils';

import { RouteUrls } from '@shared/route-urls';
Expand All @@ -15,7 +15,6 @@ import { getBitcoinTxValue } from '@app/common/transactions/bitcoin/utils';
import { BitcoinCustomFeeInput } from '@app/components/bitcoin-custom-fee/bitcoin-custom-fee-input';
import { BitcoinTransactionItem } from '@app/components/bitcoin-transaction-item/bitcoin-transaction-item';
import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';
import { useBtcCryptoAssetBalanceNativeSegwit } from '@app/query/bitcoin/balance/btc-balance-native-segwit.hooks';
import { useCurrentAccountNativeSegwitIndexZeroSigner } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useStacksRawTransaction,
useStxAvailableUnlockedBalance,
} from '@leather.io/query';
import { Caption, Dialog, Spinner } from '@leather.io/ui';
import { Caption, Dialog, DialogHeader, Spinner } from '@leather.io/ui';
import { microStxToStx, stxToMicroStx } from '@leather.io/utils';

import { RouteUrls } from '@shared/route-urls';
Expand All @@ -22,7 +22,6 @@ import { stacksValue } from '@app/common/stacks-utils';
import { safelyFormatHexTxid } from '@app/common/utils/safe-handle-txid';
import { stxFeeValidator } from '@app/common/validation/forms/fee-validators';
import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';
import { LoadingSpinner } from '@app/components/loading-spinner';
import { StacksTransactionItem } from '@app/components/stacks-transaction-item/stacks-transaction-item';
import { useStacksBroadcastTransaction } from '@app/features/stacks-transaction-request/hooks/use-stacks-broadcast-transaction';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { Virtuoso } from 'react-virtuoso';

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

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

import { useCreateAccount } from '@app/common/hooks/account/use-create-account';
import { useWalletType } from '@app/common/use-wallet-type';
import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';
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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +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 { Dialog, DialogHeader } from '@leather.io/ui';
import { delay, isError } from '@leather.io/utils';

import { finalizeAuthResponse } from '@shared/actions/finalize-auth-response';
Expand All @@ -17,7 +17,6 @@ import { useDefaultRequestParams } from '@app/common/hooks/use-default-request-s
import { useKeyActions } from '@app/common/hooks/use-key-actions';
import { useScrollLock } from '@app/common/hooks/use-scroll-lock';
import { makeLedgerCompatibleUnsignedAuthResponsePayload } from '@app/common/unsafe-auth-response';
import { DialogHeader } from '@app/components/layout/dialog-header';
import { useCancelLedgerAction } from '@app/features/ledger/utils/generic-ledger-utils';
import {
getStacksAppVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { bytesToHex, signatureVrsToRsv } from '@stacks/common';
import { serializeCV } from '@stacks/transactions';
import { LedgerError } from '@zondax/ledger-stacks';

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

import { UnsignedMessage, whenSignableMessageOfType } from '@shared/signature/signature-types';

import { useScrollLock } from '@app/common/hooks/use-scroll-lock';
import { appEvents } from '@app/common/publish-subscribe';
import { DialogHeader } from '@app/components/layout/dialog-header';
import { useCancelLedgerAction } from '@app/features/ledger/utils/generic-ledger-utils';
import {
getStacksAppVersion,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Outlet } from 'react-router-dom';

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

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

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

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

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

import { LedgerTxSigningContext, LedgerTxSigningProvider } from './ledger-sign-tx.context';

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

import { Dialog } from '@leather.io/ui';
import { Dialog, DialogHeader } 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 { DialogHeader } from '@app/components/layout/dialog-header';

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

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

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

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

import { LedgerTitle } from '../../components/ledger-title';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Flex, styled } from 'leather-styles/jsx';

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

import { Card, Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';

interface RetrieveTaprootToNativeSegwitLayoutProps {
isBroadcasting: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/app/features/settings/network/network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { useNavigate } from 'react-router-dom';
import { SettingsSelectors } from '@tests/selectors/settings.selectors';

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

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

import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';
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';
Expand Down
3 changes: 1 addition & 2 deletions src/app/features/settings/sign-out/sign-out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { SettingsSelectors } from '@tests/selectors/settings.selectors';
import { useFormik } from 'formik';
import { Flex, HStack, styled } from 'leather-styles/jsx';

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

import { useWalletType } from '@app/common/use-wallet-type';
import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';

interface SignOutDialogProps {
isShowing: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/app/features/settings/theme/theme-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useCallback } from 'react';

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

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

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

import { ThemeListItem } from './theme-list-item';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { SendCryptoAssetSelectors } from '@tests/selectors/send.selectors';
import { useFormikContext } from 'formik';
import { HStack, Stack } from 'leather-styles/jsx';

import { Button, Caption, Dialog, ErrorIcon, Link, Title } from '@leather.io/ui';
import { Button, Caption, Dialog, DialogHeader, 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 { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';

import { useStacksHighFeeWarningContext } from './stacks-high-fee-warning-container';

Expand Down
3 changes: 1 addition & 2 deletions src/app/pages/receive/components/receive-tokens.layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import { SharedComponentsSelectors } from '@tests/selectors/shared-component.sel
import { Box, Flex, styled } from 'leather-styles/jsx';
import { token } from 'leather-styles/tokens';

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

import { useLocationState } from '@app/common/hooks/use-location-state';
import { Footer } from '@app/components/layout';
import { DialogHeader } from '@app/components/layout/dialog-header';
import { useBackgroundLocationRedirect } from '@app/routes/hooks/use-background-location-redirect';

interface ReceiveTokensLayoutProps {
Expand Down
3 changes: 1 addition & 2 deletions src/app/pages/receive/receive-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import { HomePageSelectors } from '@tests/selectors/home.selectors';
import { Box } from 'leather-styles/jsx';
import get from 'lodash.get';

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

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

import { useLocationState } from '@app/common/hooks/use-location-state';
import { DialogHeader } from '@app/components/layout/dialog-header';
import { useBackgroundLocationRedirect } from '@app/routes/hooks/use-background-location-redirect';
import { useZeroIndexTaprootAddress } from '@app/store/accounts/blockchain/bitcoin/bitcoin.hooks';
import { useCurrentAccountNativeSegwitAddressIndexZero } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
Expand Down
Loading

0 comments on commit 21b14c4

Please sign in to comment.