@rango-dev/widget-embedded 0.1.16-next.9 → 0.1.16
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/CHANGELOG.md +11 -0
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +7 -7
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +7 -7
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +7 -7
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +10 -10
- package/src/hooks/useTheme.ts +5 -5
- package/src/pages/SettingsPage.tsx +1 -1
- package/src/store/wallets.ts +13 -11
- package/src/utils/wallets.ts +1 -2
|
@@ -394,7 +394,7 @@ function getBalanceFromWallet(connectedWallets, chain, symbol, address) {
|
|
|
394
394
|
return selectedChainWallets.map(wallet => wallet.balances?.find(balance => address !== null && balance.address === address || address === null && balance.address === address && balance.symbol === symbol) || null).filter(balance => balance !== null).sort((a, b) => parseFloat(b?.amount || '0') - parseFloat(a?.amount || '1')).find(() => true) || null;
|
|
395
395
|
}
|
|
396
396
|
function isAccountAndWalletMatched(account, connectedWallet) {
|
|
397
|
-
return account.address === connectedWallet.address && account.chain === connectedWallet.chain
|
|
397
|
+
return account.address === connectedWallet.address && account.chain === connectedWallet.chain;
|
|
398
398
|
}
|
|
399
399
|
function makeBalanceFor(wallet, retrivedBalance, tokens) {
|
|
400
400
|
const {
|
|
@@ -805,7 +805,7 @@ const useWalletsStore = /*#__PURE__*/createSelectors( /*#__PURE__*/create()( /*#
|
|
|
805
805
|
connectWallet: accounts => {
|
|
806
806
|
const getOneOfWalletsDetails = get().getOneOfWalletsDetails;
|
|
807
807
|
set(state => ({
|
|
808
|
-
connectedWallets: state.connectedWallets.concat(accounts.map(account => ({
|
|
808
|
+
connectedWallets: state.connectedWallets.filter(wallet => wallet.walletType !== accounts[0].walletType).concat(accounts.map(account => ({
|
|
809
809
|
balances: [],
|
|
810
810
|
address: account.address,
|
|
811
811
|
chain: account.chain,
|
|
@@ -2595,7 +2595,7 @@ function SettingsPage(_ref) {
|
|
|
2595
2595
|
liquiditySources: supportedUniqueSwappersGroups,
|
|
2596
2596
|
selectedLiquiditySources: supportedUniqueSwappersGroups.filter(s => s.selected),
|
|
2597
2597
|
singleTheme: singleTheme,
|
|
2598
|
-
customSlippage: customSlippage
|
|
2598
|
+
customSlippage: customSlippage,
|
|
2599
2599
|
onCustomSlippageChange: setCustomSlippage,
|
|
2600
2600
|
minSlippage: MIN_SLIPPGAE,
|
|
2601
2601
|
maxSlippage: MAX_SLIPPAGE,
|
|
@@ -3047,7 +3047,7 @@ function usePrevious(value) {
|
|
|
3047
3047
|
function useTheme(_ref) {
|
|
3048
3048
|
let {
|
|
3049
3049
|
colors: themeColors,
|
|
3050
|
-
fontFamily = '
|
|
3050
|
+
fontFamily = 'Roboto',
|
|
3051
3051
|
borderRadius = 8,
|
|
3052
3052
|
mode = 'auto'
|
|
3053
3053
|
} = _ref;
|
|
@@ -3079,7 +3079,7 @@ function useTheme(_ref) {
|
|
|
3079
3079
|
background,
|
|
3080
3080
|
foreground
|
|
3081
3081
|
};
|
|
3082
|
-
const
|
|
3082
|
+
const customLightTheme = createTheme({
|
|
3083
3083
|
colors: lightColors,
|
|
3084
3084
|
radii: {
|
|
3085
3085
|
5: `${borderRadius}px`
|
|
@@ -3088,7 +3088,7 @@ function useTheme(_ref) {
|
|
|
3088
3088
|
s: `0px 3px 5px 3px ${light?.neutral || '#f0f2f5'} ,0px 6px 10px 3px ${light?.neutral || '#f0f2f5'}, 0px 1px 18px 3px ${light?.neutral || '#f0f2f5'}`
|
|
3089
3089
|
}
|
|
3090
3090
|
});
|
|
3091
|
-
const
|
|
3091
|
+
const customDarkTheme = createTheme({
|
|
3092
3092
|
colors: {
|
|
3093
3093
|
...lightColors,
|
|
3094
3094
|
...generateRangeColors('neutral', 'dark', '#111111'),
|
|
@@ -3132,7 +3132,7 @@ function useTheme(_ref) {
|
|
|
3132
3132
|
classList.add(`font_${fontFamily.replace(/ /g, '')}`);
|
|
3133
3133
|
}, [fontFamily]);
|
|
3134
3134
|
const getActiveTheme = () => {
|
|
3135
|
-
if (theme === 'auto') return OSTheme === 'dark' ?
|
|
3135
|
+
if (theme === 'auto') return OSTheme === 'dark' ? customDarkTheme : customLightTheme;else return theme === 'dark' ? customDarkTheme : customLightTheme;
|
|
3136
3136
|
};
|
|
3137
3137
|
return {
|
|
3138
3138
|
activeTheme: getActiveTheme()
|