@rango-dev/widget-embedded 0.23.1-next.20 → 0.23.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/HeaderButtons/HeaderButtons.styles.d.ts +324 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +3 -3
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +19 -1
- package/src/components/HeaderButtons/RefreshButton.tsx +1 -1
- package/src/components/HeaderButtons/WalletButton.tsx +26 -6
- package/src/containers/Settings/Lists.tsx +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.23.1-next.
|
|
3
|
+
"version": "0.23.1-next.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@rango-dev/queue-manager-core": "^0.26.0",
|
|
26
26
|
"@rango-dev/queue-manager-rango-preset": "^0.28.1-next.3",
|
|
27
27
|
"@rango-dev/queue-manager-react": "^0.26.0",
|
|
28
|
-
"@rango-dev/ui": "^0.29.1-next.
|
|
28
|
+
"@rango-dev/ui": "^0.29.1-next.16",
|
|
29
29
|
"@rango-dev/wallets-react": "^0.14.1-next.1",
|
|
30
30
|
"@rango-dev/wallets-shared": "^0.28.1-next.1",
|
|
31
31
|
"bignumber.js": "^9.1.1",
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { darkTheme, IconButton, styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, darkTheme, IconButton, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const HeaderButton = styled(IconButton, {
|
|
4
4
|
width: '$24',
|
|
@@ -76,3 +76,21 @@ export const InProgressTransactionBadgeContainer = styled('div', {
|
|
|
76
76
|
backgroundColor: '$background',
|
|
77
77
|
borderRadius: '100%',
|
|
78
78
|
});
|
|
79
|
+
|
|
80
|
+
export const rowStyles = css({
|
|
81
|
+
display: 'flex',
|
|
82
|
+
flexDirection: 'row',
|
|
83
|
+
justifyContent: 'center',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const WalletImageContainer = styled('div', {
|
|
88
|
+
borderRadius: '100%',
|
|
89
|
+
border: '1.5px transparent solid',
|
|
90
|
+
'&:not(:first-child)': {
|
|
91
|
+
marginLeft: '-$6',
|
|
92
|
+
},
|
|
93
|
+
img: {
|
|
94
|
+
borderRadius: '100%',
|
|
95
|
+
},
|
|
96
|
+
});
|
|
@@ -70,7 +70,7 @@ function RefreshButton({ onClick }: { onClick: (() => void) | undefined }) {
|
|
|
70
70
|
onTransitionEnd={() => setIsRefetched(false)}
|
|
71
71
|
isRefetched={isRefetched}>
|
|
72
72
|
<RefreshProgressButton
|
|
73
|
-
size={
|
|
73
|
+
size={22}
|
|
74
74
|
color={!onClick ? 'gray' : 'black'}
|
|
75
75
|
progress={(elapsedTime / MAX_ELAPSED_TIME) * MAX_PERCENTAGE}
|
|
76
76
|
/>
|
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
import type { PropTypes } from './HeaderButtons.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { Tooltip, WalletIcon } from '@rango-dev/ui';
|
|
4
|
+
import { Image, Tooltip, WalletIcon } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useWalletList } from '../../hooks/useWalletList';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ConnectedIcon,
|
|
11
|
+
HeaderButton,
|
|
12
|
+
rowStyles,
|
|
13
|
+
WalletImageContainer,
|
|
14
|
+
} from './HeaderButtons.styles';
|
|
8
15
|
|
|
9
16
|
function WalletButton(props: PropTypes) {
|
|
17
|
+
const { list } = useWalletList({});
|
|
18
|
+
const connectedWallets = list.filter(
|
|
19
|
+
(wallet) => wallet.state === 'connected'
|
|
20
|
+
);
|
|
21
|
+
const content = !connectedWallets.length ? (
|
|
22
|
+
i18n.t('Connect Wallet')
|
|
23
|
+
) : (
|
|
24
|
+
<div className={rowStyles()}>
|
|
25
|
+
{connectedWallets.map((wallet) => (
|
|
26
|
+
<WalletImageContainer key={wallet.title}>
|
|
27
|
+
<Image src={wallet.image} size={14} />
|
|
28
|
+
</WalletImageContainer>
|
|
29
|
+
))}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
|
|
10
33
|
return (
|
|
11
|
-
<Tooltip
|
|
12
|
-
container={props.container}
|
|
13
|
-
side="top"
|
|
14
|
-
content={i18n.t('Connect Wallet')}>
|
|
34
|
+
<Tooltip container={props.container} side="bottom" content={content}>
|
|
15
35
|
<HeaderButton variant="ghost" size="small" onClick={props.onClick}>
|
|
16
36
|
{props.isConnected && <ConnectedIcon />}
|
|
17
37
|
<WalletIcon size={18} color="black" />
|
|
@@ -50,7 +50,7 @@ const themesList = [
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
id: ThemeModeEnum.DARK,
|
|
53
|
-
icon: <DarkModeIcon color="black" size={
|
|
53
|
+
icon: <DarkModeIcon color="black" size={14} />,
|
|
54
54
|
tooltip: (
|
|
55
55
|
<Typography size="xsmall" variant="body">
|
|
56
56
|
{i18n.t('Dark')}
|
|
@@ -69,7 +69,7 @@ const themesList = [
|
|
|
69
69
|
];
|
|
70
70
|
|
|
71
71
|
const getThemeIcon = (theme: ThemeMode) => {
|
|
72
|
-
const iconProps: SvgIconProps = { color: 'gray', size:
|
|
72
|
+
const iconProps: SvgIconProps = { color: 'gray', size: 14 };
|
|
73
73
|
|
|
74
74
|
switch (theme) {
|
|
75
75
|
case 'auto':
|
|
@@ -156,7 +156,7 @@ export function SettingsLists() {
|
|
|
156
156
|
</>
|
|
157
157
|
),
|
|
158
158
|
onClick: () => navigate(navigationRoutes.bridges),
|
|
159
|
-
start: <BridgeIcon color="gray" size={
|
|
159
|
+
start: <BridgeIcon color="gray" size={14} />,
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
const exchangeItem = {
|
|
@@ -173,7 +173,7 @@ export function SettingsLists() {
|
|
|
173
173
|
<ChevronRightIcon color="gray" />
|
|
174
174
|
</>
|
|
175
175
|
),
|
|
176
|
-
start: <ExchangeIcon color="gray" size={
|
|
176
|
+
start: <ExchangeIcon color="gray" size={14} />,
|
|
177
177
|
onClick: () => navigate(navigationRoutes.exchanges),
|
|
178
178
|
};
|
|
179
179
|
|
|
@@ -184,7 +184,7 @@ export function SettingsLists() {
|
|
|
184
184
|
{i18n.t('Language')}
|
|
185
185
|
</Typography>
|
|
186
186
|
),
|
|
187
|
-
start: <LanguageIcon color="gray" size={
|
|
187
|
+
start: <LanguageIcon color="gray" size={14} />,
|
|
188
188
|
end: <ChevronRightIcon color="gray" />,
|
|
189
189
|
onClick: () => navigate(navigationRoutes.languages),
|
|
190
190
|
};
|
|
@@ -214,7 +214,7 @@ export function SettingsLists() {
|
|
|
214
214
|
</Tooltip>
|
|
215
215
|
</>
|
|
216
216
|
),
|
|
217
|
-
start: <DoneIcon color="gray" size={
|
|
217
|
+
start: <DoneIcon color="gray" size={14} />,
|
|
218
218
|
end: <Switch checked={infiniteApprove} />,
|
|
219
219
|
onClick: toggleInfiniteApprove,
|
|
220
220
|
};
|