@rango-dev/widget-embedded 0.20.1-next.20 → 0.20.1-next.21
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/BlockchainList/BlockchainList.styles.d.ts +161 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +0 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts +2 -3
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.helpers.d.ts +2 -0
- package/dist/components/Layout/Layout.helpers.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +2 -4
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +6 -3
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/Layout/PageContainer.d.ts +166 -0
- package/dist/components/Layout/PageContainer.d.ts.map +1 -0
- package/dist/components/Layout/ScrollableArea.d.ts +164 -0
- package/dist/components/Layout/ScrollableArea.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +0 -161
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/SettingsContainer/index.d.ts +1 -1
- package/dist/components/SettingsContainer/index.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +161 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +0 -324
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -7
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +2 -0
- package/dist/utils/ui.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/BlockchainList/BlockchainList.styles.ts +4 -3
- package/src/components/BlockchainList/BlockchainList.tsx +1 -1
- package/src/components/HeaderButtons/HeaderButtons.types.ts +0 -1
- package/src/components/HeaderButtons/HomeButtons.tsx +1 -2
- package/src/components/Layout/Layout.helpers.ts +16 -0
- package/src/components/Layout/Layout.styles.ts +17 -31
- package/src/components/Layout/Layout.tsx +23 -21
- package/src/components/Layout/Layout.types.ts +9 -8
- package/src/components/Layout/PageContainer.tsx +24 -0
- package/src/components/Layout/ScrollableArea.tsx +11 -0
- package/src/components/Layout/index.ts +2 -0
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +0 -1
- package/src/components/SettingsContainer/SettingsContainer.style.ts +0 -5
- package/src/components/SettingsContainer/index.ts +0 -1
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +5 -6
- package/src/components/SwapDetails/SwapDetails.tsx +3 -5
- package/src/components/TokenList/TokenList.styles.ts +2 -0
- package/src/components/TokenList/TokenList.tsx +1 -1
- package/src/containers/App/App.styles.ts +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
- package/src/containers/QuoteInfo/QuoteInfo.tsx +30 -77
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -7
- package/src/pages/ConfirmSwapPage.tsx +49 -42
- package/src/pages/HistoryPage.tsx +4 -11
- package/src/pages/Home.tsx +35 -37
- package/src/pages/LanguagePage.tsx +3 -4
- package/src/pages/LiquiditySourcePage.tsx +3 -4
- package/src/pages/SelectBlockchainPage.tsx +38 -38
- package/src/pages/SelectSwapItemsPage.tsx +40 -38
- package/src/pages/SettingsPage.tsx +3 -4
- package/src/pages/ThemePage.tsx +3 -4
- package/src/pages/WalletsPage.tsx +12 -13
- package/src/utils/ui.ts +20 -0
|
@@ -6,7 +6,7 @@ import React, { useState } from 'react';
|
|
|
6
6
|
import { useNavigate } from 'react-router-dom';
|
|
7
7
|
|
|
8
8
|
import { BlockchainsSection } from '../components/BlockchainsSection';
|
|
9
|
-
import { Layout } from '../components/Layout';
|
|
9
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
10
10
|
import { SearchInput } from '../components/SearchInput';
|
|
11
11
|
import { TokenList } from '../components/TokenList/TokenList';
|
|
12
12
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
@@ -78,45 +78,47 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
78
78
|
header={{
|
|
79
79
|
title: i18n.t('Swap {type}', { type: types[type] }),
|
|
80
80
|
}}>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
81
|
+
<PageContainer>
|
|
82
|
+
<BlockchainsSection
|
|
83
|
+
blockchains={blockchains}
|
|
84
|
+
type={type == 'source' ? 'from' : 'to'}
|
|
85
|
+
blockchain={type === 'source' ? fromBlockchain : toBlockchain}
|
|
86
|
+
onMoreClick={() => navigate(navigationRoutes.blockchains)}
|
|
87
|
+
onChange={(blockchain) => {
|
|
88
|
+
updateBlockchain(blockchain);
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
<Divider size={24} />
|
|
92
|
+
<SearchInput
|
|
93
|
+
value={searchedFor}
|
|
94
|
+
autoFocus
|
|
95
|
+
placeholder={i18n.t('Search Token')}
|
|
96
|
+
color="light"
|
|
97
|
+
variant="contained"
|
|
98
|
+
size="large"
|
|
99
|
+
setValue={() => setSearchedFor('')}
|
|
100
|
+
onChange={(event) => setSearchedFor(event.target.value)}
|
|
101
|
+
/>
|
|
102
|
+
<Divider size={16} />
|
|
103
|
+
<TokenList
|
|
104
|
+
list={tokensList}
|
|
105
|
+
selectedBlockchain={selectedBlockchainName}
|
|
106
|
+
searchedFor={searchedFor}
|
|
107
|
+
type={type}
|
|
108
|
+
onChange={(token) => {
|
|
109
|
+
updateToken(token);
|
|
109
110
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
const tokenBlockchain = blockchains.find(
|
|
112
|
+
(chain) => token.blockchain === chain.name
|
|
113
|
+
);
|
|
114
|
+
if (tokenBlockchain) {
|
|
115
|
+
updateBlockchain(tokenBlockchain);
|
|
116
|
+
}
|
|
116
117
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
navigateBack();
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
</PageContainer>
|
|
120
122
|
</Layout>
|
|
121
123
|
);
|
|
122
124
|
}
|
|
@@ -13,8 +13,7 @@ import {
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { useNavigate } from 'react-router-dom';
|
|
15
15
|
|
|
16
|
-
import { Layout } from '../components/Layout';
|
|
17
|
-
import { SettingsContainer } from '../components/SettingsContainer';
|
|
16
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
18
17
|
import { Slippage } from '../components/Slippage';
|
|
19
18
|
import { SlippageTooltipContainer as TooltipContainer } from '../components/Slippage/Slippage.styles';
|
|
20
19
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
@@ -183,7 +182,7 @@ export function SettingsPage() {
|
|
|
183
182
|
header={{
|
|
184
183
|
title: i18n.t('Settings'),
|
|
185
184
|
}}>
|
|
186
|
-
<
|
|
185
|
+
<PageContainer>
|
|
187
186
|
<Slippage />
|
|
188
187
|
<List
|
|
189
188
|
type={
|
|
@@ -191,7 +190,7 @@ export function SettingsPage() {
|
|
|
191
190
|
}
|
|
192
191
|
items={settingItems}
|
|
193
192
|
/>
|
|
194
|
-
</
|
|
193
|
+
</PageContainer>
|
|
195
194
|
</Layout>
|
|
196
195
|
);
|
|
197
196
|
}
|
package/src/pages/ThemePage.tsx
CHANGED
|
@@ -11,8 +11,7 @@ import {
|
|
|
11
11
|
} from '@rango-dev/ui';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
-
import { Layout } from '../components/Layout';
|
|
15
|
-
import { SettingsContainer } from '../components/SettingsContainer';
|
|
14
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
16
15
|
import { useAppStore } from '../store/AppStore';
|
|
17
16
|
|
|
18
17
|
type Theme = 'dark' | 'light' | 'auto';
|
|
@@ -70,7 +69,7 @@ export function ThemePage() {
|
|
|
70
69
|
header={{
|
|
71
70
|
title: i18n.t('Theme'),
|
|
72
71
|
}}>
|
|
73
|
-
<
|
|
72
|
+
<PageContainer>
|
|
74
73
|
<RadioRoot
|
|
75
74
|
onValueChange={(value) => setTheme(value as Theme)}
|
|
76
75
|
value={theme}>
|
|
@@ -85,7 +84,7 @@ export function ThemePage() {
|
|
|
85
84
|
items={themesList}
|
|
86
85
|
/>
|
|
87
86
|
</RadioRoot>
|
|
88
|
-
</
|
|
87
|
+
</PageContainer>
|
|
89
88
|
</Layout>
|
|
90
89
|
);
|
|
91
90
|
}
|
|
@@ -2,9 +2,9 @@ import type { WalletType } from '@rango-dev/wallets-shared';
|
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
import { styled, Typography, Wallet, WalletState } from '@rango-dev/ui';
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Layout } from '../components/Layout';
|
|
7
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
8
8
|
import { WalletModal } from '../components/WalletModal';
|
|
9
9
|
import { useWalletList } from '../hooks/useWalletList';
|
|
10
10
|
import { useAppStore } from '../store/AppStore';
|
|
@@ -20,7 +20,7 @@ const ListContainer = styled('div', {
|
|
|
20
20
|
height: '100%',
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const Container = styled(
|
|
23
|
+
const Container = styled(PageContainer, {
|
|
24
24
|
textAlign: 'center',
|
|
25
25
|
});
|
|
26
26
|
|
|
@@ -71,16 +71,15 @@ export function WalletsPage() {
|
|
|
71
71
|
{list.map((wallet, index) => {
|
|
72
72
|
const key = `wallet-${index}-${wallet.type}`;
|
|
73
73
|
return (
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</Fragment>
|
|
74
|
+
<Wallet
|
|
75
|
+
key={key}
|
|
76
|
+
{...wallet}
|
|
77
|
+
container={getContainer()}
|
|
78
|
+
onClick={(type) => {
|
|
79
|
+
void handleClick(type);
|
|
80
|
+
}}
|
|
81
|
+
isLoading={fetchMetaStatus === 'loading'}
|
|
82
|
+
/>
|
|
84
83
|
);
|
|
85
84
|
})}
|
|
86
85
|
<WalletModal
|
package/src/utils/ui.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
2
|
import type { WidgetTheme } from '../types';
|
|
3
3
|
import type { createTheme } from '@rango-dev/ui';
|
|
4
|
+
import type React from 'react';
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
theme as baseThemeTokens,
|
|
@@ -70,3 +71,22 @@ export function customizedThemeTokens(
|
|
|
70
71
|
dark,
|
|
71
72
|
};
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
export function joinList(
|
|
76
|
+
list: React.JSX.Element[],
|
|
77
|
+
divider: React.JSX.Element
|
|
78
|
+
) {
|
|
79
|
+
if (list.length <= 1) {
|
|
80
|
+
return list;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const output: React.JSX.Element[] = [];
|
|
84
|
+
list.forEach((item, index) => {
|
|
85
|
+
output.push(item);
|
|
86
|
+
if (index < list.length - 1) {
|
|
87
|
+
output.push(divider);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return output;
|
|
92
|
+
}
|