From 21b14c440a8363af59394f9fb9d434fe709f3376 Mon Sep 17 00:00:00 2001 From: Pete Watters <2938440+pete-watters@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:57:44 +0100 Subject: [PATCH] chore: import DialogHeader from monorepo --- package.json | 2 +- pnpm-lock.yaml | 39 ++++++++++++++++--- .../broadcast-error-dialog.tsx | 3 +- src/app/components/layout/dialog-header.tsx | 36 ----------------- .../container/headers/popup.header.tsx | 3 ++ .../edit-nonce-dialog/edit-nonce-dialog.tsx | 3 +- .../increase-btc-fee-dialog.tsx | 3 +- .../increase-stx-fee-dialog.tsx | 3 +- .../switch-account-dialog.tsx | 3 +- .../jwt-signing/ledger-sign-jwt-container.tsx | 3 +- .../ledger-stacks-sign-msg-container.tsx | 3 +- .../request-keys/request-keys-flow.tsx | 3 +- .../tx-signing/tx-signing-flow.tsx | 3 +- .../connect-device/connect-ledger-start.tsx | 3 +- .../unsupported-browser.layout.tsx | 3 +- ...trieve-taproot-to-native-segwit.layout.tsx | 3 +- src/app/features/settings/network/network.tsx | 3 +- .../features/settings/sign-out/sign-out.tsx | 3 +- .../features/settings/theme/theme-dialog.tsx | 3 +- .../stacks-high-fee-dialog.tsx | 3 +- .../components/receive-tokens.layout.tsx | 3 +- src/app/pages/receive/receive-dialog.tsx | 3 +- .../send/broadcast-error/broadcast-error.tsx | 3 +- .../send-inscription-choose-fee.tsx | 3 +- .../send-inscription-form.tsx | 3 +- .../send-inscription-review.tsx | 3 +- .../sent-inscription-summary.tsx | 3 +- .../recipient-accounts-dialog.tsx | 3 +- .../swap-asset-dialog-base.tsx | 4 +- .../swap-asset-dialog-quote.tsx | 4 +- 30 files changed, 63 insertions(+), 97 deletions(-) delete mode 100644 src/app/components/layout/dialog-header.tsx diff --git a/package.json b/package.json index f89f677463e..fb99755a788 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28a3535bae4..6a86d3d5abb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,8 +52,8 @@ importers: specifier: 0.7.0 version: 0.7.0 '@leather.io/ui': - specifier: 1.9.0 - version: 1.9.0(@babel/core@7.24.9)(@babel/preset-env@7.24.8(@babel/core@7.24.9))(@swc/core@1.7.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.7.0)(@types/node@20.12.12)(typescript@5.4.5))(typescript@5.4.5) + specifier: 1.9.2 + version: 1.9.2(@babel/core@7.24.9)(@babel/preset-env@7.24.8(@babel/core@7.24.9))(@swc/core@1.7.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.7.0)(@types/node@20.12.12)(typescript@5.4.5))(typescript@5.4.5) '@leather.io/utils': specifier: 0.11.0 version: 0.11.0 @@ -2613,6 +2613,9 @@ packages: '@leather.io/models@0.10.2': resolution: {integrity: sha512-N4KTT0jApIZphx96/abD0xwA+4A23k+hmPWsf98N2LKxG5ZzYmuzoB5VUlw7hGdwpZFbDW625ALQjjPMPoyG8A==} + '@leather.io/models@0.11.0': + resolution: {integrity: sha512-iKhEno6aVhFKvsnsMKbHQYXIqEGo4TOkJcPs/4yHq2EZmPEMFk8FMxUNZZKcKnVSxedInjzFaFhYF/sz+tTxjQ==} + '@leather.io/panda-preset@0.3.4': resolution: {integrity: sha512-q+ri1ObAPe0GsYWKZe/5AWjSwH1lEgRnBn5NIVE7OJUt8eXa1vQuXMeXFLmY+UU7dhVYSY148RU+SNiRl1DfSw==} @@ -2627,15 +2630,21 @@ packages: '@leather.io/rpc@2.1.1': resolution: {integrity: sha512-rAoPxiooffpbF9mtpSleA8Y5O9WZS6VEvGFYDLQPkt3JxAEm0+cVykDYypJWbrnMAqKNL3FVSSnR2TDtsZ8GiA==} + '@leather.io/rpc@2.1.2': + resolution: {integrity: sha512-Smv00bOQF3Suju3peJWAywpFjTurLg+GZgKi7uymKHfkXhnrUmOxYkXKE1azac8E4MardseZIP7jjGU/hgmFnQ==} + '@leather.io/tokens@0.7.0': resolution: {integrity: sha512-RLF8enOE+t/KdcTjjyQUf6rMEyxLb/PPMYZgvoT/FWoQgnjYluhG6zc1HROu7wM8XEBF4kESABIM6UYKtkAs1Q==} - '@leather.io/ui@1.9.0': - resolution: {integrity: sha512-KNfjqsULmj9S697oh4eGkmGBNiEDXl3vH9Ghddv+RcN2IwuWA8ulNbp8C268HyI/PWhBdm3sbM2LMRXpf9qDSA==} + '@leather.io/ui@1.9.2': + resolution: {integrity: sha512-Aeuz49O9HicqQ00KVFD4gq8kzASzc8Izlw+yWdP2rQNTaENEuA5qIrDblm4WUC4OBaqhIm2m7SUMmfO34r3P0A==} '@leather.io/utils@0.11.0': resolution: {integrity: sha512-/i1auGETc6WlPCdukbkMKtMUsliDQwUZ/YNJ8noCjXkZTGKvecvH8VXt+nY3lnqUSAigCfSTMk/c8CGLFUJkxQ==} + '@leather.io/utils@0.11.1': + resolution: {integrity: sha512-uRwWihcI0U/QUCheAr9TwKa9NvUb7HB5vtIpiCpYKDeGmjer4lvvIcPvyPxm5G0/ccB/umtqni9nK5EtwJJ6vA==} + '@ledgerhq/devices@8.4.0': resolution: {integrity: sha512-TUrMlWZJ+5AFp2lWMw4rGQoU+WtjIqlFX5SzQDL9phaUHrt4TFierAGHsaj5+tUHudhD4JhIaLI2cn1NOyq5NQ==} @@ -17249,6 +17258,12 @@ snapshots: '@stacks/stacks-blockchain-api-types': 7.8.2 bignumber.js: 9.1.2 + '@leather.io/models@0.11.0': + dependencies: + '@stacks/stacks-blockchain-api-types': 7.8.2 + bignumber.js: 9.1.2 + zod: 3.23.6 + '@leather.io/panda-preset@0.3.4(jsdom@22.1.0)(typescript@5.4.5)': dependencies: '@pandacss/dev': 0.40.1(jsdom@22.1.0)(typescript@5.4.5) @@ -17302,13 +17317,18 @@ snapshots: '@leather.io/models': 0.10.2 zod: 3.23.6 + '@leather.io/rpc@2.1.2': + dependencies: + '@leather.io/models': 0.11.0 + zod: 3.23.6 + '@leather.io/tokens@0.7.0': {} - '@leather.io/ui@1.9.0(@babel/core@7.24.9)(@babel/preset-env@7.24.8(@babel/core@7.24.9))(@swc/core@1.7.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.7.0)(@types/node@20.12.12)(typescript@5.4.5))(typescript@5.4.5)': + '@leather.io/ui@1.9.2(@babel/core@7.24.9)(@babel/preset-env@7.24.8(@babel/core@7.24.9))(@swc/core@1.7.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.7.0)(@types/node@20.12.12)(typescript@5.4.5))(typescript@5.4.5)': dependencies: '@expo/vector-icons': 14.0.0 '@leather.io/tokens': 0.7.0 - '@leather.io/utils': 0.11.0 + '@leather.io/utils': 0.11.1 '@radix-ui/react-accessible-icon': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@radix-ui/react-accordion': 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@radix-ui/react-avatar': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -17359,6 +17379,13 @@ snapshots: '@leather.io/rpc': 2.1.1 bignumber.js: 9.1.2 + '@leather.io/utils@0.11.1': + dependencies: + '@leather.io/constants': 0.8.2 + '@leather.io/models': 0.11.0 + '@leather.io/rpc': 2.1.2 + bignumber.js: 9.1.2 + '@ledgerhq/devices@8.4.0': dependencies: '@ledgerhq/errors': 6.17.0 diff --git a/src/app/components/broadcast-error-dialog/broadcast-error-dialog.tsx b/src/app/components/broadcast-error-dialog/broadcast-error-dialog.tsx index 1bd742258f1..3d84c8a4f92 100644 --- a/src/app/components/broadcast-error-dialog/broadcast-error-dialog.tsx +++ b/src/app/components/broadcast-error-dialog/broadcast-error-dialog.tsx @@ -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(); diff --git a/src/app/components/layout/dialog-header.tsx b/src/app/components/layout/dialog-header.tsx deleted file mode 100644 index 4fed3c77c90..00000000000 --- a/src/app/components/layout/dialog-header.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { ReactNode } from 'react'; - -import { Flex, styled } from 'leather-styles/jsx'; - -import { CloseIcon, IconButton } from '@leather.io/ui'; - -interface DialogHeaderProps { - onClose?(): void; - title?: ReactNode; - variant?: 'default' | 'large'; -} - -export function DialogHeader({ onClose, title, variant = 'default' }: DialogHeaderProps) { - return ( - - {title && ( - - {title} - - )} - {onClose && } onClick={onClose} position="absolute" />} - - ); -} diff --git a/src/app/features/container/headers/popup.header.tsx b/src/app/features/container/headers/popup.header.tsx index c29a71c5d6f..324e24d0156 100644 --- a/src/app/features/container/headers/popup.header.tsx +++ b/src/app/features/container/headers/popup.header.tsx @@ -20,6 +20,9 @@ interface PopupHeaderProps { export function PopupHeader({ showSwitchAccount, balance }: PopupHeaderProps) { const { isShowingSwitchAccount, setIsShowingSwitchAccount } = useOutletContext(); + + // Popup switch account not showing anything now + return (