thirdweb 5.108.6 → 5.108.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +1 -2
- package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +185 -99
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +210 -56
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +7 -7
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js +233 -105
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +1 -7
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +16 -12
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +199 -36
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +4 -5
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js +52 -0
- package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js +36 -0
- package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js +58 -0
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-balance.js +20 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-balance.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-query.js +34 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-query.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js +19 -147
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/types.js +3 -0
- package/dist/cjs/react/web/ui/Bridge/types.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +4 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +17 -10
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js +115 -0
- package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +7 -111
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +27 -306
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +21 -128
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/StepRunner.stories.js +13 -39
- package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +13 -101
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js +49 -0
- package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js +53 -0
- package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +11 -79
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/fixtures.js +21 -62
- package/dist/cjs/stories/Bridge/fixtures.js.map +1 -1
- package/dist/cjs/stories/BuyWidget.stories.js +44 -8
- package/dist/cjs/stories/BuyWidget.stories.js.map +1 -1
- package/dist/cjs/stories/utils.js +5 -2
- package/dist/cjs/stories/utils.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/x402/common.js +3 -5
- package/dist/cjs/x402/common.js.map +1 -1
- package/dist/cjs/x402/facilitator.js +3 -4
- package/dist/cjs/x402/facilitator.js.map +1 -1
- package/dist/cjs/x402/schemas.js +4 -0
- package/dist/cjs/x402/schemas.js.map +1 -1
- package/dist/cjs/x402/settle-payment.js +6 -5
- package/dist/cjs/x402/settle-payment.js.map +1 -1
- package/dist/cjs/x402/sign.js +2 -6
- package/dist/cjs/x402/sign.js.map +1 -1
- package/dist/cjs/x402/types.js.map +1 -1
- package/dist/cjs/x402/verify-payment.js +6 -5
- package/dist/cjs/x402/verify-payment.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js +1 -2
- package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +185 -99
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +211 -57
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js +7 -7
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/FundWallet.js +237 -109
- package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +1 -7
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +16 -12
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +198 -36
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
- package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +4 -5
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js +49 -0
- package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/decimal-input.js +33 -0
- package/dist/esm/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js +55 -0
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/token-balance.js +17 -0
- package/dist/esm/react/web/ui/Bridge/common/token-balance.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/token-query.js +31 -0
- package/dist/esm/react/web/ui/Bridge/common/token-query.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js +16 -144
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/types.js +2 -0
- package/dist/esm/react/web/ui/Bridge/types.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +4 -2
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +17 -10
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/esm/stories/Bridge/CheckoutWidget.stories.js +112 -0
- package/dist/esm/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js +7 -111
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js +28 -307
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js +22 -129
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/StepRunner.stories.js +12 -38
- package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +14 -102
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js +46 -0
- package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js +50 -0
- package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +12 -80
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/fixtures.js +15 -56
- package/dist/esm/stories/Bridge/fixtures.js.map +1 -1
- package/dist/esm/stories/BuyWidget.stories.js +37 -9
- package/dist/esm/stories/BuyWidget.stories.js.map +1 -1
- package/dist/esm/stories/utils.js +6 -3
- package/dist/esm/stories/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/x402/common.js +3 -5
- package/dist/esm/x402/common.js.map +1 -1
- package/dist/esm/x402/facilitator.js +3 -4
- package/dist/esm/x402/facilitator.js.map +1 -1
- package/dist/esm/x402/schemas.js +5 -1
- package/dist/esm/x402/schemas.js.map +1 -1
- package/dist/esm/x402/settle-payment.js +6 -5
- package/dist/esm/x402/settle-payment.js.map +1 -1
- package/dist/esm/x402/sign.js +2 -6
- package/dist/esm/x402/sign.js.map +1 -1
- package/dist/esm/x402/types.js.map +1 -1
- package/dist/esm/x402/verify-payment.js +6 -5
- package/dist/esm/x402/verify-payment.js.map +1 -1
- package/dist/scripts/bridge-widget.d.ts +3 -3
- package/dist/scripts/bridge-widget.js +113 -150
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +6 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts +1 -2
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +7 -12
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +5 -8
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +15 -12
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +33 -15
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +9 -12
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +7 -7
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +14 -7
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +3 -5
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +4 -3
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts +3 -3
- package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +4 -4
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts +8 -0
- package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts +6 -0
- package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts +13 -0
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts +8 -0
- package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/token-query.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/common/token-query.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +13 -11
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +8 -3
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +12 -16
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +6 -6
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/swap-ui.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/types.d.ts +39 -0
- package/dist/types/react/web/ui/Bridge/types.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts +2 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +0 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +3 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyIcon.d.ts +1 -0
- package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
- package/dist/types/script-exports/bridge-widget-script.d.ts +3 -3
- package/dist/types/script-exports/bridge-widget-script.d.ts.map +1 -1
- package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts +25 -0
- package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +3 -47
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +3 -56
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +5 -63
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts +4 -52
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +4 -54
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts +11 -0
- package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts +18 -0
- package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +3 -34
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/fixtures.d.ts +19 -17
- package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -1
- package/dist/types/stories/BuyWidget.stories.d.ts +9 -1
- package/dist/types/stories/BuyWidget.stories.d.ts.map +1 -1
- package/dist/types/stories/utils.d.ts +0 -2
- package/dist/types/stories/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/x402/common.d.ts.map +1 -1
- package/dist/types/x402/facilitator.d.ts +4 -5
- package/dist/types/x402/facilitator.d.ts.map +1 -1
- package/dist/types/x402/schemas.d.ts +21 -0
- package/dist/types/x402/schemas.d.ts.map +1 -1
- package/dist/types/x402/settle-payment.d.ts.map +1 -1
- package/dist/types/x402/types.d.ts +5 -4
- package/dist/types/x402/types.d.ts.map +1 -1
- package/dist/types/x402/verify-payment.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/react/core/hooks/transaction/useSendTransaction.ts +6 -0
- package/src/react/core/hooks/usePaymentMethods.ts +1 -4
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +355 -160
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +384 -107
- package/src/react/web/ui/Bridge/DirectPayment.tsx +34 -26
- package/src/react/web/ui/Bridge/FundWallet.tsx +610 -266
- package/src/react/web/ui/Bridge/QuoteLoader.tsx +10 -20
- package/src/react/web/ui/Bridge/StepRunner.tsx +7 -7
- package/src/react/web/ui/Bridge/TransactionPayment.tsx +35 -25
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +395 -71
- package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +3 -3
- package/src/react/web/ui/Bridge/bridge-widget/bridge-widget.tsx +16 -14
- package/src/react/web/ui/Bridge/common/WithHeader.tsx +13 -19
- package/src/react/web/ui/Bridge/common/active-wallet-details.tsx +103 -0
- package/src/react/web/ui/Bridge/common/decimal-input.tsx +61 -0
- package/src/react/web/ui/Bridge/common/selected-token-button.tsx +168 -0
- package/src/react/web/ui/Bridge/common/token-balance.tsx +23 -0
- package/src/react/web/ui/Bridge/common/token-query.ts +49 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +23 -14
- package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +36 -22
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +11 -22
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +1 -1
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +7 -8
- package/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx +14 -12
- package/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx +19 -332
- package/src/react/web/ui/Bridge/types.ts +47 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +1 -5
- package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +5 -1
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +1 -2
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +44 -27
- package/src/react/web/ui/components/CopyIcon.tsx +11 -2
- package/src/script-exports/bridge-widget-script.tsx +3 -3
- package/src/script-exports/readme.md +1 -8
- package/src/stories/Bridge/CheckoutWidget.stories.tsx +147 -0
- package/src/stories/Bridge/ErrorBanner.stories.tsx +13 -138
- package/src/stories/Bridge/PaymentDetails.stories.tsx +34 -349
- package/src/stories/Bridge/PaymentSelection.stories.tsx +28 -156
- package/src/stories/Bridge/StepRunner.stories.tsx +18 -65
- package/src/stories/Bridge/SuccessScreen.stories.tsx +21 -130
- package/src/stories/Bridge/Transaction/TransactionWidget.stories.tsx +63 -0
- package/src/stories/Bridge/Transaction/useSendTransactionModal.stories.tsx +68 -0
- package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +19 -108
- package/src/stories/Bridge/fixtures.ts +36 -63
- package/src/stories/BuyWidget.stories.tsx +103 -8
- package/src/stories/utils.tsx +16 -9
- package/src/version.ts +1 -1
- package/src/x402/common.ts +2 -5
- package/src/x402/facilitator.ts +8 -8
- package/src/x402/schemas.ts +10 -0
- package/src/x402/settle-payment.ts +7 -6
- package/src/x402/sign.ts +3 -8
- package/src/x402/types.ts +5 -4
- package/src/x402/verify-payment.ts +7 -6
- package/dist/cjs/react/core/machines/paymentMachine.js +0 -191
- package/dist/cjs/react/core/machines/paymentMachine.js.map +0 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +0 -129
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +0 -258
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js +0 -222
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/FundWallet.stories.js +0 -201
- package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +0 -168
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +0 -1
- package/dist/esm/react/core/machines/paymentMachine.js +0 -188
- package/dist/esm/react/core/machines/paymentMachine.js.map +0 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +0 -126
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +0 -255
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/DirectPayment.stories.js +0 -219
- package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/FundWallet.stories.js +0 -198
- package/dist/esm/stories/Bridge/FundWallet.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js +0 -165
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +0 -1
- package/dist/types/react/core/machines/paymentMachine.d.ts +0 -89
- package/dist/types/react/core/machines/paymentMachine.d.ts.map +0 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +0 -99
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +0 -1
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +0 -97
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +0 -69
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts +0 -67
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +0 -60
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +0 -1
- package/src/react/core/machines/paymentMachine.test.ts +0 -519
- package/src/react/core/machines/paymentMachine.ts +0 -295
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +0 -425
- package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +0 -298
- package/src/stories/Bridge/DirectPayment.stories.tsx +0 -256
- package/src/stories/Bridge/FundWallet.stories.tsx +0 -227
- package/src/stories/Bridge/TransactionPayment.stories.tsx +0 -202
|
@@ -1,43 +1,62 @@
|
|
|
1
1
|
/** biome-ignore-all lint/a11y/useSemanticElements: FIXME */
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
3
|
+
import { ArrowDownIcon } from "@radix-ui/react-icons";
|
|
4
|
+
import { useState } from "react";
|
|
4
5
|
import type { TokenWithPrices } from "../../../../bridge/types/Token.js";
|
|
5
6
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { NATIVE_TOKEN_ADDRESS } from "../../../../constants/addresses.js";
|
|
8
|
+
import {
|
|
9
|
+
getFiatSymbol,
|
|
10
|
+
type SupportedFiatCurrency,
|
|
11
|
+
} from "../../../../pay/convert/type.js";
|
|
12
|
+
import {
|
|
13
|
+
type Address,
|
|
14
|
+
checksumAddress,
|
|
15
|
+
getAddress,
|
|
16
|
+
isAddress,
|
|
17
|
+
shortenAddress,
|
|
18
|
+
} from "../../../../utils/address.js";
|
|
8
19
|
import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
|
|
9
20
|
import {
|
|
10
21
|
fontSize,
|
|
11
22
|
iconSize,
|
|
12
23
|
radius,
|
|
13
24
|
spacing,
|
|
25
|
+
type Theme,
|
|
14
26
|
} from "../../../core/design-system/index.js";
|
|
15
|
-
import {
|
|
27
|
+
import { useEnsName } from "../../../core/utils/wallet.js";
|
|
16
28
|
import { ConnectButton } from "../ConnectWallet/ConnectButton.js";
|
|
17
|
-
import {
|
|
29
|
+
import { DetailsModal } from "../ConnectWallet/Details.js";
|
|
30
|
+
import { WalletDotIcon } from "../ConnectWallet/icons/WalletDotIcon.js";
|
|
31
|
+
import connectLocaleEn from "../ConnectWallet/locale/en.js";
|
|
18
32
|
import { PoweredByThirdweb } from "../ConnectWallet/PoweredByTW.js";
|
|
19
|
-
import {
|
|
20
|
-
import { formatCurrencyAmount } from "../ConnectWallet/screens/formatTokenBalance.js";
|
|
33
|
+
import { formatTokenAmount } from "../ConnectWallet/screens/formatTokenBalance.js";
|
|
21
34
|
import { Container } from "../components/basic.js";
|
|
22
35
|
import { Button } from "../components/buttons.js";
|
|
23
|
-
import {
|
|
36
|
+
import { CopyIcon } from "../components/CopyIcon.js";
|
|
37
|
+
import { Modal } from "../components/Modal.js";
|
|
38
|
+
import { Skeleton } from "../components/Skeleton.js";
|
|
24
39
|
import { Spacer } from "../components/Spacer.js";
|
|
25
40
|
import { Text } from "../components/text.js";
|
|
41
|
+
import { useIsMobile } from "../hooks/useisMobile.js";
|
|
26
42
|
import type { PayEmbedConnectOptions } from "../PayEmbed.js";
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
43
|
+
import { ActiveWalletDetails } from "./common/active-wallet-details.js";
|
|
44
|
+
import { DecimalInput } from "./common/decimal-input.js";
|
|
45
|
+
import { SelectedTokenButton } from "./common/selected-token-button.js";
|
|
46
|
+
import { useTokenBalance } from "./common/token-balance.js";
|
|
47
|
+
import { useTokenQuery } from "./common/token-query.js";
|
|
48
|
+
// import { TokenAndChain } from "./common/TokenAndChain.js";
|
|
29
49
|
import { WithHeader } from "./common/WithHeader.js";
|
|
50
|
+
import { useActiveWalletInfo } from "./swap-widget/hooks.js";
|
|
51
|
+
import { SelectToken } from "./swap-widget/select-token-ui.js";
|
|
52
|
+
import type { ActiveWalletInfo } from "./swap-widget/types.js";
|
|
53
|
+
import { useBridgeChains } from "./swap-widget/use-bridge-chains.js";
|
|
30
54
|
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* UI configuration and mode
|
|
34
|
-
*/
|
|
35
|
-
uiOptions: Extract<UIOptions, { mode: "fund_wallet" }>;
|
|
36
|
-
|
|
55
|
+
type FundWalletProps = {
|
|
37
56
|
/**
|
|
38
57
|
* The receiver address, defaults to the connected wallet address
|
|
39
58
|
*/
|
|
40
|
-
receiverAddress
|
|
59
|
+
receiverAddress: Address | undefined;
|
|
41
60
|
/**
|
|
42
61
|
* ThirdwebClient for price fetching
|
|
43
62
|
*/
|
|
@@ -55,315 +74,640 @@ export interface FundWalletProps {
|
|
|
55
74
|
/**
|
|
56
75
|
* Quick buy amounts
|
|
57
76
|
*/
|
|
58
|
-
presetOptions
|
|
77
|
+
presetOptions: [number, number, number];
|
|
59
78
|
|
|
60
79
|
/**
|
|
61
80
|
* Connect options for wallet connection
|
|
62
81
|
*/
|
|
63
|
-
connectOptions
|
|
82
|
+
connectOptions: PayEmbedConnectOptions | undefined;
|
|
64
83
|
|
|
65
84
|
/**
|
|
66
85
|
* Whether to show thirdweb branding in the widget.
|
|
67
|
-
* @default true
|
|
68
86
|
*/
|
|
69
|
-
showThirdwebBranding
|
|
70
|
-
}
|
|
87
|
+
showThirdwebBranding: boolean;
|
|
71
88
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const theme = useCustomTheme();
|
|
83
|
-
const account = useActiveAccount();
|
|
84
|
-
const receiver = receiverAddress ?? account?.address;
|
|
85
|
-
const handleAmountChange = (inputValue: string) => {
|
|
86
|
-
let processedValue = inputValue;
|
|
89
|
+
initialSelection: {
|
|
90
|
+
tokenAddress: string | undefined;
|
|
91
|
+
chainId: number | undefined;
|
|
92
|
+
amount: string | undefined;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The currency to use for the payment.
|
|
97
|
+
*/
|
|
98
|
+
currency: SupportedFiatCurrency;
|
|
87
99
|
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Override label to display on the button
|
|
102
|
+
*/
|
|
103
|
+
buttonLabel: string | undefined;
|
|
104
|
+
|
|
105
|
+
theme: "light" | "dark" | Theme;
|
|
90
106
|
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
onDisconnect: (() => void) | undefined;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The metadata to display in the widget.
|
|
111
|
+
*/
|
|
112
|
+
metadata: {
|
|
113
|
+
title: string | undefined;
|
|
114
|
+
description: string | undefined;
|
|
115
|
+
image: string | undefined;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
type SelectedToken =
|
|
120
|
+
| {
|
|
121
|
+
chainId: number;
|
|
122
|
+
tokenAddress: string;
|
|
93
123
|
}
|
|
124
|
+
| undefined;
|
|
94
125
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
type AmountSelection =
|
|
127
|
+
| {
|
|
128
|
+
type: "usd";
|
|
129
|
+
value: string;
|
|
98
130
|
}
|
|
131
|
+
| {
|
|
132
|
+
type: "token";
|
|
133
|
+
value: string;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export function FundWallet(props: FundWalletProps) {
|
|
137
|
+
const [amountSelection, setAmountSelection] = useState<AmountSelection>({
|
|
138
|
+
type: "token",
|
|
139
|
+
value: props.initialSelection.amount ?? "",
|
|
140
|
+
});
|
|
141
|
+
const theme = useCustomTheme();
|
|
142
|
+
const activeWalletInfo = useActiveWalletInfo();
|
|
143
|
+
const receiver =
|
|
144
|
+
props.receiverAddress ?? activeWalletInfo?.activeAccount?.address;
|
|
145
|
+
|
|
146
|
+
const [detailsModalOpen, setDetailsModalOpen] = useState(false);
|
|
147
|
+
const [isTokenSelectionOpen, setIsTokenSelectionOpen] = useState(false);
|
|
99
148
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
149
|
+
const isReceiverDifferentFromActiveWallet =
|
|
150
|
+
props.receiverAddress &&
|
|
151
|
+
isAddress(props.receiverAddress) &&
|
|
152
|
+
(activeWalletInfo?.activeAccount?.address
|
|
153
|
+
? checksumAddress(props.receiverAddress) !==
|
|
154
|
+
checksumAddress(activeWalletInfo?.activeAccount?.address)
|
|
155
|
+
: true);
|
|
156
|
+
|
|
157
|
+
const [selectedToken, setSelectedToken] = useState<SelectedToken>(() => {
|
|
158
|
+
if (!props.initialSelection.chainId) {
|
|
159
|
+
return undefined;
|
|
104
160
|
}
|
|
105
|
-
};
|
|
106
161
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
162
|
+
return {
|
|
163
|
+
chainId: props.initialSelection.chainId,
|
|
164
|
+
tokenAddress: props.initialSelection.tokenAddress || NATIVE_TOKEN_ADDRESS,
|
|
165
|
+
};
|
|
166
|
+
});
|
|
113
167
|
|
|
114
|
-
const
|
|
168
|
+
const tokenQuery = useTokenQuery({
|
|
169
|
+
tokenAddress: selectedToken?.tokenAddress,
|
|
170
|
+
chainId: selectedToken?.chainId,
|
|
171
|
+
client: props.client,
|
|
172
|
+
});
|
|
115
173
|
|
|
116
|
-
const
|
|
174
|
+
const destinationToken =
|
|
175
|
+
tokenQuery.data?.type === "success" ? tokenQuery.data.token : undefined;
|
|
117
176
|
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
177
|
+
const tokenBalanceQuery = useTokenBalance({
|
|
178
|
+
chainId: selectedToken?.chainId,
|
|
179
|
+
tokenAddress: selectedToken?.tokenAddress,
|
|
180
|
+
client: props.client,
|
|
181
|
+
walletAddress: activeWalletInfo?.activeAccount?.address,
|
|
182
|
+
});
|
|
121
183
|
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
uiOptions.destinationToken.prices[uiOptions.currency || "USD"] || 0;
|
|
125
|
-
if (price === 0) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
// Convert USD amount to token amount using token price
|
|
129
|
-
const tokenAmount = usdAmount / price;
|
|
130
|
-
// Format to reasonable decimal places (up to 6 decimals, remove trailing zeros)
|
|
131
|
-
const formattedAmount = numberToPlainString(
|
|
132
|
-
Number.parseFloat(tokenAmount.toFixed(6)),
|
|
133
|
-
);
|
|
134
|
-
setAmount(formattedAmount);
|
|
135
|
-
};
|
|
184
|
+
const actionLabel = isReceiverDifferentFromActiveWallet ? "Pay" : "Buy";
|
|
185
|
+
const isMobile = useIsMobile();
|
|
136
186
|
|
|
137
187
|
return (
|
|
138
188
|
<WithHeader
|
|
139
|
-
client={client}
|
|
140
|
-
|
|
141
|
-
|
|
189
|
+
client={props.client}
|
|
190
|
+
title={props.metadata.title}
|
|
191
|
+
description={props.metadata.description}
|
|
192
|
+
image={props.metadata.image}
|
|
142
193
|
>
|
|
194
|
+
{detailsModalOpen && (
|
|
195
|
+
<DetailsModal
|
|
196
|
+
client={props.client}
|
|
197
|
+
locale={connectLocaleEn}
|
|
198
|
+
detailsModal={{
|
|
199
|
+
hideBuyFunds: true,
|
|
200
|
+
}}
|
|
201
|
+
theme={props.theme}
|
|
202
|
+
closeModal={() => {
|
|
203
|
+
setDetailsModalOpen(false);
|
|
204
|
+
}}
|
|
205
|
+
onDisconnect={() => {
|
|
206
|
+
props.onDisconnect?.();
|
|
207
|
+
}}
|
|
208
|
+
chains={[]}
|
|
209
|
+
connectOptions={props.connectOptions}
|
|
210
|
+
/>
|
|
211
|
+
)}
|
|
212
|
+
|
|
213
|
+
<Modal
|
|
214
|
+
hide={false}
|
|
215
|
+
className="tw-modal__buy-widget"
|
|
216
|
+
size={isMobile ? "compact" : "wide"}
|
|
217
|
+
title="Select Token"
|
|
218
|
+
open={isTokenSelectionOpen}
|
|
219
|
+
crossContainerStyles={{
|
|
220
|
+
right: spacing.md,
|
|
221
|
+
top: spacing["md+"],
|
|
222
|
+
transform: "none",
|
|
223
|
+
}}
|
|
224
|
+
setOpen={(v) => setIsTokenSelectionOpen(v)}
|
|
225
|
+
>
|
|
226
|
+
<SelectToken
|
|
227
|
+
activeWalletInfo={activeWalletInfo}
|
|
228
|
+
onClose={() => setIsTokenSelectionOpen(false)}
|
|
229
|
+
client={props.client}
|
|
230
|
+
selectedToken={selectedToken}
|
|
231
|
+
setSelectedToken={(token) => {
|
|
232
|
+
setSelectedToken(token);
|
|
233
|
+
setIsTokenSelectionOpen(false);
|
|
234
|
+
}}
|
|
235
|
+
/>
|
|
236
|
+
</Modal>
|
|
237
|
+
|
|
143
238
|
<Container flex="column">
|
|
144
239
|
{/* Token Info */}
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
size="xl"
|
|
160
|
-
token={uiOptions.destinationToken}
|
|
161
|
-
/>
|
|
162
|
-
{/* Amount Input */}
|
|
163
|
-
<Container
|
|
164
|
-
center="x"
|
|
165
|
-
expand
|
|
166
|
-
flex="column"
|
|
167
|
-
gap="3xs"
|
|
168
|
-
style={{
|
|
169
|
-
alignItems: "flex-end",
|
|
170
|
-
justifyContent: "flex-end",
|
|
171
|
-
}}
|
|
172
|
-
>
|
|
173
|
-
<div
|
|
174
|
-
onClick={focusInput}
|
|
175
|
-
onKeyDown={(e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
176
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
177
|
-
e.preventDefault();
|
|
178
|
-
focusInput();
|
|
240
|
+
<TokenSection
|
|
241
|
+
title={actionLabel}
|
|
242
|
+
presetOptions={props.presetOptions}
|
|
243
|
+
amountSelection={amountSelection}
|
|
244
|
+
setAmount={setAmountSelection}
|
|
245
|
+
activeWalletInfo={activeWalletInfo}
|
|
246
|
+
selectedToken={
|
|
247
|
+
selectedToken
|
|
248
|
+
? {
|
|
249
|
+
data:
|
|
250
|
+
tokenQuery.data?.type === "success"
|
|
251
|
+
? tokenQuery.data.token
|
|
252
|
+
: undefined,
|
|
253
|
+
isFetching: tokenQuery.isFetching,
|
|
179
254
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
inputMode="decimal"
|
|
197
|
-
onChange={(e) => {
|
|
198
|
-
handleAmountChange(e.target.value);
|
|
199
|
-
}}
|
|
200
|
-
onClick={(e) => {
|
|
201
|
-
// put cursor at the end of the input
|
|
202
|
-
if (amount === "") {
|
|
203
|
-
e.currentTarget.setSelectionRange(
|
|
204
|
-
e.currentTarget.value.length,
|
|
205
|
-
e.currentTarget.value.length,
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
}}
|
|
209
|
-
pattern="^[0-9]*[.,]?[0-9]*$"
|
|
210
|
-
placeholder="0"
|
|
211
|
-
ref={inputRef}
|
|
212
|
-
style={{
|
|
213
|
-
border: "none",
|
|
214
|
-
boxShadow: "none",
|
|
215
|
-
fontSize: getAmountFontSize(),
|
|
216
|
-
fontWeight: 600,
|
|
217
|
-
padding: "0",
|
|
218
|
-
textAlign: "right",
|
|
219
|
-
}}
|
|
220
|
-
type="text"
|
|
221
|
-
value={amount || "0"}
|
|
222
|
-
variant="transparent"
|
|
223
|
-
/>
|
|
224
|
-
</Container>
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
{/* Fiat Value */}
|
|
228
|
-
<Container
|
|
229
|
-
center="both"
|
|
230
|
-
flex="row"
|
|
231
|
-
style={{ flexWrap: "nowrap", height: fontSize.lg }}
|
|
232
|
-
>
|
|
233
|
-
<Text
|
|
234
|
-
color="secondaryText"
|
|
235
|
-
size="md"
|
|
236
|
-
style={{ textWrap: "nowrap" }}
|
|
237
|
-
>
|
|
238
|
-
≈{" "}
|
|
239
|
-
{formatCurrencyAmount(
|
|
240
|
-
uiOptions.currency || "USD",
|
|
241
|
-
Number(amount) *
|
|
242
|
-
(uiOptions.destinationToken.prices[
|
|
243
|
-
uiOptions.currency || "USD"
|
|
244
|
-
] || 0),
|
|
245
|
-
)}
|
|
246
|
-
</Text>
|
|
247
|
-
</Container>
|
|
248
|
-
</Container>
|
|
249
|
-
</Container>
|
|
255
|
+
: undefined
|
|
256
|
+
}
|
|
257
|
+
balance={{
|
|
258
|
+
data: tokenBalanceQuery.data?.value,
|
|
259
|
+
isFetching: tokenBalanceQuery.isFetching,
|
|
260
|
+
}}
|
|
261
|
+
client={props.client}
|
|
262
|
+
isConnected={!!activeWalletInfo}
|
|
263
|
+
onSelectToken={() => {
|
|
264
|
+
setIsTokenSelectionOpen(true);
|
|
265
|
+
}}
|
|
266
|
+
onWalletClick={() => {
|
|
267
|
+
setDetailsModalOpen(true);
|
|
268
|
+
}}
|
|
269
|
+
currency={props.currency}
|
|
270
|
+
/>
|
|
250
271
|
|
|
251
|
-
{
|
|
252
|
-
{presetOptions && (
|
|
272
|
+
{receiver && isReceiverDifferentFromActiveWallet && (
|
|
253
273
|
<>
|
|
254
|
-
<
|
|
255
|
-
<
|
|
256
|
-
center="x"
|
|
257
|
-
flex="row"
|
|
258
|
-
gap="sm"
|
|
259
|
-
style={{
|
|
260
|
-
justifyContent: "space-evenly",
|
|
261
|
-
}}
|
|
262
|
-
>
|
|
263
|
-
{presetOptions?.map((amount) => (
|
|
264
|
-
<Button
|
|
265
|
-
key={amount}
|
|
266
|
-
onClick={() => handleQuickAmount(Number(amount))}
|
|
267
|
-
style={{
|
|
268
|
-
backgroundColor: theme.colors.tertiaryBg,
|
|
269
|
-
flex: 1,
|
|
270
|
-
fontSize: fontSize.sm,
|
|
271
|
-
borderRadius: radius.lg,
|
|
272
|
-
padding: `${spacing.sm} ${spacing.md}`,
|
|
273
|
-
}}
|
|
274
|
-
variant="outline"
|
|
275
|
-
>
|
|
276
|
-
${amount}
|
|
277
|
-
</Button>
|
|
278
|
-
))}
|
|
279
|
-
</Container>
|
|
274
|
+
<ArrowSection />
|
|
275
|
+
<ReceiverWalletSection address={receiver} client={props.client} />
|
|
280
276
|
</>
|
|
281
277
|
)}
|
|
282
|
-
|
|
283
|
-
<Spacer y="sm" />
|
|
284
|
-
|
|
285
|
-
<Container
|
|
286
|
-
center="y"
|
|
287
|
-
color="secondaryText"
|
|
288
|
-
flex="row"
|
|
289
|
-
gap="sm"
|
|
290
|
-
px="md"
|
|
291
|
-
py="sm"
|
|
292
|
-
style={{
|
|
293
|
-
backgroundColor: theme.colors.tertiaryBg,
|
|
294
|
-
border: `1px solid ${theme.colors.borderColor}`,
|
|
295
|
-
borderRadius: radius.lg,
|
|
296
|
-
}}
|
|
297
|
-
>
|
|
298
|
-
{receiver ? (
|
|
299
|
-
<WalletRow
|
|
300
|
-
address={receiver}
|
|
301
|
-
client={client}
|
|
302
|
-
iconSize="md"
|
|
303
|
-
textSize="sm"
|
|
304
|
-
/>
|
|
305
|
-
) : (
|
|
306
|
-
<>
|
|
307
|
-
<OutlineWalletIcon size={iconSize.md} />
|
|
308
|
-
<Text
|
|
309
|
-
color="secondaryText"
|
|
310
|
-
size="sm"
|
|
311
|
-
style={{
|
|
312
|
-
flex: 1,
|
|
313
|
-
}}
|
|
314
|
-
>
|
|
315
|
-
No Wallet Connected
|
|
316
|
-
</Text>
|
|
317
|
-
</>
|
|
318
|
-
)}
|
|
319
|
-
</Container>
|
|
320
278
|
</Container>
|
|
321
279
|
|
|
322
|
-
<Spacer y="
|
|
280
|
+
<Spacer y="md" />
|
|
323
281
|
|
|
324
282
|
{/* Continue Button */}
|
|
325
|
-
{
|
|
283
|
+
{activeWalletInfo ? (
|
|
326
284
|
<Button
|
|
327
|
-
disabled={!
|
|
285
|
+
disabled={!receiver}
|
|
328
286
|
fullWidth
|
|
329
287
|
onClick={() => {
|
|
330
|
-
if (
|
|
331
|
-
|
|
332
|
-
amount,
|
|
333
|
-
uiOptions.destinationToken,
|
|
334
|
-
getAddress(receiver),
|
|
335
|
-
);
|
|
288
|
+
if (!receiver || !destinationToken) {
|
|
289
|
+
return;
|
|
336
290
|
}
|
|
291
|
+
|
|
292
|
+
const fiatPricePerToken = destinationToken.prices[props.currency];
|
|
293
|
+
const { tokenValue } = getAmounts(
|
|
294
|
+
amountSelection,
|
|
295
|
+
fiatPricePerToken,
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
if (!tokenValue) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
props.onContinue(
|
|
303
|
+
String(tokenValue),
|
|
304
|
+
destinationToken,
|
|
305
|
+
getAddress(receiver),
|
|
306
|
+
);
|
|
337
307
|
}}
|
|
338
308
|
style={{
|
|
339
309
|
fontSize: fontSize.md,
|
|
340
|
-
borderRadius: radius.
|
|
310
|
+
borderRadius: radius.full,
|
|
341
311
|
}}
|
|
342
312
|
variant="primary"
|
|
343
313
|
>
|
|
344
|
-
{
|
|
345
|
-
`Buy ${amount} ${uiOptions.destinationToken.symbol}`}
|
|
314
|
+
{props.buttonLabel || actionLabel}
|
|
346
315
|
</Button>
|
|
347
316
|
) : (
|
|
348
317
|
<ConnectButton
|
|
349
|
-
client={client}
|
|
318
|
+
client={props.client}
|
|
350
319
|
connectButton={{
|
|
351
|
-
label:
|
|
352
|
-
|
|
353
|
-
|
|
320
|
+
label: props.buttonLabel || actionLabel,
|
|
321
|
+
style: {
|
|
322
|
+
width: "100%",
|
|
323
|
+
borderRadius: radius.full,
|
|
324
|
+
},
|
|
354
325
|
}}
|
|
355
326
|
theme={theme}
|
|
356
|
-
{...connectOptions}
|
|
327
|
+
{...props.connectOptions}
|
|
357
328
|
/>
|
|
358
329
|
)}
|
|
359
330
|
|
|
360
|
-
{showThirdwebBranding ? (
|
|
331
|
+
{props.showThirdwebBranding ? (
|
|
361
332
|
<div>
|
|
362
333
|
<Spacer y="md" />
|
|
363
334
|
<PoweredByThirdweb link="https://playground.thirdweb.com/payments/fund-wallet" />
|
|
364
335
|
</div>
|
|
365
|
-
) :
|
|
336
|
+
) : (
|
|
337
|
+
<Spacer y="xxs" />
|
|
338
|
+
)}
|
|
366
339
|
<Spacer y="md" />
|
|
367
340
|
</WithHeader>
|
|
368
341
|
);
|
|
369
342
|
}
|
|
343
|
+
|
|
344
|
+
function getAmounts(
|
|
345
|
+
amountSelection: AmountSelection,
|
|
346
|
+
fiatPricePerToken: number | undefined,
|
|
347
|
+
) {
|
|
348
|
+
const fiatValue =
|
|
349
|
+
amountSelection.type === "usd"
|
|
350
|
+
? amountSelection.value
|
|
351
|
+
: fiatPricePerToken
|
|
352
|
+
? fiatPricePerToken * Number(amountSelection.value)
|
|
353
|
+
: undefined;
|
|
354
|
+
|
|
355
|
+
const tokenValue =
|
|
356
|
+
amountSelection.type === "token"
|
|
357
|
+
? amountSelection.value
|
|
358
|
+
: fiatPricePerToken
|
|
359
|
+
? Number(amountSelection.value) / fiatPricePerToken
|
|
360
|
+
: undefined;
|
|
361
|
+
|
|
362
|
+
return {
|
|
363
|
+
fiatValue,
|
|
364
|
+
tokenValue,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function TokenSection(props: {
|
|
369
|
+
amountSelection: AmountSelection;
|
|
370
|
+
setAmount: (amountSelection: AmountSelection) => void;
|
|
371
|
+
activeWalletInfo: ActiveWalletInfo | undefined;
|
|
372
|
+
selectedToken:
|
|
373
|
+
| {
|
|
374
|
+
data: TokenWithPrices | undefined;
|
|
375
|
+
isFetching: boolean;
|
|
376
|
+
}
|
|
377
|
+
| undefined;
|
|
378
|
+
currency: SupportedFiatCurrency;
|
|
379
|
+
onSelectToken: () => void;
|
|
380
|
+
client: ThirdwebClient;
|
|
381
|
+
title: string;
|
|
382
|
+
isConnected: boolean;
|
|
383
|
+
balance: {
|
|
384
|
+
data: bigint | undefined;
|
|
385
|
+
isFetching: boolean;
|
|
386
|
+
};
|
|
387
|
+
onWalletClick: () => void;
|
|
388
|
+
presetOptions: [number, number, number];
|
|
389
|
+
}) {
|
|
390
|
+
const theme = useCustomTheme();
|
|
391
|
+
const chainQuery = useBridgeChains(props.client);
|
|
392
|
+
const chain = chainQuery.data?.find(
|
|
393
|
+
(chain) => chain.chainId === props.selectedToken?.data?.chainId,
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
const fiatPricePerToken = props.selectedToken?.data?.prices[props.currency];
|
|
397
|
+
|
|
398
|
+
const { fiatValue, tokenValue } = getAmounts(
|
|
399
|
+
props.amountSelection,
|
|
400
|
+
fiatPricePerToken,
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
return (
|
|
404
|
+
<SectionContainer
|
|
405
|
+
header={
|
|
406
|
+
<div
|
|
407
|
+
style={{
|
|
408
|
+
display: "flex",
|
|
409
|
+
justifyContent: "space-between",
|
|
410
|
+
alignItems: "center",
|
|
411
|
+
}}
|
|
412
|
+
>
|
|
413
|
+
<Container flex="row" center="y" gap="3xs" color="secondaryText">
|
|
414
|
+
<Text
|
|
415
|
+
size="xs"
|
|
416
|
+
color="primaryText"
|
|
417
|
+
style={{
|
|
418
|
+
letterSpacing: "0.07em",
|
|
419
|
+
textTransform: "uppercase",
|
|
420
|
+
}}
|
|
421
|
+
>
|
|
422
|
+
{props.title}
|
|
423
|
+
</Text>
|
|
424
|
+
</Container>
|
|
425
|
+
{props.activeWalletInfo && (
|
|
426
|
+
<ActiveWalletDetails
|
|
427
|
+
activeWalletInfo={props.activeWalletInfo}
|
|
428
|
+
client={props.client}
|
|
429
|
+
onClick={props.onWalletClick}
|
|
430
|
+
/>
|
|
431
|
+
)}
|
|
432
|
+
</div>
|
|
433
|
+
}
|
|
434
|
+
>
|
|
435
|
+
{/* select token */}
|
|
436
|
+
<SelectedTokenButton
|
|
437
|
+
selectedToken={props.selectedToken}
|
|
438
|
+
client={props.client}
|
|
439
|
+
onSelectToken={props.onSelectToken}
|
|
440
|
+
chain={chain}
|
|
441
|
+
/>
|
|
442
|
+
|
|
443
|
+
<Container px="md" py="md">
|
|
444
|
+
{/* token value input */}
|
|
445
|
+
<DecimalInput
|
|
446
|
+
value={tokenValue ? String(tokenValue) : ""}
|
|
447
|
+
setValue={(value) => {
|
|
448
|
+
props.setAmount({
|
|
449
|
+
type: "token",
|
|
450
|
+
value,
|
|
451
|
+
});
|
|
452
|
+
}}
|
|
453
|
+
style={{
|
|
454
|
+
border: "none",
|
|
455
|
+
boxShadow: "none",
|
|
456
|
+
fontSize: fontSize.xl,
|
|
457
|
+
fontWeight: 500,
|
|
458
|
+
paddingInline: 0,
|
|
459
|
+
paddingBlock: 0,
|
|
460
|
+
letterSpacing: "-0.025em",
|
|
461
|
+
}}
|
|
462
|
+
/>
|
|
463
|
+
|
|
464
|
+
<Spacer y="xs" />
|
|
465
|
+
|
|
466
|
+
{/* fiat value input */}
|
|
467
|
+
<div
|
|
468
|
+
style={{
|
|
469
|
+
display: "flex",
|
|
470
|
+
alignItems: "center",
|
|
471
|
+
gap: "2px",
|
|
472
|
+
}}
|
|
473
|
+
>
|
|
474
|
+
<Text
|
|
475
|
+
size="md"
|
|
476
|
+
color="secondaryText"
|
|
477
|
+
style={{
|
|
478
|
+
flexShrink: 0,
|
|
479
|
+
}}
|
|
480
|
+
>
|
|
481
|
+
{getFiatSymbol(props.currency)}
|
|
482
|
+
</Text>
|
|
483
|
+
|
|
484
|
+
{props.selectedToken?.isFetching ? (
|
|
485
|
+
<Skeleton
|
|
486
|
+
width="120px"
|
|
487
|
+
height="20px"
|
|
488
|
+
style={{
|
|
489
|
+
transform: "translateX(4px)",
|
|
490
|
+
}}
|
|
491
|
+
/>
|
|
492
|
+
) : (
|
|
493
|
+
<DecimalInput
|
|
494
|
+
value={String(fiatValue || 0)}
|
|
495
|
+
setValue={(value) => {
|
|
496
|
+
props.setAmount({
|
|
497
|
+
type: "usd",
|
|
498
|
+
value,
|
|
499
|
+
});
|
|
500
|
+
}}
|
|
501
|
+
style={{
|
|
502
|
+
border: "none",
|
|
503
|
+
boxShadow: "none",
|
|
504
|
+
fontSize: fontSize.md,
|
|
505
|
+
fontWeight: 400,
|
|
506
|
+
color: theme.colors.secondaryText,
|
|
507
|
+
paddingInline: 0,
|
|
508
|
+
height: "20px",
|
|
509
|
+
paddingBlock: 0,
|
|
510
|
+
}}
|
|
511
|
+
/>
|
|
512
|
+
)}
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
<Spacer y="md" />
|
|
516
|
+
|
|
517
|
+
{/* suggested amounts */}
|
|
518
|
+
<Container flex="row" gap="xxs">
|
|
519
|
+
{props.presetOptions.map((amount) => (
|
|
520
|
+
<Button
|
|
521
|
+
disabled={!props.selectedToken?.data}
|
|
522
|
+
key={amount}
|
|
523
|
+
onClick={() =>
|
|
524
|
+
props.setAmount({
|
|
525
|
+
type: "usd",
|
|
526
|
+
value: String(amount),
|
|
527
|
+
})
|
|
528
|
+
}
|
|
529
|
+
style={{
|
|
530
|
+
backgroundColor: "transparent",
|
|
531
|
+
color: theme.colors.secondaryText,
|
|
532
|
+
fontSize: fontSize.xs,
|
|
533
|
+
fontWeight: 400,
|
|
534
|
+
borderRadius: radius.full,
|
|
535
|
+
gap: "0.5px",
|
|
536
|
+
padding: `${spacing.xxs} ${spacing.sm}`,
|
|
537
|
+
}}
|
|
538
|
+
variant="outline"
|
|
539
|
+
>
|
|
540
|
+
<span>{getFiatSymbol(props.currency)}</span>
|
|
541
|
+
<span>{amount}</span>
|
|
542
|
+
</Button>
|
|
543
|
+
))}
|
|
544
|
+
</Container>
|
|
545
|
+
</Container>
|
|
546
|
+
|
|
547
|
+
{/* balance */}
|
|
548
|
+
{props.isConnected && props.selectedToken && (
|
|
549
|
+
<Container
|
|
550
|
+
px="md"
|
|
551
|
+
py="md"
|
|
552
|
+
style={{
|
|
553
|
+
borderTop: `1px dashed ${theme.colors.borderColor}`,
|
|
554
|
+
justifyContent: "start",
|
|
555
|
+
}}
|
|
556
|
+
>
|
|
557
|
+
<div
|
|
558
|
+
style={{
|
|
559
|
+
display: "flex",
|
|
560
|
+
justifyContent: "space-between",
|
|
561
|
+
alignItems: "center",
|
|
562
|
+
gap: "3px",
|
|
563
|
+
}}
|
|
564
|
+
>
|
|
565
|
+
<Text size="xs" color="secondaryText">
|
|
566
|
+
Current Balance
|
|
567
|
+
</Text>
|
|
568
|
+
{props.balance.data === undefined ||
|
|
569
|
+
props.selectedToken.data === undefined ? (
|
|
570
|
+
<Skeleton height={fontSize.xs} width="100px" />
|
|
571
|
+
) : (
|
|
572
|
+
<Text size="xs" color="primaryText">
|
|
573
|
+
{formatTokenAmount(
|
|
574
|
+
props.balance.data,
|
|
575
|
+
props.selectedToken.data.decimals,
|
|
576
|
+
5,
|
|
577
|
+
)}{" "}
|
|
578
|
+
{props.selectedToken.data.symbol}
|
|
579
|
+
</Text>
|
|
580
|
+
)}
|
|
581
|
+
</div>
|
|
582
|
+
</Container>
|
|
583
|
+
)}
|
|
584
|
+
</SectionContainer>
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function ReceiverWalletSection(props: {
|
|
589
|
+
address: string;
|
|
590
|
+
client: ThirdwebClient;
|
|
591
|
+
}) {
|
|
592
|
+
const ensNameQuery = useEnsName({
|
|
593
|
+
address: props.address,
|
|
594
|
+
client: props.client,
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
return (
|
|
598
|
+
<SectionContainer
|
|
599
|
+
header={
|
|
600
|
+
<Text
|
|
601
|
+
size="xs"
|
|
602
|
+
color="primaryText"
|
|
603
|
+
style={{
|
|
604
|
+
letterSpacing: "0.07em",
|
|
605
|
+
textTransform: "uppercase",
|
|
606
|
+
}}
|
|
607
|
+
>
|
|
608
|
+
To
|
|
609
|
+
</Text>
|
|
610
|
+
}
|
|
611
|
+
>
|
|
612
|
+
<Container
|
|
613
|
+
px="md"
|
|
614
|
+
py="md"
|
|
615
|
+
flex="row"
|
|
616
|
+
center="y"
|
|
617
|
+
gap="xs"
|
|
618
|
+
color="secondaryText"
|
|
619
|
+
>
|
|
620
|
+
<WalletDotIcon size={iconSize.xs} color="secondaryText" />
|
|
621
|
+
<Text size="sm" color="primaryText">
|
|
622
|
+
{ensNameQuery.data || shortenAddress(props.address)}
|
|
623
|
+
</Text>
|
|
624
|
+
<CopyIcon text={props.address} tip="Copy address" iconSize={14} />
|
|
625
|
+
</Container>
|
|
626
|
+
</SectionContainer>
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function SectionContainer(props: {
|
|
631
|
+
children: React.ReactNode;
|
|
632
|
+
header: React.ReactNode;
|
|
633
|
+
}) {
|
|
634
|
+
const theme = useCustomTheme();
|
|
635
|
+
return (
|
|
636
|
+
<Container
|
|
637
|
+
style={{
|
|
638
|
+
borderRadius: radius.xl,
|
|
639
|
+
borderWidth: 1,
|
|
640
|
+
borderStyle: "solid",
|
|
641
|
+
position: "relative",
|
|
642
|
+
overflow: "hidden",
|
|
643
|
+
}}
|
|
644
|
+
borderColor="borderColor"
|
|
645
|
+
>
|
|
646
|
+
{/* make the background semi-transparent */}
|
|
647
|
+
<Container
|
|
648
|
+
bg="tertiaryBg"
|
|
649
|
+
style={{
|
|
650
|
+
position: "absolute",
|
|
651
|
+
inset: 0,
|
|
652
|
+
opacity: 0.5,
|
|
653
|
+
zIndex: 0,
|
|
654
|
+
}}
|
|
655
|
+
/>
|
|
656
|
+
|
|
657
|
+
{/* header */}
|
|
658
|
+
<Container
|
|
659
|
+
style={{
|
|
660
|
+
position: "relative",
|
|
661
|
+
zIndex: 1,
|
|
662
|
+
}}
|
|
663
|
+
>
|
|
664
|
+
<Container px="md" py="sm" relative>
|
|
665
|
+
{props.header}
|
|
666
|
+
</Container>
|
|
667
|
+
</Container>
|
|
668
|
+
|
|
669
|
+
{/* content */}
|
|
670
|
+
<Container
|
|
671
|
+
bg="tertiaryBg"
|
|
672
|
+
style={{
|
|
673
|
+
position: "relative",
|
|
674
|
+
overflow: "hidden",
|
|
675
|
+
borderRadius: radius.xl,
|
|
676
|
+
borderTop: `1px solid ${theme.colors.borderColor}`,
|
|
677
|
+
}}
|
|
678
|
+
>
|
|
679
|
+
{props.children}
|
|
680
|
+
</Container>
|
|
681
|
+
</Container>
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function ArrowSection() {
|
|
686
|
+
return (
|
|
687
|
+
<div
|
|
688
|
+
style={{
|
|
689
|
+
display: "flex",
|
|
690
|
+
justifyContent: "center",
|
|
691
|
+
marginBlock: `-13px`,
|
|
692
|
+
zIndex: 2,
|
|
693
|
+
position: "relative",
|
|
694
|
+
}}
|
|
695
|
+
>
|
|
696
|
+
<Container
|
|
697
|
+
p="xs"
|
|
698
|
+
center="both"
|
|
699
|
+
flex="row"
|
|
700
|
+
color="primaryText"
|
|
701
|
+
bg="modalBg"
|
|
702
|
+
borderColor="borderColor"
|
|
703
|
+
style={{
|
|
704
|
+
borderRadius: radius.full,
|
|
705
|
+
borderWidth: 1,
|
|
706
|
+
borderStyle: "solid",
|
|
707
|
+
}}
|
|
708
|
+
>
|
|
709
|
+
<ArrowDownIcon width={iconSize["sm+"]} height={iconSize["sm+"]} />
|
|
710
|
+
</Container>
|
|
711
|
+
</div>
|
|
712
|
+
);
|
|
713
|
+
}
|