@rango-dev/widget-embedded 0.1.16-next.1 → 0.1.16-next.10

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.
Files changed (42) hide show
  1. package/dist/QueueManager.d.ts.map +1 -1
  2. package/dist/components/Layout.d.ts.map +1 -1
  3. package/dist/components/TokenInfo.d.ts.map +1 -1
  4. package/dist/hooks/useTheme.d.ts.map +1 -1
  5. package/dist/index.d.ts +9 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  8. package/dist/pages/SettingsPage.d.ts +2 -1
  9. package/dist/pages/SettingsPage.d.ts.map +1 -1
  10. package/dist/types/config.d.ts +11 -1
  11. package/dist/types/config.d.ts.map +1 -1
  12. package/dist/utils/common.d.ts +0 -1
  13. package/dist/utils/common.d.ts.map +1 -1
  14. package/dist/utils/wallets.d.ts.map +1 -1
  15. package/dist/widget-embedded.cjs.development.js +94 -124
  16. package/dist/widget-embedded.cjs.development.js.map +1 -1
  17. package/dist/widget-embedded.cjs.production.min.js +94 -124
  18. package/dist/widget-embedded.cjs.production.min.js.map +1 -1
  19. package/dist/widget-embedded.esm.js +95 -125
  20. package/dist/widget-embedded.esm.js.map +1 -1
  21. package/package.json +10 -13
  22. package/src/QueueManager.tsx +0 -1
  23. package/src/components/AppRoutes.tsx +1 -1
  24. package/src/components/BottomLogo.tsx +1 -1
  25. package/src/components/Layout.tsx +22 -18
  26. package/src/components/RoutesOverview.tsx +2 -2
  27. package/src/components/TokenInfo.tsx +9 -8
  28. package/src/components/TokenPreview.tsx +6 -6
  29. package/src/hooks/useTheme.ts +42 -59
  30. package/src/index.tsx +144 -14
  31. package/src/pages/ConfirmSwapPage.tsx +25 -17
  32. package/src/pages/SettingsPage.tsx +3 -1
  33. package/src/types/config.ts +8 -1
  34. package/src/utils/common.ts +0 -21
  35. package/src/utils/wallets.ts +1 -11
  36. package/dist/App.d.ts +0 -9
  37. package/dist/App.d.ts.map +0 -1
  38. package/dist/lib.d.ts +0 -10
  39. package/dist/lib.d.ts.map +0 -1
  40. package/src/App.tsx +0 -123
  41. package/src/app.css +0 -12
  42. package/src/lib.tsx +0 -144
@@ -1,4 +1,4 @@
1
- import { WalletState, InfoCircleIcon, Typography, Button, Image, Spacer, styled, ChevronRightIcon, GasIcon, Alert, ConfirmSwap, LoadingFailedAlert, History, AngleDownIcon, TextField, Tooltip, RetryIcon, HistoryIcon, SettingsIcon, Header as Header$1, VerticalSwapIcon, BestRoute, LiquiditySourcesSelector, BlockchainSelector, TokenSelector, Settings, SecondaryPage, Spinner, Wallet, useCopyToClipboard, SwapHistory, AddWalletIcon, globalCss, createTheme, SwapContainer } from '@rango-dev/ui';
1
+ import { WalletState, InfoCircleIcon, Typography, Button, Image, Spacer, styled, ChevronRightIcon, GasIcon, Alert, ConfirmSwap, LoadingFailedAlert, History, AngleDownIcon, TextField, Tooltip, RetryIcon, HistoryIcon, SettingsIcon, Header as Header$1, VerticalSwapIcon, BestRoute, LiquiditySourcesSelector, BlockchainSelector, TokenSelector, Settings, SecondaryPage, Spinner, Wallet, useCopyToClipboard, SwapHistory, AddWalletIcon, globalCss, generateRangeColors, createTheme, SwapContainer } from '@rango-dev/ui';
2
2
  import React, { useRef, useEffect, Fragment, useState, useLayoutEffect, useMemo } from 'react';
3
3
  import { useInRouterContext, MemoryRouter } from 'react-router';
4
4
  import { PendingSwapNetworkStatus, useQueueManager, calculatePendingSwap, getCurrentStep, getCurrentBlockchainOfOrNull, getRelatedWalletOrNull, cancelSwap, makeQueueDefinition, checkWaitingForNetworkChange } from '@rango-dev/queue-manager-rango-preset';
@@ -29,24 +29,6 @@ function removeDuplicateFrom(array) {
29
29
  function areEqual(array1, array2) {
30
30
  return array1.length === array2.length && array1.every((v, i) => v === array2[i]);
31
31
  }
32
- function shadeColor(color, percent) {
33
- var R = parseInt(color.substring(1, 3), 16);
34
- var G = parseInt(color.substring(3, 5), 16);
35
- var B = parseInt(color.substring(5, 7), 16);
36
- R = R * (100 + percent) / 100;
37
- G = G * (100 + percent) / 100;
38
- B = B * (100 + percent) / 100;
39
- R = R < 255 ? R : 255;
40
- G = G < 255 ? G : 255;
41
- B = B < 255 ? B : 255;
42
- R = Math.round(R);
43
- G = Math.round(G);
44
- B = Math.round(B);
45
- var RR = R.toString(16).length == 1 ? '0' + R.toString(16) : R.toString(16);
46
- var GG = G.toString(16).length == 1 ? '0' + G.toString(16) : G.toString(16);
47
- var BB = B.toString(16).length == 1 ? '0' + B.toString(16) : B.toString(16);
48
- return '#' + RR + GG + BB;
49
- }
50
32
  function debounce(fn, time) {
51
33
  let timeoutId;
52
34
  return wrapper;
@@ -310,8 +292,8 @@ function getStateWallet(state) {
310
292
  return WalletState.DISCONNECTED;
311
293
  }
312
294
  }
295
+ const excludedWallets = [WalletType.UNKNOWN, WalletType.LEAP];
313
296
  function getlistWallet(getState, getWalletInfo, list) {
314
- const excludedWallets = [WalletType.UNKNOWN, WalletType.TERRA_STATION, WalletType.LEAP];
315
297
  return list.filter(wallet => !excludedWallets.includes(wallet)).map(type => {
316
298
  const {
317
299
  name,
@@ -1359,10 +1341,10 @@ const Container = /*#__PURE__*/styled('div', {
1359
1341
  variants: {
1360
1342
  type: {
1361
1343
  filled: {
1362
- backgroundColor: '$neutrals300'
1344
+ backgroundColor: '$neutral100'
1363
1345
  },
1364
1346
  outlined: {
1365
- border: '1px solid $neutrals300'
1347
+ border: '1px solid $neutral100'
1366
1348
  }
1367
1349
  }
1368
1350
  },
@@ -1398,14 +1380,14 @@ const Container = /*#__PURE__*/styled('div', {
1398
1380
  const ImagePlaceholder = /*#__PURE__*/styled('span', {
1399
1381
  width: '24px',
1400
1382
  height: '24px',
1401
- backgroundColor: '$neutrals300',
1383
+ backgroundColor: '$neutral100',
1402
1384
  borderRadius: '99999px'
1403
1385
  });
1404
1386
  const OutputContainer = /*#__PURE__*/styled('div', {
1405
1387
  windth: '100%',
1406
1388
  height: '$48',
1407
1389
  borderRadius: '$5',
1408
- backgroundColor: '$background',
1390
+ backgroundColor: '$surface',
1409
1391
  border: '1px solid transparent',
1410
1392
  position: 'relative',
1411
1393
  display: 'flex',
@@ -1439,10 +1421,10 @@ function TokenPreview(props) {
1439
1421
  className: "head"
1440
1422
  }, React.createElement(Typography, {
1441
1423
  variant: "body2",
1442
- color: "neutrals800"
1424
+ color: "neutral800"
1443
1425
  }, props.label), React.createElement("div", null, percentageChange, props.usdValue && React.createElement(Typography, {
1444
1426
  variant: "caption",
1445
- color: "neutrals600",
1427
+ color: "neutral600",
1446
1428
  className: "usd-value"
1447
1429
  }, `$${numberToString(props.usdValue)}`))), React.createElement("div", {
1448
1430
  className: "form"
@@ -1485,8 +1467,8 @@ const Container$1 = /*#__PURE__*/styled('div', {
1485
1467
  justifyContent: 'space-between',
1486
1468
  padding: '$8',
1487
1469
  borderRadius: '$5',
1488
- backgroundColor: '$neutrals300',
1489
- color: '$neutrals800',
1470
+ backgroundColor: '$neutral100',
1471
+ color: '$neutral800',
1490
1472
  fontSize: '$12',
1491
1473
  '.routes': {
1492
1474
  display: 'flex',
@@ -1838,6 +1820,7 @@ function ConfirmSwapPage() {
1838
1820
  const inputUsdValue = useBestRouteStore.use.inputUsdValue();
1839
1821
  const outputUsdValue = useBestRouteStore.use.outputUsdValue();
1840
1822
  const setInputAmount = useBestRouteStore.use.setInputAmount();
1823
+ const [dbErrorMessage, setDbErrorMessage] = useState('');
1841
1824
  const bestRouteloadingStatus = getBestRouteStatus(fetchingBestRoute, !!fetchingBestRouteError);
1842
1825
  const {
1843
1826
  manager
@@ -1872,21 +1855,25 @@ function ConfirmSwapPage() {
1872
1855
  requiredWallets: getRequiredChains(bestRoute),
1873
1856
  selectableWallets: selectableWallets,
1874
1857
  onBack: navigateBackFrom.bind(null, navigationRoutes.confirmSwap),
1875
- onConfirm: () => {
1876
- confirmSwap?.().then(swap => {
1858
+ onConfirm: async () => {
1859
+ confirmSwap?.().then(async swap => {
1877
1860
  if (swap) {
1878
- manager?.create('swap', {
1879
- swapDetails: swap
1880
- }, {
1881
- id: swap.requestId
1882
- });
1883
- setSelectedSwap(swap.requestId);
1884
- navigate('/' + navigationRoutes.swaps + `/${swap.requestId}`, {
1885
- replace: true
1886
- });
1887
- setTimeout(() => {
1888
- setInputAmount('');
1889
- }, 0);
1861
+ try {
1862
+ await manager?.create('swap', {
1863
+ swapDetails: swap
1864
+ }, {
1865
+ id: swap.requestId
1866
+ });
1867
+ setSelectedSwap(swap.requestId);
1868
+ navigate('/' + navigationRoutes.swaps + `/${swap.requestId}`, {
1869
+ replace: true
1870
+ });
1871
+ setTimeout(() => {
1872
+ setInputAmount('');
1873
+ }, 0);
1874
+ } catch (e) {
1875
+ setDbErrorMessage('Error: ' + e?.message);
1876
+ }
1890
1877
  }
1891
1878
  });
1892
1879
  },
@@ -1933,7 +1920,7 @@ function ConfirmSwapPage() {
1933
1920
  totalFee: numberToString(totalFeeInUsd, 0, 2)
1934
1921
  }),
1935
1922
  loading: fetchingConfirmedRoute,
1936
- errors: ConfirmSwapErrors(errors),
1923
+ errors: dbErrorMessage ? [dbErrorMessage, ...ConfirmSwapErrors(errors)] : ConfirmSwapErrors(errors),
1937
1924
  warnings: ConfirmSwapWarnings(warnings),
1938
1925
  extraMessages: React.createElement(React.Fragment, null, loadingMetaStatus === 'failed' && React.createElement(LoadingFailedAlert, null), loadingMetaStatus === 'failed' && showHighSlippageWarning && React.createElement(Spacer, {
1939
1926
  direction: "vertical"
@@ -2027,10 +2014,11 @@ const Container$2 = /*#__PURE__*/styled('div', {
2027
2014
  variants: {
2028
2015
  type: {
2029
2016
  filled: {
2030
- backgroundColor: '$neutrals300'
2017
+ backgroundColor: '$neutral100'
2031
2018
  },
2032
2019
  outlined: {
2033
- border: '1px solid $neutrals300'
2020
+ border: '1px solid $neutral100',
2021
+ backgroundColor: '$surface'
2034
2022
  }
2035
2023
  }
2036
2024
  },
@@ -2078,14 +2066,14 @@ const Options = /*#__PURE__*/styled('div', {
2078
2066
  const ImagePlaceholder$1 = /*#__PURE__*/styled('span', {
2079
2067
  width: '24px',
2080
2068
  height: '24px',
2081
- backgroundColor: '$neutrals300',
2069
+ backgroundColor: '$neutral100',
2082
2070
  borderRadius: '99999px'
2083
2071
  });
2084
2072
  const OutputContainer$1 = /*#__PURE__*/styled('div', {
2085
2073
  windth: '100%',
2086
2074
  height: '$48',
2087
2075
  borderRadius: '$5',
2088
- backgroundColor: '$background',
2076
+ backgroundColor: '$surface',
2089
2077
  border: '1px solid transparent',
2090
2078
  position: 'relative',
2091
2079
  display: 'flex',
@@ -2131,7 +2119,7 @@ function TokenInfo(props) {
2131
2119
  className: "head"
2132
2120
  }, React.createElement(Typography, {
2133
2121
  variant: "body2",
2134
- color: "neutrals800"
2122
+ color: "neutral800"
2135
2123
  }, t(type)), props.type === 'From' ? React.createElement(Options, null, React.createElement("div", {
2136
2124
  className: "balance",
2137
2125
  onClick: () => {
@@ -2139,7 +2127,7 @@ function TokenInfo(props) {
2139
2127
  }
2140
2128
  }, React.createElement(Typography, {
2141
2129
  variant: "body3",
2142
- color: "neutrals600"
2130
+ color: "neutral600"
2143
2131
  }, `${t('Balance')}: ${tokenBalance} ${fromToken?.symbol || ''}`), React.createElement(Spacer, {
2144
2132
  size: 4
2145
2133
  }), React.createElement(Button, {
@@ -2153,7 +2141,7 @@ function TokenInfo(props) {
2153
2141
  outputUsdValue: props.outputUsdValue
2154
2142
  }), React.createElement("div", null, React.createElement(Typography, {
2155
2143
  variant: "caption",
2156
- color: "neutrals600"
2144
+ color: "neutral600"
2157
2145
  }, `$${numberToString(props.outputUsdValue)}`)))), React.createElement("div", {
2158
2146
  className: "form"
2159
2147
  }, React.createElement(Button, {
@@ -2209,7 +2197,7 @@ function TokenInfo(props) {
2209
2197
  }
2210
2198
  }, React.createElement(Typography, {
2211
2199
  variant: "caption",
2212
- color: "neutrals800"
2200
+ color: "neutral800"
2213
2201
  }, `$${numberToString(inputUsdValue)}`)),
2214
2202
  value: props.inputAmount || '',
2215
2203
  min: 0,
@@ -2245,7 +2233,7 @@ function BottomLogo() {
2245
2233
  } = useTranslation();
2246
2234
  return React.createElement(Container$3, null, React.createElement(Typography, {
2247
2235
  variant: "caption",
2248
- color: "$neutrals600"
2236
+ color: "$neutral600"
2249
2237
  }, t('Powered By')), React.createElement(StyledAnchor, {
2250
2238
  href: "https://rango.exchange",
2251
2239
  target: "_blank"
@@ -2563,7 +2551,8 @@ function SelectTokenPage(props) {
2563
2551
 
2564
2552
  function SettingsPage(_ref) {
2565
2553
  let {
2566
- supportedSwappers
2554
+ supportedSwappers,
2555
+ singleTheme
2567
2556
  } = _ref;
2568
2557
  const slippage = useSettingsStore.use.slippage();
2569
2558
  const setSlippage = useSettingsStore.use.setSlippage();
@@ -2605,6 +2594,7 @@ function SettingsPage(_ref) {
2605
2594
  onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
2606
2595
  liquiditySources: supportedUniqueSwappersGroups,
2607
2596
  selectedLiquiditySources: supportedUniqueSwappersGroups.filter(s => s.selected),
2597
+ singleTheme: singleTheme,
2608
2598
  customSlippage: customSlippage || NaN,
2609
2599
  onCustomSlippageChange: setCustomSlippage,
2610
2600
  minSlippage: MIN_SLIPPGAE,
@@ -2916,6 +2906,7 @@ function AppRoutes(props) {
2916
2906
  }, {
2917
2907
  path: navigationRoutes.settings,
2918
2908
  element: React.createElement(SettingsPage, {
2909
+ singleTheme: config?.theme?.singleTheme,
2919
2910
  supportedSwappers: config?.liquiditySources
2920
2911
  })
2921
2912
  }, {
@@ -2987,20 +2978,24 @@ function Layout(_ref) {
2987
2978
  t
2988
2979
  } = useTranslation();
2989
2980
  useEffect(() => {
2990
- const chain = blockchains.find(chain => chain.name === config?.to?.blockchain);
2991
- const token = tokens.find(t => tokensAreEqual(t, config?.to?.token || null));
2992
- setToChain(chain || null);
2993
- setToToken(token || null);
2994
- }, [config?.to?.token, config?.to?.blockchain]);
2981
+ if (loadingMetaStatus === 'success') {
2982
+ const chain = blockchains.find(chain => chain.name === config?.to?.blockchain);
2983
+ const token = tokens.find(t => tokensAreEqual(t, config?.to?.token || null));
2984
+ setToChain(chain || null);
2985
+ setToToken(token || null);
2986
+ }
2987
+ }, [config?.to?.token, config?.to?.blockchain, loadingMetaStatus]);
2995
2988
  useEffect(() => {
2996
2989
  setInputAmount(config?.amount?.toString() || '');
2997
2990
  }, [config?.amount]);
2998
2991
  useEffect(() => {
2999
- const chain = blockchains.find(chain => chain.name === config?.from?.blockchain);
3000
- const token = tokens.find(t => tokensAreEqual(t, config?.from?.token || null));
3001
- setFromChain(chain || null);
3002
- setFromToken(token || null);
3003
- }, [config?.from?.token, config?.from?.blockchain]);
2992
+ if (loadingMetaStatus === 'success') {
2993
+ const chain = blockchains.find(chain => chain.name === config?.from?.blockchain);
2994
+ const token = tokens.find(t => tokensAreEqual(t, config?.from?.token || null));
2995
+ setFromChain(chain || null);
2996
+ setFromToken(token || null);
2997
+ }
2998
+ }, [config?.from?.token, config?.from?.blockchain, loadingMetaStatus]);
3004
2999
  useEffect(() => {
3005
3000
  setAffiliateRef(config?.affiliateRef || null);
3006
3001
  }, [config?.affiliateRef]);
@@ -3059,89 +3054,66 @@ function useTheme(_ref) {
3059
3054
  const theme = useSettingsStore.use.theme();
3060
3055
  const fetchMeta = useMetaStore.use.fetchMeta();
3061
3056
  const setTheme = useSettingsStore.use.setTheme();
3062
- const primary = themeColors?.primary || '#5FA425',
3063
- background = themeColors?.background || '#fff',
3064
- foreground = themeColors?.foreground || '#000',
3065
- error = themeColors?.error || '#FF0000',
3066
- warning = themeColors?.warning || '#F5A623',
3067
- success = themeColors?.success || '#0070F3';
3068
- const colors = {
3069
- neutrals200: '#FAFAFA',
3070
- neutrals300: '#f2f2f2',
3071
- neutrals400: '#dedede',
3072
- neutrals500: '#cccccc',
3073
- neutrals600: '#acacac',
3074
- neutrals700: '#444444',
3075
- neutrals800: '#333333',
3076
- neutrals900: '#111111',
3077
- primary,
3078
- primary100: shadeColor(primary, 15),
3079
- primary200: shadeColor(primary, -10),
3080
- primary300: shadeColor(primary, -15),
3081
- primary400: shadeColor(primary, -20),
3082
- primary500: shadeColor(primary, -25),
3083
- primary600: shadeColor(primary, -30),
3084
- primary700: shadeColor(primary, -35),
3085
- primary800: shadeColor(primary, -40),
3086
- primary900: shadeColor(primary, -45),
3057
+ const light = themeColors?.light;
3058
+ const dark = themeColors?.dark;
3059
+ const neutral = light?.neutral || '#fafafa';
3060
+ const background = light?.background || '#fff';
3061
+ const foreground = light?.foreground || '#000';
3062
+ const darkColors = {
3063
+ ...generateRangeColors('primary', 'dark', dark?.primary),
3064
+ ...generateRangeColors('error', 'dark', dark?.error),
3065
+ ...generateRangeColors('warning', 'dark', dark?.warning),
3066
+ ...generateRangeColors('success', 'dark', dark?.success),
3067
+ ...generateRangeColors('neutral', 'dark', dark?.neutral),
3068
+ surface: dark?.surface,
3069
+ background: dark?.background,
3070
+ foreground: dark?.foreground
3071
+ };
3072
+ const lightColors = {
3073
+ surface: light?.surface || '#fff',
3074
+ ...generateRangeColors('primary', 'light', light?.primary || '#5FA425'),
3075
+ ...generateRangeColors('error', 'light', light?.error || '#FF0000'),
3076
+ ...generateRangeColors('warning', 'light', light?.warning || '#F5A623'),
3077
+ ...generateRangeColors('success', 'light', light?.success || '#0070F3'),
3078
+ ...generateRangeColors('neutral', 'light', neutral),
3087
3079
  background,
3088
- foreground,
3089
- error,
3090
- error100: shadeColor(error, 50),
3091
- error300: shadeColor(error, -10),
3092
- error500: shadeColor(error, -20),
3093
- error700: shadeColor(error, -30),
3094
- warning,
3095
- warning100: shadeColor(warning, 50),
3096
- warning300: shadeColor(warning, -10),
3097
- warning500: shadeColor(warning, -20),
3098
- warning700: shadeColor(warning, -30),
3099
- success,
3100
- success100: shadeColor(success, 50),
3101
- success300: shadeColor(success, -10),
3102
- success500: shadeColor(success, -20),
3103
- success700: shadeColor(success, -30)
3080
+ foreground
3104
3081
  };
3105
3082
  const customeLightTheme = createTheme({
3106
- colors,
3083
+ colors: lightColors,
3107
3084
  radii: {
3108
3085
  5: `${borderRadius}px`
3109
3086
  },
3110
3087
  shadows: {
3111
- s: '0px 3px 5px 3px #f0f2f5, 0px 6px 10px 3px #f0f2f5, 0px 1px 18px 3px #f0f2f5'
3088
+ s: `0px 3px 5px 3px ${light?.neutral || '#f0f2f5'} ,0px 6px 10px 3px ${light?.neutral || '#f0f2f5'}, 0px 1px 18px 3px ${light?.neutral || '#f0f2f5'}`
3112
3089
  }
3113
3090
  });
3114
3091
  const customeDarkTheme = createTheme({
3115
3092
  colors: {
3116
- ...colors,
3117
- neutrals200: '#111111',
3118
- neutrals300: '#333333',
3119
- neutrals400: '#444444',
3120
- neutrals500: '#acacac',
3121
- neutrals600: '#cccccc',
3122
- neutrals700: '#dedede',
3123
- neutrals800: '#f2f2f2',
3124
- neutrals900: '#FAFAFA',
3093
+ ...lightColors,
3094
+ ...generateRangeColors('neutral', 'dark', '#111111'),
3125
3095
  foreground: background,
3126
- background: foreground
3096
+ background: foreground,
3097
+ surface: '#000',
3098
+ ...JSON.parse(JSON.stringify(darkColors))
3127
3099
  },
3128
3100
  radii: {
3129
3101
  5: `${borderRadius}px`
3130
3102
  },
3131
3103
  shadows: {
3132
- s: '0px 3px 5px 3px #222, 0px 6px 10px 3px #222, 0px 1px 18px 3px #222'
3104
+ s: `0px 3px 5px 3px ${dark?.neutral || '#222'}, 0px 6px 10px 3px ${dark?.neutral || '#222'}, 0px 1px 18px 3px ${dark?.neutral || '#222'}`
3133
3105
  }
3134
3106
  });
3135
- const [OSTheme, setOSTheme] = useState(customeLightTheme);
3107
+ const [OSTheme, setOSTheme] = useState('light');
3136
3108
  useEffect(() => {
3137
3109
  (async () => {
3138
3110
  await fetchMeta();
3139
3111
  })();
3140
3112
  const switchTheme = event => {
3141
- if (event.matches) setOSTheme(customeDarkTheme);else setOSTheme(customeLightTheme);
3113
+ if (event.matches) setOSTheme('dark');else setOSTheme('light');
3142
3114
  };
3143
3115
  if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
3144
- setOSTheme(customeDarkTheme);
3116
+ setOSTheme('dark');
3145
3117
  }
3146
3118
  window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', switchTheme);
3147
3119
  return () => {
@@ -3160,7 +3132,7 @@ function useTheme(_ref) {
3160
3132
  classList.add(`font_${fontFamily.replace(/ /g, '')}`);
3161
3133
  }, [fontFamily]);
3162
3134
  const getActiveTheme = () => {
3163
- if (theme === 'auto') return OSTheme;else return theme === 'dark' ? customeDarkTheme : customeLightTheme;
3135
+ if (theme === 'auto') return OSTheme === 'dark' ? customeDarkTheme : customeLightTheme;else return theme === 'dark' ? customeDarkTheme : customeLightTheme;
3164
3136
  };
3165
3137
  return {
3166
3138
  activeTheme: getActiveTheme()
@@ -3315,10 +3287,7 @@ function QueueManager(props) {
3315
3287
  state,
3316
3288
  notifier
3317
3289
  };
3318
- return React.createElement(Provider
3319
- //@ts-ignore
3320
- , {
3321
- //@ts-ignore
3290
+ return React.createElement(Provider, {
3322
3291
  queuesDefs: [swapQueueDef],
3323
3292
  context: context,
3324
3293
  onPersistedDataLoaded: manager => {
@@ -3396,6 +3365,7 @@ const Widget = _ref => {
3396
3365
  providers: providers,
3397
3366
  onUpdateState: onUpdateState
3398
3367
  }, React.createElement("div", {
3368
+ id: "swap-container",
3399
3369
  className: activeTheme
3400
3370
  }, React.createElement(QueueManager, null, React.createElement(SwapContainer, {
3401
3371
  fixedHeight: currentPage !== navigationRoutes.home