@rango-dev/ui 0.1.11-next.6 → 0.1.11
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/SwapDetail/Token.d.ts +1 -0
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +4 -2
- package/dist/containers/History/History.d.ts +5 -12
- package/dist/containers/History/SwapsGroup.d.ts +13 -0
- package/dist/containers/History/index.d.ts +2 -1
- package/dist/ui.cjs.development.js +130 -95
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +130 -96
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +3 -3
- package/src/components/BlockchainSelector/BlockchainSelector.tsx +23 -21
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/Settings/Settings.tsx +7 -6
- package/src/components/StepDetail/StepDetail.tsx +7 -4
- package/src/components/SwapContainer/SwapContainer.tsx +1 -2
- package/src/components/SwapDetail/SwapDetail.tsx +4 -14
- package/src/components/SwapDetail/Token.tsx +14 -8
- package/src/components/TextField/TextField.tsx +8 -0
- package/src/components/TokenSelector/TokenSelector.tsx +1 -1
- package/src/components/Typography/Typography.tsx +11 -3
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +9 -9
- package/src/containers/History/History.tsx +28 -71
- package/src/containers/History/SwapsGroup.tsx +59 -0
- package/src/containers/History/index.ts +2 -1
- package/src/containers/SwapHistory/SwapHistory.tsx +61 -62
|
@@ -52,7 +52,8 @@ export const ErrorMsg = styled(Typography, {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
export const FeeContainer = styled('div', {
|
|
55
|
-
paddingLeft: '$
|
|
55
|
+
paddingLeft: '$16',
|
|
56
|
+
color: '$neutrals800'
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
export const Fee = styled('div', {
|
|
@@ -89,7 +90,6 @@ export const ArrowDown = styled('div', {
|
|
|
89
90
|
const StyledAnchor = styled('a', {
|
|
90
91
|
color: '$primary',
|
|
91
92
|
fontWeight: '$600',
|
|
92
|
-
marginLeft: '$12',
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
const SwapInfoContainer = styled('div', {
|
|
@@ -101,11 +101,14 @@ const SwapInfoContainer = styled('div', {
|
|
|
101
101
|
|
|
102
102
|
const InternalDetailsContainer = styled('div', {
|
|
103
103
|
display: 'flex',
|
|
104
|
+
'.details': {
|
|
105
|
+
padding: '$8 0',
|
|
106
|
+
},
|
|
104
107
|
});
|
|
105
108
|
|
|
106
109
|
const InternalDetail = styled('div', {
|
|
107
110
|
display: 'flex',
|
|
108
|
-
|
|
111
|
+
margin: '$12 0 $12 $20',
|
|
109
112
|
});
|
|
110
113
|
|
|
111
114
|
const DescriptionContainer = styled('div', {
|
|
@@ -115,7 +118,7 @@ const DescriptionContainer = styled('div', {
|
|
|
115
118
|
|
|
116
119
|
const Description = styled(Typography, {
|
|
117
120
|
color: '$success',
|
|
118
|
-
|
|
121
|
+
paddingLeft: '$4',
|
|
119
122
|
});
|
|
120
123
|
|
|
121
124
|
export const Line = styled('div', {
|
|
@@ -140,6 +143,7 @@ const Row = styled('div', {
|
|
|
140
143
|
display: 'flex',
|
|
141
144
|
alignItems: 'center',
|
|
142
145
|
color: '$neutrals800',
|
|
146
|
+
justifyContent: 'flex-end',
|
|
143
147
|
},
|
|
144
148
|
'.status': {
|
|
145
149
|
fontWeight: 'bold',
|
|
@@ -164,14 +168,14 @@ const RequestId = styled('div', {
|
|
|
164
168
|
});
|
|
165
169
|
|
|
166
170
|
const ExtraDetails = styled('div', {
|
|
167
|
-
padding: '
|
|
171
|
+
padding: '0',
|
|
168
172
|
color: '$neutrals600',
|
|
169
|
-
fontSize: '$
|
|
173
|
+
fontSize: '$10',
|
|
170
174
|
});
|
|
171
175
|
|
|
172
176
|
const SwapFlowContainer = styled('div', {
|
|
173
177
|
overflowY: 'auto',
|
|
174
|
-
|
|
178
|
+
padding: '$8 $4 $2 $4',
|
|
175
179
|
});
|
|
176
180
|
|
|
177
181
|
export type PropTypes = {
|
|
@@ -232,28 +236,29 @@ export function SwapHistory(props: PropTypes) {
|
|
|
232
236
|
<div>
|
|
233
237
|
<SwapInfoContainer>
|
|
234
238
|
<Row>
|
|
235
|
-
<div className="name">
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
<div className="name">
|
|
240
|
+
Request Id:
|
|
241
|
+
<span
|
|
242
|
+
className="value requestId"
|
|
243
|
+
onClick={onCopy.bind(null, pendingSwap?.requestId)}
|
|
244
|
+
>
|
|
245
|
+
<RequestId>{pendingSwap?.requestId}</RequestId>
|
|
246
|
+
<Spacer size={4} />
|
|
247
|
+
<Button type="primary" variant="ghost" size="compact">
|
|
248
|
+
{isCopied ? 'Copied!' : 'Copy'}
|
|
249
|
+
</Button>
|
|
250
|
+
</span>
|
|
245
251
|
</div>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
<div className="name">
|
|
253
|
+
<span className={`value status ${pendingSwap?.status || ''}`}>
|
|
254
|
+
{pendingSwap?.status}
|
|
255
|
+
{pendingSwap?.status === 'running' && (
|
|
256
|
+
<Spinner size={16} color="primary" />
|
|
257
|
+
)}
|
|
258
|
+
</span>
|
|
259
|
+
<ExtraDetails>{date}</ExtraDetails>
|
|
254
260
|
</div>
|
|
255
261
|
</Row>
|
|
256
|
-
<ExtraDetails>{date}</ExtraDetails>
|
|
257
262
|
</SwapInfoContainer>
|
|
258
263
|
{/* TODO: It was temporarily removed to find a better solution.
|
|
259
264
|
|
|
@@ -266,7 +271,7 @@ export function SwapHistory(props: PropTypes) {
|
|
|
266
271
|
<SwapMessages {...extraMessageProps} />
|
|
267
272
|
)}
|
|
268
273
|
|
|
269
|
-
<Divider size={
|
|
274
|
+
<Divider size={16} />
|
|
270
275
|
|
|
271
276
|
{pendingSwap?.steps.map((step, index) => (
|
|
272
277
|
<div key={index}>
|
|
@@ -294,13 +299,13 @@ export function SwapHistory(props: PropTypes) {
|
|
|
294
299
|
/>
|
|
295
300
|
|
|
296
301
|
<FeeContainer>
|
|
297
|
-
<Typography variant="
|
|
298
|
-
{step.swapperType
|
|
299
|
-
|
|
302
|
+
<Typography variant="body2">
|
|
303
|
+
{step.swapperType === 'DEX' ? 'Swap' : 'Bridge'} via{' '}
|
|
304
|
+
{step.swapperId}
|
|
300
305
|
</Typography>
|
|
301
306
|
<Fee>
|
|
302
307
|
<GasIcon />
|
|
303
|
-
<Typography variant="
|
|
308
|
+
<Typography variant="body2">
|
|
304
309
|
${step.feeInUsd} estimated gas fee
|
|
305
310
|
</Typography>
|
|
306
311
|
</Fee>
|
|
@@ -313,34 +318,34 @@ export function SwapHistory(props: PropTypes) {
|
|
|
313
318
|
>
|
|
314
319
|
<InternalDetailsContainer>
|
|
315
320
|
<Line />
|
|
316
|
-
<div>
|
|
321
|
+
<div className="details">
|
|
317
322
|
{!!step.explorerUrl && (
|
|
318
323
|
<div>
|
|
319
324
|
{step.explorerUrl.map((item, index) => (
|
|
320
325
|
<InternalDetail key={index}>
|
|
321
326
|
<DescriptionContainer>
|
|
322
|
-
<
|
|
327
|
+
<Divider size={4} />
|
|
328
|
+
<CheckCircleIcon color="primary" />
|
|
323
329
|
<Description variant="body2">
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
<StyledAnchor
|
|
331
|
+
href={item.url}
|
|
332
|
+
target="_blank"
|
|
333
|
+
rel="noreferrer"
|
|
334
|
+
key={index}
|
|
335
|
+
>
|
|
336
|
+
{!item.description ? (
|
|
337
|
+
<b>View transaction</b>
|
|
338
|
+
) : (
|
|
339
|
+
<b>
|
|
340
|
+
{item.description
|
|
341
|
+
.substring(0, 1)
|
|
342
|
+
.toUpperCase()}
|
|
343
|
+
{item.description.substring(1)} Tx
|
|
344
|
+
</b>
|
|
345
|
+
)}
|
|
346
|
+
</StyledAnchor>
|
|
334
347
|
</Description>
|
|
335
348
|
</DescriptionContainer>
|
|
336
|
-
<StyledAnchor
|
|
337
|
-
href={item.url}
|
|
338
|
-
target="_blank"
|
|
339
|
-
rel="noreferrer"
|
|
340
|
-
key={index}
|
|
341
|
-
>
|
|
342
|
-
TX-Link
|
|
343
|
-
</StyledAnchor>
|
|
344
349
|
</InternalDetail>
|
|
345
350
|
))}
|
|
346
351
|
</div>
|
|
@@ -381,17 +386,11 @@ export function SwapHistory(props: PropTypes) {
|
|
|
381
386
|
title="Cancel Progress"
|
|
382
387
|
content={
|
|
383
388
|
<Alert type="warning">
|
|
384
|
-
<
|
|
385
|
-
Warning:
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
</p>
|
|
390
|
-
<Spacer size={12} direction="vertical" />
|
|
391
|
-
<p>
|
|
392
|
-
If you have already signed your transaction to blockchain, you
|
|
393
|
-
should wait for that to complete or rollback
|
|
394
|
-
</p>
|
|
389
|
+
<Typography variant="body2">
|
|
390
|
+
Warning: Cancel <u>doesn't revert</u> your transaction if you've
|
|
391
|
+
already signed and sent a transaction to the blockchain. It only
|
|
392
|
+
stops next steps from being executed.
|
|
393
|
+
</Typography>
|
|
395
394
|
</Alert>
|
|
396
395
|
}
|
|
397
396
|
footer={
|