@rango-dev/widget-embedded 0.17.1-next.30 → 0.17.1-next.32
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/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +314 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +471 -0
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
- package/dist/components/Quote/QuoteSummary.styles.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 +628 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +942 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +4 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
- package/src/components/Quote/Quote.styles.ts +22 -19
- package/src/components/Quote/Quote.tsx +6 -3
- package/src/components/Quote/QuoteSummary.styles.ts +9 -8
- package/src/components/Quote/QuoteSummary.tsx +2 -2
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -3
- package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
- package/src/components/SwapDetails/SwapDetails.tsx +14 -6
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +14 -8
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +4 -2
- package/src/components/SwapsGroup/SwapsGroup.tsx +3 -3
- package/src/components/TokenList/TokenList.styles.ts +52 -43
- package/src/components/TokenList/TokenList.tsx +13 -5
- package/src/pages/ConfirmSwapPage.tsx +24 -19
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import type { WalletStateContentProps } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { MessageBox, Wallet
|
|
3
|
+
import { MessageBox, Wallet } from '@rango-dev/ui';
|
|
4
4
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { getContainer } from '../../utils/common';
|
|
8
|
+
import { mapStatusToWalletState } from '../../utils/wallets';
|
|
8
9
|
|
|
9
10
|
import { WalletContainer } from './SwapDetailsModal.styles';
|
|
10
11
|
|
|
11
12
|
export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
12
13
|
const { type, title, currentStepWallet, message, showWalletButton } = props;
|
|
13
|
-
const { connect, getWalletInfo, state
|
|
14
|
+
const { connect, getWalletInfo, state } = useWallets();
|
|
14
15
|
const walletType = currentStepWallet?.walletType;
|
|
15
|
-
const
|
|
16
|
-
|
|
16
|
+
const walletState = walletType
|
|
17
|
+
? mapStatusToWalletState(state(walletType))
|
|
18
|
+
: null;
|
|
19
|
+
const walletInfo = walletType ? getWalletInfo(walletType) : null;
|
|
20
|
+
const shouldShowWallet =
|
|
21
|
+
showWalletButton && !!walletType && !!walletState && !!walletInfo;
|
|
17
22
|
return (
|
|
18
23
|
<>
|
|
19
24
|
<MessageBox type={type} title={title} description={message} />
|
|
20
|
-
{
|
|
25
|
+
{shouldShowWallet && (
|
|
21
26
|
<WalletContainer>
|
|
22
27
|
<Wallet
|
|
23
28
|
container={getContainer()}
|
|
24
|
-
title={
|
|
25
|
-
image={
|
|
29
|
+
title={walletInfo.name}
|
|
30
|
+
image={walletInfo.img}
|
|
26
31
|
type={walletType}
|
|
27
|
-
state={
|
|
32
|
+
state={walletState}
|
|
33
|
+
link={walletInfo.installLink}
|
|
28
34
|
onClick={async () => connect(walletType)}
|
|
29
35
|
/>
|
|
30
36
|
</WalletContainer>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { darkTheme, styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, darkTheme, styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const groupStyles = css();
|
|
2
4
|
|
|
3
5
|
export const Group = styled('div', {
|
|
4
6
|
width: '100%',
|
|
5
7
|
display: 'flex',
|
|
6
8
|
flexDirection: 'column',
|
|
7
|
-
|
|
9
|
+
[`& .${groupStyles}`]: {
|
|
8
10
|
$$color: '$colors$neutral600',
|
|
9
11
|
[`.${darkTheme} &`]: {
|
|
10
12
|
$$color: '$colors$neutral700',
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { limitDecimalPlaces } from '../../utils/numbers';
|
|
8
8
|
|
|
9
|
-
import { Group, SwapList, Time } from './SwapsGroup.styles';
|
|
9
|
+
import { Group, groupStyles, SwapList, Time } from './SwapsGroup.styles';
|
|
10
10
|
|
|
11
11
|
export function SwapsGroup(props: PropTypes) {
|
|
12
12
|
const { list, onSwapClick, groupBy, isLoading } = props;
|
|
@@ -34,7 +34,7 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
34
34
|
<Typography
|
|
35
35
|
variant="label"
|
|
36
36
|
size="medium"
|
|
37
|
-
className=
|
|
37
|
+
className={groupStyles()}>
|
|
38
38
|
{i18n.t(group.title)}
|
|
39
39
|
</Typography>
|
|
40
40
|
</Time>
|
|
@@ -67,7 +67,7 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
67
67
|
<Typography
|
|
68
68
|
variant="label"
|
|
69
69
|
size="medium"
|
|
70
|
-
className=
|
|
70
|
+
className={groupStyles()}>
|
|
71
71
|
{i18n.t(group.title)}
|
|
72
72
|
</Typography>
|
|
73
73
|
</Time>
|
|
@@ -1,4 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
css,
|
|
3
|
+
darkTheme,
|
|
4
|
+
ImageContainer,
|
|
5
|
+
styled,
|
|
6
|
+
Typography,
|
|
7
|
+
} from '@rango-dev/ui';
|
|
8
|
+
|
|
9
|
+
export const tokenNameStyles = css({
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
transform: 'none',
|
|
12
|
+
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
13
|
+
textOverflow: 'ellipsis',
|
|
14
|
+
whiteSpace: 'nowrap',
|
|
15
|
+
maxWidth: 100,
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
});
|
|
18
|
+
export const descriptionStyles = css({
|
|
19
|
+
position: 'relative',
|
|
20
|
+
height: 12,
|
|
21
|
+
width: 150,
|
|
22
|
+
});
|
|
23
|
+
export const tokenTitleStyles = css({
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
transform: 'none',
|
|
26
|
+
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
27
|
+
bottom: '-8px',
|
|
28
|
+
});
|
|
29
|
+
export const tokenAddressStyles = css({
|
|
30
|
+
transform: 'translateY(12px)',
|
|
31
|
+
visibility: 'hidden',
|
|
32
|
+
'& a': {
|
|
33
|
+
fontSize: '$12',
|
|
34
|
+
lineHeight: '$16',
|
|
35
|
+
$$color: '$colors$neutral600',
|
|
36
|
+
[`.${darkTheme} &`]: {
|
|
37
|
+
$$color: '$colors$neutral700',
|
|
38
|
+
},
|
|
39
|
+
color: '$$color',
|
|
40
|
+
textDecoration: 'none',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export const tokenWithoutNameStyles = css({});
|
|
44
|
+
export const usdValueStyles = css();
|
|
2
45
|
|
|
3
46
|
export const Container = styled('div', {
|
|
4
47
|
display: 'flex',
|
|
@@ -23,58 +66,25 @@ export const List = styled('ul', {
|
|
|
23
66
|
listStyle: 'none',
|
|
24
67
|
'& li': {
|
|
25
68
|
alignItems: 'none',
|
|
26
|
-
'.description': {
|
|
27
|
-
position: 'relative',
|
|
28
|
-
height: 12,
|
|
29
|
-
width: 150,
|
|
30
|
-
'.token-title': {
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
transform: 'none',
|
|
33
|
-
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
34
|
-
bottom: '-8px',
|
|
35
|
-
},
|
|
36
69
|
|
|
37
|
-
'.token-address': {
|
|
38
|
-
transform: 'translateY(12px)',
|
|
39
|
-
visibility: 'hidden',
|
|
40
|
-
'& a': {
|
|
41
|
-
fontSize: '$12',
|
|
42
|
-
lineHeight: '$16',
|
|
43
|
-
$$color: '$colors$neutral600',
|
|
44
|
-
[`.${darkTheme} &`]: {
|
|
45
|
-
$$color: '$colors$neutral700',
|
|
46
|
-
},
|
|
47
|
-
color: '$$color',
|
|
48
|
-
textDecoration: 'none',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
'.token-name': {
|
|
52
|
-
position: 'absolute',
|
|
53
|
-
transform: 'none',
|
|
54
|
-
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
55
|
-
textOverflow: 'ellipsis',
|
|
56
|
-
whiteSpace: 'nowrap',
|
|
57
|
-
maxWidth: 100,
|
|
58
|
-
overflow: 'hidden',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
70
|
'&:hover': {
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
[`& .${descriptionStyles}`]: {
|
|
72
|
+
[`& .${tokenAddressStyles}`]: {
|
|
64
73
|
position: 'absolute',
|
|
65
74
|
transform: 'none',
|
|
66
75
|
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
67
76
|
visibility: 'visible',
|
|
68
77
|
},
|
|
69
|
-
|
|
78
|
+
|
|
79
|
+
[`& .${tokenWithoutNameStyles}`]: {
|
|
70
80
|
bottom: '-15px',
|
|
71
81
|
},
|
|
72
|
-
|
|
82
|
+
[`& .${tokenNameStyles}`]: {
|
|
73
83
|
position: 'absolute',
|
|
74
84
|
transform: 'translateY(-12px)',
|
|
75
85
|
visibility: 'hidden',
|
|
76
86
|
},
|
|
77
|
-
|
|
87
|
+
[`& .${tokenTitleStyles}`]: {
|
|
78
88
|
position: 'absolute',
|
|
79
89
|
transform: 'translateY(-12px)',
|
|
80
90
|
bottom: '-10px',
|
|
@@ -96,8 +106,7 @@ export const TagTitle = styled(Typography, {});
|
|
|
96
106
|
|
|
97
107
|
export const BalanceContainer = styled('div', {
|
|
98
108
|
textAlign: 'right',
|
|
99
|
-
|
|
100
|
-
'.usd-value': {
|
|
109
|
+
[`& .${usdValueStyles}`]: {
|
|
101
110
|
$$color: '$colors$neutral600',
|
|
102
111
|
[`.${darkTheme} &`]: {
|
|
103
112
|
$$color: '$colors$neutral700',
|
|
@@ -118,7 +127,7 @@ export const Description = styled('div', {
|
|
|
118
127
|
});
|
|
119
128
|
export const ImageSection = styled('div', {
|
|
120
129
|
position: 'relative',
|
|
121
|
-
|
|
130
|
+
[`& ${ImageContainer}`]: {
|
|
122
131
|
borderRadius: '$xm',
|
|
123
132
|
overflow: 'hidden',
|
|
124
133
|
},
|
|
@@ -27,6 +27,7 @@ import { LoadingTokenList } from './LoadingTokenList';
|
|
|
27
27
|
import {
|
|
28
28
|
BalanceContainer,
|
|
29
29
|
Container,
|
|
30
|
+
descriptionStyles,
|
|
30
31
|
End,
|
|
31
32
|
ImageSection,
|
|
32
33
|
List,
|
|
@@ -34,6 +35,11 @@ import {
|
|
|
34
35
|
Tag,
|
|
35
36
|
TagTitle,
|
|
36
37
|
Title,
|
|
38
|
+
tokenAddressStyles,
|
|
39
|
+
tokenNameStyles,
|
|
40
|
+
tokenTitleStyles,
|
|
41
|
+
tokenWithoutNameStyles,
|
|
42
|
+
usdValueStyles,
|
|
37
43
|
} from './TokenList.styles';
|
|
38
44
|
|
|
39
45
|
const PAGE_SIZE = 20;
|
|
@@ -44,11 +50,11 @@ const renderDesc = (props: RenderDescProps) => {
|
|
|
44
50
|
const length = address.length;
|
|
45
51
|
|
|
46
52
|
return (
|
|
47
|
-
<div className=
|
|
53
|
+
<div className={descriptionStyles()}>
|
|
48
54
|
{name ? (
|
|
49
|
-
<div className=
|
|
55
|
+
<div className={tokenNameStyles()}>{name}</div>
|
|
50
56
|
) : (
|
|
51
|
-
<Title className=
|
|
57
|
+
<Title className={tokenTitleStyles()}>
|
|
52
58
|
<Typography variant="title" size="xmedium">
|
|
53
59
|
{token.symbol}
|
|
54
60
|
</Typography>
|
|
@@ -63,7 +69,9 @@ const renderDesc = (props: RenderDescProps) => {
|
|
|
63
69
|
|
|
64
70
|
{!!address && (
|
|
65
71
|
<div
|
|
66
|
-
className={
|
|
72
|
+
className={`${tokenAddressStyles()} ${
|
|
73
|
+
!name && tokenWithoutNameStyles()
|
|
74
|
+
}`}>
|
|
67
75
|
<a
|
|
68
76
|
href={url}
|
|
69
77
|
target="_blank"
|
|
@@ -236,7 +244,7 @@ export function TokenList(props: PropTypes) {
|
|
|
236
244
|
{tokenBalance.usdValue && (
|
|
237
245
|
<Typography
|
|
238
246
|
variant="body"
|
|
239
|
-
className=
|
|
247
|
+
className={usdValueStyles()}
|
|
240
248
|
size="xsmall">
|
|
241
249
|
{`$${tokenBalance.usdValue}`}
|
|
242
250
|
</Typography>
|
|
@@ -9,6 +9,7 @@ import { useManager } from '@rango-dev/queue-manager-react';
|
|
|
9
9
|
import {
|
|
10
10
|
Alert,
|
|
11
11
|
Button,
|
|
12
|
+
css,
|
|
12
13
|
Divider,
|
|
13
14
|
IconButton,
|
|
14
15
|
RefreshIcon,
|
|
@@ -40,18 +41,7 @@ import { getContainer } from '../utils/common';
|
|
|
40
41
|
const Container = styled('div', {
|
|
41
42
|
position: 'relative',
|
|
42
43
|
width: '100%',
|
|
43
|
-
|
|
44
|
-
display: 'flex',
|
|
45
|
-
justifyContent: 'space-between',
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
},
|
|
48
|
-
'& .icon': {
|
|
49
|
-
width: '$24',
|
|
50
|
-
height: '$24',
|
|
51
|
-
display: 'flex',
|
|
52
|
-
justifyContent: 'center',
|
|
53
|
-
alignItems: 'center',
|
|
54
|
-
},
|
|
44
|
+
|
|
55
45
|
'& .quote-update__alert': {
|
|
56
46
|
paddingTop: '$10',
|
|
57
47
|
},
|
|
@@ -61,16 +51,31 @@ const Buttons = styled('div', {
|
|
|
61
51
|
width: '100%',
|
|
62
52
|
display: 'flex',
|
|
63
53
|
justifyContent: 'space-between',
|
|
64
|
-
'& .confirm-button': {
|
|
65
|
-
flexGrow: 1,
|
|
66
|
-
paddingRight: '$10',
|
|
67
|
-
},
|
|
68
54
|
[`& ${IconButton}`]: {
|
|
69
55
|
width: '$48',
|
|
70
56
|
height: '$48',
|
|
71
57
|
},
|
|
72
58
|
});
|
|
73
59
|
|
|
60
|
+
const confirmBtnStyles = css({
|
|
61
|
+
flexGrow: 1,
|
|
62
|
+
paddingRight: '$10',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const iconStyles = css({
|
|
66
|
+
width: '$24',
|
|
67
|
+
height: '$24',
|
|
68
|
+
display: 'flex',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const descriptionStyles = css({
|
|
74
|
+
display: 'flex',
|
|
75
|
+
justifyContent: 'space-between',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
});
|
|
78
|
+
|
|
74
79
|
export function ConfirmSwapPage() {
|
|
75
80
|
//TODO: move component's logics to a custom hook
|
|
76
81
|
const {
|
|
@@ -282,7 +287,7 @@ export function ConfirmSwapPage() {
|
|
|
282
287
|
}}
|
|
283
288
|
footer={
|
|
284
289
|
<Buttons>
|
|
285
|
-
<div className=
|
|
290
|
+
<div className={confirmBtnStyles()}>
|
|
286
291
|
<Button
|
|
287
292
|
variant="contained"
|
|
288
293
|
type="primary"
|
|
@@ -315,7 +320,7 @@ export function ConfirmSwapPage() {
|
|
|
315
320
|
)}
|
|
316
321
|
|
|
317
322
|
<Container>
|
|
318
|
-
<div className=
|
|
323
|
+
<div className={descriptionStyles()}>
|
|
319
324
|
<Typography variant="title" size="small">
|
|
320
325
|
{i18n.t('You get')}
|
|
321
326
|
</Typography>
|
|
@@ -324,7 +329,7 @@ export function ConfirmSwapPage() {
|
|
|
324
329
|
variant="ghost"
|
|
325
330
|
disabled={fetchingConfirmationQuote}
|
|
326
331
|
onClick={onRefresh}>
|
|
327
|
-
<div className=
|
|
332
|
+
<div className={iconStyles()}>
|
|
328
333
|
<RefreshIcon size={16} />
|
|
329
334
|
</div>
|
|
330
335
|
</Button>
|