@rango-dev/widget-embedded 0.21.1-next.8 → 0.21.1-next.9
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/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { i18n } from '@lingui/core';
|
|
|
4
4
|
import {
|
|
5
5
|
Divider,
|
|
6
6
|
GroupedVirtualizedList,
|
|
7
|
+
Skeleton,
|
|
7
8
|
SwapListItem,
|
|
8
9
|
Typography,
|
|
9
10
|
} from '@rango-dev/ui';
|
|
@@ -50,39 +51,29 @@ export function HistoryGroupedList(props: PropTypes) {
|
|
|
50
51
|
}, [isLoading, loadMore]);
|
|
51
52
|
|
|
52
53
|
if (isLoading) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const loadingGroups = [
|
|
56
|
-
{
|
|
57
|
-
title: i18n.t('Today'),
|
|
58
|
-
swaps,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
title: i18n.t('This month'),
|
|
62
|
-
swaps,
|
|
63
|
-
},
|
|
64
|
-
];
|
|
54
|
+
// The number of items presented in each group.
|
|
55
|
+
const swaps = [1, 2];
|
|
56
|
+
const loadingGroups = [swaps, swaps];
|
|
65
57
|
return (
|
|
66
58
|
<>
|
|
67
|
-
{loadingGroups.map((group) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
size="
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
))}
|
|
59
|
+
{loadingGroups.map((group, index) => {
|
|
60
|
+
const key = index;
|
|
61
|
+
return (
|
|
62
|
+
<Group key={key}>
|
|
63
|
+
<Time>
|
|
64
|
+
<Skeleton variant="text" width={60} size="small" />
|
|
65
|
+
<Divider size={16} />
|
|
66
|
+
</Time>
|
|
67
|
+
<Divider size={4} />
|
|
68
|
+
<SwapList>
|
|
69
|
+
{group.map((_, index) => {
|
|
70
|
+
const key = index;
|
|
71
|
+
return <SwapListItem isLoading={true} key={key} />;
|
|
72
|
+
})}
|
|
73
|
+
</SwapList>
|
|
74
|
+
</Group>
|
|
75
|
+
);
|
|
76
|
+
})}
|
|
86
77
|
</>
|
|
87
78
|
);
|
|
88
79
|
}
|
|
@@ -111,6 +102,9 @@ export function HistoryGroupedList(props: PropTypes) {
|
|
|
111
102
|
}}
|
|
112
103
|
itemContent={(index, groupIndex) => {
|
|
113
104
|
const swap = swaps[index];
|
|
105
|
+
if (!swap) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
114
108
|
const firstStep = swap.steps[0];
|
|
115
109
|
const lastStep = swap.steps[swap.steps.length - 1];
|
|
116
110
|
return (
|