@rango-dev/widget-embedded 0.1.11-next.5 → 0.1.11-next.7

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.
@@ -1,4 +1,4 @@
1
- import { WalletState, Typography, InfoCircleIcon, AngleDownIcon, Spacer, Button, TextField, styled, Tooltip, RetryIcon, HistoryIcon, SettingsIcon, Header as Header$1, VerticalSwapIcon, BestRoute, Alert, ChevronRightIcon, GasIcon, ConfirmSwap, History, LiquiditySourcesSelector, BlockchainSelector, TokenSelector, Settings, SecondaryPage, Spinner, LoadingFailedAlert, Wallet, SwapHistory, AddWalletIcon, globalCss, createTheme, SwapContainer } from '@rango-dev/ui';
1
+ import { WalletState, Typography, InfoCircleIcon, AngleDownIcon, Spacer, Button, Image, TextField, styled, Tooltip, RetryIcon, HistoryIcon, SettingsIcon, Header as Header$1, VerticalSwapIcon, BestRoute, Alert, ChevronRightIcon, GasIcon, ConfirmSwap, History, LiquiditySourcesSelector, BlockchainSelector, TokenSelector, Settings, SecondaryPage, Spinner, LoadingFailedAlert, Wallet, SwapHistory, AddWalletIcon, globalCss, createTheme, SwapContainer } from '@rango-dev/ui';
2
2
  import React, { useRef, useEffect, useState, useLayoutEffect } from 'react';
3
3
  import { useInRouterContext as useInRouterContext$1, MemoryRouter, useLocation as useLocation$1, useNavigate as useNavigate$1 } from 'react-router';
4
4
  import { PendingSwapNetworkStatus, useQueueManager, calculatePendingSwap, getCurrentStep, getCurrentBlockchainOfOrNull, getRelatedWalletOrNull, cancelSwap, swapQueueDef, checkWaitingForNetworkChange } from '@rango-dev/queue-manager-rango-preset';
@@ -702,7 +702,10 @@ const createSelectors = _store => {
702
702
  return store;
703
703
  };
704
704
 
705
- const httpService = /*#__PURE__*/new RangoClient(process.env.REACT_APP_API_KEY);
705
+ // this API key is limited and
706
+ // it is only for test purpose
707
+ const RANGO_PUBLIC_API_KEY = 'c6381a79-2817-4602-83bf-6a641a409e32';
708
+ const httpService = /*#__PURE__*/new RangoClient(process.env.REACT_APP_API_KEY || RANGO_PUBLIC_API_KEY);
706
709
 
707
710
  const SLIPPAGES = [0.5, 1, 3, 5, 8, 13, 20];
708
711
  const DEFAULT_SLIPPAGE = 1;
@@ -1343,10 +1346,6 @@ const Container = /*#__PURE__*/styled('div', {
1343
1346
  }
1344
1347
  }
1345
1348
  });
1346
- const StyledImage = /*#__PURE__*/styled('img', {
1347
- width: '$24',
1348
- maxHeight: '$24'
1349
- });
1350
1349
  const Options = /*#__PURE__*/styled('div', {
1351
1350
  display: 'flex',
1352
1351
  justifyContent: 'flex-end',
@@ -1443,8 +1442,9 @@ function TokenInfo(props) {
1443
1442
  variant: "outlined",
1444
1443
  disabled: loadingStatus === 'failed',
1445
1444
  loading: loadingStatus === 'loading',
1446
- prefix: loadingStatus === 'success' && chain ? React.createElement(StyledImage, {
1447
- src: chain.logo
1445
+ prefix: loadingStatus === 'success' && chain ? React.createElement(Image, {
1446
+ src: chain.logo,
1447
+ size: 24
1448
1448
  }) : React.createElement(ImagePlaceholder, null),
1449
1449
  suffix: ItemSuffix,
1450
1450
  align: "start",
@@ -1459,8 +1459,9 @@ function TokenInfo(props) {
1459
1459
  variant: "outlined",
1460
1460
  disabled: loadingStatus === 'failed' || type === 'From' && !fromChain || type === 'To' && !toChain,
1461
1461
  loading: loadingStatus === 'loading',
1462
- prefix: loadingStatus === 'success' && token ? React.createElement(StyledImage, {
1463
- src: token.image
1462
+ prefix: loadingStatus === 'success' && token ? React.createElement(Image, {
1463
+ src: token.image,
1464
+ size: 24
1464
1465
  }) : React.createElement(ImagePlaceholder, null),
1465
1466
  suffix: ItemSuffix,
1466
1467
  size: "large",
@@ -1605,7 +1606,8 @@ function HeaderButtons(props) {
1605
1606
  onClick: onClickRefresh,
1606
1607
  disabled: !onClickRefresh
1607
1608
  }, React.createElement(RetryIcon, {
1608
- size: 24
1609
+ size: 24,
1610
+ disabled: !onClickRefresh
1609
1611
  }))), React.createElement(Tooltip, {
1610
1612
  content: "Transactions History"
1611
1613
  }, React.createElement(Button, {
@@ -1852,10 +1854,6 @@ const Container$3 = /*#__PURE__*/styled('div', {
1852
1854
  }
1853
1855
  }
1854
1856
  });
1855
- const StyledImage$1 = /*#__PURE__*/styled('img', {
1856
- width: '$24',
1857
- maxHeight: '$24'
1858
- });
1859
1857
  const ImagePlaceholder$1 = /*#__PURE__*/styled('span', {
1860
1858
  width: '24px',
1861
1859
  height: '24px',
@@ -1911,8 +1909,9 @@ function TokenPreview(props) {
1911
1909
  className: "selectors",
1912
1910
  variant: "outlined",
1913
1911
  loading: loadingStatus === 'loading',
1914
- prefix: loadingStatus === 'success' && chain ? React.createElement(StyledImage$1, {
1915
- src: chain.logo
1912
+ prefix: loadingStatus === 'success' && chain ? React.createElement(Image, {
1913
+ src: chain.logo,
1914
+ size: 24
1916
1915
  }) : React.createElement(ImagePlaceholder$1, null),
1917
1916
  suffix: ItemSuffix,
1918
1917
  align: "start",
@@ -1923,8 +1922,9 @@ function TokenPreview(props) {
1923
1922
  className: "selectors",
1924
1923
  variant: "outlined",
1925
1924
  loading: loadingStatus === 'loading',
1926
- prefix: loadingStatus === 'success' && token ? React.createElement(StyledImage$1, {
1927
- src: token.image
1925
+ prefix: loadingStatus === 'success' && token ? React.createElement(Image, {
1926
+ src: token.image,
1927
+ size: 24
1928
1928
  }) : React.createElement(ImagePlaceholder$1, null),
1929
1929
  suffix: ItemSuffix,
1930
1930
  size: "large",
@@ -2954,9 +2954,7 @@ const Header = /*#__PURE__*/styled('div', {
2954
2954
  display: 'flex'
2955
2955
  }
2956
2956
  });
2957
- const WalletImage = /*#__PURE__*/styled('img', {
2958
- width: '$24',
2959
- height: '$24',
2957
+ const WalletImageContainer = /*#__PURE__*/styled('div', {
2960
2958
  marginLeft: -15,
2961
2959
  marginRight: '$6',
2962
2960
  borderRadius: '99999px'
@@ -3022,10 +3020,12 @@ function Layout(_ref) {
3022
3020
  onClick: () => {
3023
3021
  if (!connectWalletsButtonDisabled) navigate(navigationRoutes.wallets);
3024
3022
  }
3025
- }, connectedWalletsImages?.length ? connectedWalletsImages.map((walletImage, index) => React.createElement(WalletImage, {
3026
- key: index,
3027
- src: walletImage
3028
- })) : React.createElement(React.Fragment, null), React.createElement("div", {
3023
+ }, connectedWalletsImages?.length ? connectedWalletsImages.map((walletImage, index) => React.createElement(WalletImageContainer, {
3024
+ key: index
3025
+ }, React.createElement(Image, {
3026
+ src: walletImage,
3027
+ size: 24
3028
+ }))) : React.createElement(React.Fragment, null), React.createElement("div", {
3029
3029
  className: "balance"
3030
3030
  }, React.createElement(Typography, {
3031
3031
  variant: "body2"
@@ -3128,6 +3128,9 @@ function useTheme(_ref) {
3128
3128
  colors,
3129
3129
  radii: {
3130
3130
  5: `${borderRadius}px`
3131
+ },
3132
+ shadows: {
3133
+ s: '0px 3px 5px 3px #f0f2f5, 0px 6px 10px 3px #f0f2f5, 0px 1px 18px 3px #f0f2f5'
3131
3134
  }
3132
3135
  });
3133
3136
  const customeDarkTheme = createTheme({
@@ -3146,6 +3149,9 @@ function useTheme(_ref) {
3146
3149
  },
3147
3150
  radii: {
3148
3151
  5: `${borderRadius}px`
3152
+ },
3153
+ shadows: {
3154
+ s: '0px 3px 5px 3px #222, 0px 6px 10px 3px #222, 0px 1px 18px 3px #222'
3149
3155
  }
3150
3156
  });
3151
3157
  const [OSTheme, setOSTheme] = useState(customeLightTheme);