@imtbl/checkout-widgets 2.7.1-alpha.0 → 2.7.1-alpha.1
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/.eslintrc.cjs +1 -0
- package/dist/browser/{AddTokensWidget-4BCiIA7T.js → AddTokensWidget-By4cVQ3j.js} +3 -3
- package/dist/browser/{BridgeWidget-BVSsHTJe.js → BridgeWidget-BSjgOOpr.js} +6 -6
- package/dist/browser/{CommerceWidget-B0KXbNmg.js → CommerceWidget-BLZ0OU43.js} +14 -14
- package/dist/browser/{FeesBreakdown-CzlwuY-m.js → FeesBreakdown-BRYh6UFJ.js} +1 -1
- package/dist/browser/{OnRampWidget-DbGdCJJC.js → OnRampWidget-CCwrbN6l.js} +3 -3
- package/dist/browser/{SaleWidget-BEXWuwuG.js → SaleWidget-DSMV3akK.js} +11 -11
- package/dist/browser/{SpendingCapHero-BD3hIo3X.js → SpendingCapHero-B5GfS1kT.js} +1 -1
- package/dist/browser/{SwapWidget-Buz1m2R2.js → SwapWidget-DTwSQKnk.js} +13 -14
- package/dist/browser/{TokenImage-DbRJYT2o.js → TokenImage-BQSlwZcG.js} +1 -1
- package/dist/browser/{TopUpView-U9YhrAbj.js → TopUpView-DIUzHFS-.js} +1 -1
- package/dist/browser/{WalletApproveHero-eLkH5CyG.js → WalletApproveHero-4WO4GT70.js} +2 -2
- package/dist/browser/{WalletWidget-d1g11If7.js → WalletWidget-DM7yrVQh.js} +3 -3
- package/dist/browser/{auto-track-DgogaAjc.js → auto-track-UkcMKbBH.js} +1 -1
- package/dist/browser/{index-SL1DvfTR.js → index-B9qQvIiZ.js} +2 -2
- package/dist/browser/{index-Dbtvw5d9.js → index-C6-tYsxS.js} +23 -20
- package/dist/browser/{index-CZ0Oi_M3.js → index-CiMkerVQ.js} +1 -1
- package/dist/browser/{index-DeRvJT4O.js → index-D8m-BURO.js} +1 -1
- package/dist/browser/{index-LtSy2lKb.js → index-DlhZ2-ga.js} +1 -1
- package/dist/browser/{index-Cd8wztEb.js → index-f6E12YMV.js} +1 -1
- package/dist/browser/{index-I9aoOcj7.js → index-koYDpW73.js} +1 -1
- package/dist/browser/{index-CjDj9-bp.js → index-utpIaCiy.js} +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/{index.umd-DI4-tKjE.js → index.umd-47u4zJeV.js} +1 -1
- package/dist/browser/{useInterval-BiHrxJYk.js → useInterval-DfrLRtu2.js} +1 -1
- package/dist/types/widgets/swap/SwapWidget.d.ts +3 -2
- package/dist/types/widgets/swap/components/SwapForm.d.ts +2 -1
- package/dist/types/widgets/swap/views/SwapCoins.d.ts +3 -1
- package/package.json +7 -7
- package/src/widgets/immutable-commerce/CommerceWidget.tsx +1 -1
- package/src/widgets/sale/components/FundingRouteExecute/FundingRouteExecute.tsx +1 -1
- package/src/widgets/swap/SwapWidget.tsx +5 -0
- package/src/widgets/swap/SwapWidgetRoot.tsx +4 -0
- package/src/widgets/swap/components/SwapForm.tsx +13 -9
- package/src/widgets/swap/views/SwapCoins.tsx +6 -1
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
TokenFilterTypes, IMTBLWidgetEvents, SwapWidgetParams,
|
|
11
11
|
SwapDirection,
|
|
12
12
|
WalletProviderName,
|
|
13
|
+
SwapWidgetConfiguration,
|
|
13
14
|
} from '@imtbl/checkout-sdk';
|
|
14
15
|
import { useTranslation } from 'react-i18next';
|
|
15
16
|
import { SwapCoins } from './views/SwapCoins';
|
|
@@ -59,6 +60,7 @@ import { GeoblockLoader } from './GeoblockLoader';
|
|
|
59
60
|
|
|
60
61
|
export type SwapWidgetInputs = SwapWidgetParams & {
|
|
61
62
|
config: StrongCheckoutWidgetsConfig;
|
|
63
|
+
swapConfig: SwapWidgetConfiguration;
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
export default function SwapWidget({
|
|
@@ -69,6 +71,7 @@ export default function SwapWidget({
|
|
|
69
71
|
autoProceed,
|
|
70
72
|
direction,
|
|
71
73
|
showBackButton,
|
|
74
|
+
swapConfig: { customTitle, customSubTitle },
|
|
72
75
|
walletProviderName,
|
|
73
76
|
}: SwapWidgetInputs) {
|
|
74
77
|
const { t } = useTranslation();
|
|
@@ -257,6 +260,8 @@ export default function SwapWidget({
|
|
|
257
260
|
fromTokenAddress={viewState.view.data?.fromTokenAddress ?? fromTokenAddress}
|
|
258
261
|
toTokenAddress={viewState.view.data?.toTokenAddress ?? toTokenAddress}
|
|
259
262
|
showBackButton={showBackButton}
|
|
263
|
+
title={customTitle ?? t('views.SWAP.header.title')}
|
|
264
|
+
subTitle={customSubTitle ?? t('views.SWAP.content.title')}
|
|
260
265
|
/>
|
|
261
266
|
)}
|
|
262
267
|
{viewState.view.type === SwapWidgetViews.IN_PROGRESS && (
|
|
@@ -106,6 +106,10 @@ export class Swap extends Base<WidgetType.SWAP> {
|
|
|
106
106
|
direction={this.parameters.direction ?? SwapDirection.FROM}
|
|
107
107
|
showBackButton={this.parameters.showBackButton}
|
|
108
108
|
walletProviderName={this.parameters.walletProviderName}
|
|
109
|
+
swapConfig={{
|
|
110
|
+
customTitle: this.properties.config?.customTitle,
|
|
111
|
+
customSubTitle: this.properties.config?.customSubTitle,
|
|
112
|
+
}}
|
|
109
113
|
/>
|
|
110
114
|
</Suspense>
|
|
111
115
|
</ConnectLoader>
|
|
@@ -78,6 +78,7 @@ export interface SwapFromProps {
|
|
|
78
78
|
data?: SwapFormData;
|
|
79
79
|
theme: WidgetTheme;
|
|
80
80
|
cancelAutoProceed: () => void;
|
|
81
|
+
subTitle: string;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
class PriceImpactError extends Error {
|
|
@@ -87,7 +88,9 @@ class PriceImpactError extends Error {
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
export function SwapForm({
|
|
91
|
+
export function SwapForm({
|
|
92
|
+
data, theme, cancelAutoProceed, subTitle,
|
|
93
|
+
}: SwapFromProps) {
|
|
91
94
|
const { t } = useTranslation();
|
|
92
95
|
const {
|
|
93
96
|
swapState: {
|
|
@@ -106,7 +109,6 @@ export function SwapForm({ data, theme, cancelAutoProceed }: SwapFromProps) {
|
|
|
106
109
|
? NATIVE
|
|
107
110
|
: `${symbol.toLowerCase()}-${address!.toLowerCase()}`), []);
|
|
108
111
|
|
|
109
|
-
// const { cryptoFiatState, cryptoFiatDispatch } = useContext(CryptoFiatContext);
|
|
110
112
|
const { conversions: usdConversions } = useCryptoUSDConversion(checkout?.config.environment);
|
|
111
113
|
const { viewDispatch } = useContext(ViewContext);
|
|
112
114
|
|
|
@@ -939,13 +941,15 @@ export function SwapForm({ data, theme, cancelAutoProceed }: SwapFromProps) {
|
|
|
939
941
|
marginBottom: 'base.spacing.x2',
|
|
940
942
|
}}
|
|
941
943
|
>
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
944
|
+
{subTitle !== '' ? (
|
|
945
|
+
<Heading
|
|
946
|
+
size="small"
|
|
947
|
+
weight="regular"
|
|
948
|
+
sx={{ paddingBottom: 'base.spacing.x4' }}
|
|
949
|
+
>
|
|
950
|
+
{subTitle}
|
|
951
|
+
</Heading>
|
|
952
|
+
) : null}
|
|
949
953
|
<Box
|
|
950
954
|
sx={{
|
|
951
955
|
display: 'flex',
|
|
@@ -32,6 +32,8 @@ export interface SwapCoinsProps {
|
|
|
32
32
|
fromTokenAddress?: string;
|
|
33
33
|
toTokenAddress?: string;
|
|
34
34
|
showBackButton?: boolean;
|
|
35
|
+
title: string;
|
|
36
|
+
subTitle: string;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export function SwapCoins({
|
|
@@ -42,6 +44,8 @@ export function SwapCoins({
|
|
|
42
44
|
fromTokenAddress,
|
|
43
45
|
toTokenAddress,
|
|
44
46
|
showBackButton,
|
|
47
|
+
title,
|
|
48
|
+
subTitle,
|
|
45
49
|
}: SwapCoinsProps) {
|
|
46
50
|
const { t } = useTranslation();
|
|
47
51
|
const { viewDispatch } = useContext(ViewContext);
|
|
@@ -88,7 +92,7 @@ export function SwapCoins({
|
|
|
88
92
|
<SimpleLayout
|
|
89
93
|
header={!autoProceed ? (
|
|
90
94
|
<HeaderNavigation
|
|
91
|
-
title={
|
|
95
|
+
title={title}
|
|
92
96
|
onCloseButtonClick={() => sendSwapWidgetCloseEvent(eventTarget)}
|
|
93
97
|
showBack={showBackButton}
|
|
94
98
|
onBackButtonClick={() => {
|
|
@@ -119,6 +123,7 @@ export function SwapCoins({
|
|
|
119
123
|
toTokenAddress,
|
|
120
124
|
}}
|
|
121
125
|
theme={theme}
|
|
126
|
+
subTitle={subTitle}
|
|
122
127
|
/>
|
|
123
128
|
<NotEnoughImx
|
|
124
129
|
environment={checkout?.config.environment ?? Environment.PRODUCTION}
|