@rango-dev/widget-embedded 0.1.16-next.1 → 0.1.16-next.2
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/components/Layout.d.ts.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +15 -10
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +15 -10
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +15 -10
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +2 -6
- package/src/components/Layout.tsx +22 -18
- package/src/index.tsx +144 -14
- package/dist/App.d.ts +0 -9
- package/dist/App.d.ts.map +0 -1
- package/dist/lib.d.ts +0 -10
- package/dist/lib.d.ts.map +0 -1
- package/src/App.tsx +0 -123
- package/src/app.css +0 -12
- package/src/lib.tsx +0 -144
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/components/Layout.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAwBxC,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/components/Layout.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAwBxC,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,eA+F7C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
+
import { WidgetTheme, WidgetConfig, WidgetColors, BlockchainAndTokenConfig } from './types';
|
|
4
|
+
import './i18n';
|
|
5
|
+
export { WidgetConfig, WalletType, WidgetTheme, WidgetColors, BlockchainAndTokenConfig, };
|
|
6
|
+
export declare type WidgetProps = {
|
|
7
|
+
config?: WidgetConfig;
|
|
8
|
+
};
|
|
9
|
+
export declare const Widget: React.FC<WidgetProps>;
|
|
2
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAW,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAUhE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,QAAQ,CAAC;AAMhB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,wBAAwB,GACzB,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqGxC,CAAC"}
|
|
@@ -2995,20 +2995,24 @@ function Layout(_ref) {
|
|
|
2995
2995
|
t
|
|
2996
2996
|
} = reactI18next.useTranslation();
|
|
2997
2997
|
React.useEffect(() => {
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
2998
|
+
if (loadingMetaStatus === 'success') {
|
|
2999
|
+
const chain = blockchains.find(chain => chain.name === config?.to?.blockchain);
|
|
3000
|
+
const token = tokens.find(t => tokensAreEqual(t, config?.to?.token || null));
|
|
3001
|
+
setToChain(chain || null);
|
|
3002
|
+
setToToken(token || null);
|
|
3003
|
+
}
|
|
3004
|
+
}, [config?.to?.token, config?.to?.blockchain, loadingMetaStatus]);
|
|
3003
3005
|
React.useEffect(() => {
|
|
3004
3006
|
setInputAmount(config?.amount?.toString() || '');
|
|
3005
3007
|
}, [config?.amount]);
|
|
3006
3008
|
React.useEffect(() => {
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3009
|
+
if (loadingMetaStatus === 'success') {
|
|
3010
|
+
const chain = blockchains.find(chain => chain.name === config?.from?.blockchain);
|
|
3011
|
+
const token = tokens.find(t => tokensAreEqual(t, config?.from?.token || null));
|
|
3012
|
+
setFromChain(chain || null);
|
|
3013
|
+
setFromToken(token || null);
|
|
3014
|
+
}
|
|
3015
|
+
}, [config?.from?.token, config?.from?.blockchain, loadingMetaStatus]);
|
|
3012
3016
|
React.useEffect(() => {
|
|
3013
3017
|
setAffiliateRef(config?.affiliateRef || null);
|
|
3014
3018
|
}, [config?.affiliateRef]);
|
|
@@ -3404,6 +3408,7 @@ const Widget = _ref => {
|
|
|
3404
3408
|
providers: providers,
|
|
3405
3409
|
onUpdateState: onUpdateState
|
|
3406
3410
|
}, React__default.createElement("div", {
|
|
3411
|
+
id: "swap-container",
|
|
3407
3412
|
className: activeTheme
|
|
3408
3413
|
}, React__default.createElement(QueueManager, null, React__default.createElement(ui.SwapContainer, {
|
|
3409
3414
|
fixedHeight: currentPage !== navigationRoutes.home
|