@rango-dev/widget-embedded 0.21.1-next.2 → 0.21.1-next.4
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 +1 -1
- package/dist/components/HistoryGroupedList/HistoryGroupedList.d.ts +4 -0
- package/dist/components/HistoryGroupedList/HistoryGroupedList.d.ts.map +1 -0
- package/dist/components/HistoryGroupedList/HistoryGroupedList.helpers.d.ts +2 -0
- package/dist/components/HistoryGroupedList/HistoryGroupedList.helpers.d.ts.map +1 -0
- package/dist/components/{SwapsGroup/SwapsGroup.styles.d.ts → HistoryGroupedList/HistoryGroupedList.styles.d.ts} +162 -1
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts.map +1 -0
- package/dist/components/{SwapsGroup/SwapsGroup.types.d.ts → HistoryGroupedList/HistoryGroupedList.types.d.ts} +5 -4
- package/dist/components/HistoryGroupedList/HistoryGroupedList.types.d.ts.map +1 -0
- package/dist/components/HistoryGroupedList/index.d.ts +2 -0
- package/dist/components/HistoryGroupedList/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/types/notification.d.ts +4 -4
- package/dist/types/notification.d.ts.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +1 -1
- package/package.json +2 -2
- package/readme.md +1 -0
- package/src/components/HistoryGroupedList/HistoryGroupedList.helpers.ts +17 -0
- package/src/components/{SwapsGroup/SwapsGroup.styles.ts → HistoryGroupedList/HistoryGroupedList.styles.ts} +9 -0
- package/src/components/HistoryGroupedList/HistoryGroupedList.tsx +168 -0
- package/src/components/{SwapsGroup/SwapsGroup.types.ts → HistoryGroupedList/HistoryGroupedList.types.ts} +4 -3
- package/src/components/HistoryGroupedList/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.tsx +13 -22
- package/src/components/NotificationContent/NotificationNotFound.tsx +1 -1
- package/src/components/TokenList/TokenList.tsx +4 -24
- package/src/hooks/useSwapInput.ts +2 -2
- package/src/hooks/useSyncStoresWithConfig.ts +3 -3
- package/src/pages/HistoryPage.tsx +6 -6
- package/src/store/notification.ts +4 -4
- package/src/store/slices/data.ts +2 -2
- package/src/types/notification.ts +4 -4
- package/src/utils/configs.ts +3 -3
- package/src/utils/date.ts +9 -2
- package/src/utils/meta.ts +2 -2
- package/src/utils/wallets.ts +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.d.ts +0 -4
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +0 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +0 -1
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +0 -1
- package/dist/components/SwapsGroup/index.d.ts +0 -2
- package/dist/components/SwapsGroup/index.d.ts.map +0 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +0 -141
- package/src/components/SwapsGroup/index.ts +0 -1
package/src/utils/wallets.ts
CHANGED
|
@@ -443,7 +443,7 @@ export function sortTokens(
|
|
|
443
443
|
return tokens;
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
export function
|
|
446
|
+
export function areTokensEqual(
|
|
447
447
|
tokenA: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null,
|
|
448
448
|
tokenB: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null
|
|
449
449
|
) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwapsGroup.d.ts","sourceRoot":"","sources":["../../../src/components/SwapsGroup/SwapsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,wBAAgB,UAAU,CAAC,KAAK,EAAE,S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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAK5B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwapsGroup.types.d.ts","sourceRoot":"","sources":["../../../src/components/SwapsGroup/SwapsGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,EAAE,CAAC;AAEJ,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SwapsGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import type { PropTypes } from './SwapsGroup.types';
|
|
2
|
-
|
|
3
|
-
import { i18n } from '@lingui/core';
|
|
4
|
-
import { Divider, SwapListItem, Typography } from '@rango-dev/ui';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
TOKEN_AMOUNT_MAX_DECIMALS,
|
|
9
|
-
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
10
|
-
} from '../../constants/routing';
|
|
11
|
-
import { getContainer } from '../../utils/common';
|
|
12
|
-
import { formatTooltipNumbers, numberToString } from '../../utils/numbers';
|
|
13
|
-
|
|
14
|
-
import { Group, groupStyles, SwapList, Time } from './SwapsGroup.styles';
|
|
15
|
-
|
|
16
|
-
export function SwapsGroup(props: PropTypes) {
|
|
17
|
-
const { list, onSwapClick, groupBy, isLoading } = props;
|
|
18
|
-
const groups = groupBy ? groupBy(list) : [{ title: 'History', swaps: list }];
|
|
19
|
-
|
|
20
|
-
if (isLoading) {
|
|
21
|
-
const swaps = [{}, {}];
|
|
22
|
-
|
|
23
|
-
const loadingGroups = [
|
|
24
|
-
{
|
|
25
|
-
title: i18n.t('Today'),
|
|
26
|
-
swaps,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
title: i18n.t('This month'),
|
|
30
|
-
swaps,
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
return (
|
|
34
|
-
<>
|
|
35
|
-
{loadingGroups.map((group) => (
|
|
36
|
-
<React.Fragment key={group.title}>
|
|
37
|
-
<Group>
|
|
38
|
-
<Time>
|
|
39
|
-
<Typography
|
|
40
|
-
variant="label"
|
|
41
|
-
size="medium"
|
|
42
|
-
className={groupStyles()}>
|
|
43
|
-
{group.title}
|
|
44
|
-
</Typography>
|
|
45
|
-
</Time>
|
|
46
|
-
<Divider size={4} />
|
|
47
|
-
<SwapList>
|
|
48
|
-
{group.swaps.map((_, index) => {
|
|
49
|
-
const key = index + group.title;
|
|
50
|
-
return (
|
|
51
|
-
<React.Fragment key={key}>
|
|
52
|
-
<SwapListItem isLoading={true} />
|
|
53
|
-
</React.Fragment>
|
|
54
|
-
);
|
|
55
|
-
})}
|
|
56
|
-
</SwapList>
|
|
57
|
-
</Group>
|
|
58
|
-
</React.Fragment>
|
|
59
|
-
))}
|
|
60
|
-
</>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<>
|
|
66
|
-
{groups
|
|
67
|
-
.filter((group) => group.swaps.length > 0)
|
|
68
|
-
.map((group) => (
|
|
69
|
-
<React.Fragment key={group.title}>
|
|
70
|
-
<Group>
|
|
71
|
-
<Time>
|
|
72
|
-
<Typography
|
|
73
|
-
variant="label"
|
|
74
|
-
size="medium"
|
|
75
|
-
className={groupStyles()}>
|
|
76
|
-
{group.title}
|
|
77
|
-
</Typography>
|
|
78
|
-
</Time>
|
|
79
|
-
<Divider size={4} />
|
|
80
|
-
<SwapList>
|
|
81
|
-
{group.swaps.map((swap) => {
|
|
82
|
-
const firstStep = swap.steps[0];
|
|
83
|
-
|
|
84
|
-
const lastStep = swap.steps[swap.steps.length - 1];
|
|
85
|
-
return (
|
|
86
|
-
<React.Fragment key={swap.requestId}>
|
|
87
|
-
<SwapListItem
|
|
88
|
-
requestId={swap.requestId}
|
|
89
|
-
creationTime={swap.creationTime}
|
|
90
|
-
status={swap.status}
|
|
91
|
-
onClick={onSwapClick}
|
|
92
|
-
tooltipContainer={getContainer()}
|
|
93
|
-
onlyShowTime={group.title === i18n.t('Today')}
|
|
94
|
-
swapTokenData={{
|
|
95
|
-
from: {
|
|
96
|
-
token: {
|
|
97
|
-
image: firstStep.fromLogo,
|
|
98
|
-
displayName: firstStep.fromSymbol,
|
|
99
|
-
},
|
|
100
|
-
blockchain: {
|
|
101
|
-
image: firstStep.fromBlockchainLogo || '',
|
|
102
|
-
},
|
|
103
|
-
amount: numberToString(
|
|
104
|
-
swap.inputAmount,
|
|
105
|
-
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
106
|
-
TOKEN_AMOUNT_MAX_DECIMALS
|
|
107
|
-
),
|
|
108
|
-
realAmount: formatTooltipNumbers(swap.inputAmount),
|
|
109
|
-
},
|
|
110
|
-
to: {
|
|
111
|
-
token: {
|
|
112
|
-
image: lastStep.toLogo,
|
|
113
|
-
displayName: lastStep.toSymbol,
|
|
114
|
-
},
|
|
115
|
-
blockchain: {
|
|
116
|
-
image: lastStep.toBlockchainLogo || '',
|
|
117
|
-
},
|
|
118
|
-
amount: numberToString(
|
|
119
|
-
lastStep.outputAmount ||
|
|
120
|
-
lastStep.expectedOutputAmountHumanReadable ||
|
|
121
|
-
'',
|
|
122
|
-
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
123
|
-
TOKEN_AMOUNT_MAX_DECIMALS
|
|
124
|
-
),
|
|
125
|
-
realAmount: formatTooltipNumbers(
|
|
126
|
-
lastStep.outputAmount ||
|
|
127
|
-
lastStep.expectedOutputAmountHumanReadable
|
|
128
|
-
),
|
|
129
|
-
},
|
|
130
|
-
}}
|
|
131
|
-
/>
|
|
132
|
-
</React.Fragment>
|
|
133
|
-
);
|
|
134
|
-
})}
|
|
135
|
-
</SwapList>
|
|
136
|
-
</Group>
|
|
137
|
-
</React.Fragment>
|
|
138
|
-
))}
|
|
139
|
-
</>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SwapsGroup } from './SwapsGroup';
|