@orderly.network/markets 2.11.3-rc.0 → 2.12.0
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/index.d.mts +44 -16
- package/dist/index.d.ts +44 -16
- package/dist/index.js +1286 -632
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1288 -635
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React6, {
|
|
1
|
+
import React6, { createContext, memo, useState, useRef, useCallback, useEffect, createElement, useMemo, useContext, isValidElement } from 'react';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useSymbolsInfo, useMarkets, MarketsType, useFundingRateHistory, useFundingRates, useQuery, useMarketsStream, useLocalStorage, useGetRwaSymbolInfo, useTickerStream, useFundingRate, useMarketsStore, useFundingDetails, useSessionStorage, useFundingRateBySymbol, usePositionStream,
|
|
4
|
-
import { Flex, TokenIcon, Text, Box, cn, Marquee, Checkbox, Divider, useEmblaCarousel, useScreen, Badge, Tooltip, CloseIcon, CheckedSquareFillIcon, CheckSquareEmptyIcon, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Input, CloseCircleFillIcon, PlusIcon, DataTable, usePagination, Tabs, TabPanel, EmptyDataState, NewsFillIcon, modal, RwaIcon, GradientText, EmptyStateIcon, Picker, Select } from '@orderly.network/ui';
|
|
3
|
+
import { useSymbolsInfo, useBadgeBySymbol, useMarkets, MarketsType, isCurrentlyTrading, useFundingRateHistory, useFundingRates, useQuery, useMarketsStream, useLocalStorage, useGetRwaSymbolInfo, useTickerStream, useFundingRate, useMarketsStore, useFundingDetails, useSessionStorage, useMarketCategoriesConfig, useMarketList, useRwaSymbolsInfo, useFundingRateBySymbol, usePositionStream, useConfig, useAllBrokers } from '@orderly.network/hooks';
|
|
5
4
|
import { useTranslation, Trans, i18n } from '@orderly.network/i18n';
|
|
5
|
+
import { Flex, TokenIcon, Text, SymbolBadge as SymbolBadge$1, Box, cn, Marquee, Checkbox, Divider, Tooltip, GradientText, useEmblaCarousel, useScreen, Badge, CloseIcon, CheckedSquareFillIcon, CheckSquareEmptyIcon, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Input, CloseCircleFillIcon, PlusIcon, DataTable, usePagination, Tabs, TabPanel, WarningIcon, NewsFillIcon, EmptyDataState, modal, RwaIcon, EmptyStateIcon, Picker, Select } from '@orderly.network/ui';
|
|
6
6
|
import { Decimal, formatSymbol } from '@orderly.network/utils';
|
|
7
7
|
import { pick } from 'ramda';
|
|
8
8
|
import { LeftNavUI } from '@orderly.network/ui-scaffold';
|
|
@@ -21,7 +21,7 @@ var init_marketsProvider = __esm({
|
|
|
21
21
|
"src/components/marketsProvider/index.tsx"() {
|
|
22
22
|
MarketsContext = createContext({});
|
|
23
23
|
MarketsProvider = (props) => {
|
|
24
|
-
const { symbol, comparisonProps, children, onSymbolChange } = props;
|
|
24
|
+
const { symbol, comparisonProps, children, onSymbolChange, tabs } = props;
|
|
25
25
|
const [searchValue, setSearchValue] = useState("");
|
|
26
26
|
const clearSearchValue = useCallback(() => {
|
|
27
27
|
setSearchValue("");
|
|
@@ -33,9 +33,17 @@ var init_marketsProvider = __esm({
|
|
|
33
33
|
clearSearchValue,
|
|
34
34
|
symbol,
|
|
35
35
|
onSymbolChange,
|
|
36
|
-
comparisonProps
|
|
36
|
+
comparisonProps,
|
|
37
|
+
tabs
|
|
37
38
|
};
|
|
38
|
-
}, [
|
|
39
|
+
}, [
|
|
40
|
+
searchValue,
|
|
41
|
+
symbol,
|
|
42
|
+
onSymbolChange,
|
|
43
|
+
setSearchValue,
|
|
44
|
+
comparisonProps,
|
|
45
|
+
tabs
|
|
46
|
+
]);
|
|
39
47
|
return /* @__PURE__ */ jsx(MarketsContext.Provider, { value: memoizedValue, children });
|
|
40
48
|
};
|
|
41
49
|
useMarketsContext = () => {
|
|
@@ -43,14 +51,63 @@ var init_marketsProvider = __esm({
|
|
|
43
51
|
};
|
|
44
52
|
}
|
|
45
53
|
});
|
|
54
|
+
var RwaDotTooltip;
|
|
55
|
+
var init_rwaDotTooltip = __esm({
|
|
56
|
+
"src/components/rwaDotTooltip.tsx"() {
|
|
57
|
+
RwaDotTooltip = ({ record }) => {
|
|
58
|
+
const { t } = useTranslation();
|
|
59
|
+
const isInTradingHours = isCurrentlyTrading(
|
|
60
|
+
record.rwaNextClose,
|
|
61
|
+
record.rwaStatus
|
|
62
|
+
);
|
|
63
|
+
if (!record.isRwa) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
Tooltip,
|
|
68
|
+
{
|
|
69
|
+
content: /* @__PURE__ */ jsx(Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
|
|
70
|
+
children: /* @__PURE__ */ jsx(Box, { py: 2, px: 1, children: /* @__PURE__ */ jsx(
|
|
71
|
+
Box,
|
|
72
|
+
{
|
|
73
|
+
width: 4,
|
|
74
|
+
height: 4,
|
|
75
|
+
r: "full",
|
|
76
|
+
className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
|
|
77
|
+
}
|
|
78
|
+
) })
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var BrokerIdBadge, SymbolBadge;
|
|
85
|
+
var init_symbolBadge = __esm({
|
|
86
|
+
"src/components/symbolBadge.tsx"() {
|
|
87
|
+
BrokerIdBadge = (props) => {
|
|
88
|
+
const { brokerId, brokerName, brokerNameRaw } = useBadgeBySymbol(
|
|
89
|
+
props.symbol
|
|
90
|
+
);
|
|
91
|
+
const badge = brokerName ?? brokerId ?? void 0;
|
|
92
|
+
return /* @__PURE__ */ jsx(SymbolBadge$1, { badge, fullName: brokerNameRaw });
|
|
93
|
+
};
|
|
94
|
+
SymbolBadge = BrokerIdBadge;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
46
97
|
var SymbolDisplay;
|
|
47
98
|
var init_symbolDisplay = __esm({
|
|
48
99
|
"src/components/symbolDisplay.tsx"() {
|
|
100
|
+
init_rwaDotTooltip();
|
|
101
|
+
init_symbolBadge();
|
|
49
102
|
SymbolDisplay = memo((props) => {
|
|
50
|
-
const { children, size = "xs", ...rest } = props;
|
|
103
|
+
const { children, size = "xs", showBadge = true, record, ...rest } = props;
|
|
51
104
|
const symbol = children;
|
|
52
105
|
const symbolsInfo = useSymbolsInfo();
|
|
53
106
|
const displayName = symbolsInfo[symbol]("displayName");
|
|
107
|
+
const suffix = record?.isRwa || showBadge ? /* @__PURE__ */ jsxs(Flex, { gapX: 0, itemAlign: "center", children: [
|
|
108
|
+
record?.isRwa && /* @__PURE__ */ jsx(RwaDotTooltip, { record }),
|
|
109
|
+
showBadge && /* @__PURE__ */ jsx(SymbolBadge, { symbol })
|
|
110
|
+
] }) : null;
|
|
54
111
|
if (displayName) {
|
|
55
112
|
return /* @__PURE__ */ jsxs(Flex, { gapX: 1, className: props.className, children: [
|
|
56
113
|
props.showIcon && /* @__PURE__ */ jsx(TokenIcon, { size, symbol }),
|
|
@@ -62,10 +119,21 @@ var init_symbolDisplay = __esm({
|
|
|
62
119
|
className: "oui-whitespace-nowrap oui-break-normal",
|
|
63
120
|
children: displayName
|
|
64
121
|
}
|
|
65
|
-
)
|
|
122
|
+
),
|
|
123
|
+
suffix
|
|
66
124
|
] });
|
|
67
125
|
}
|
|
68
|
-
return /* @__PURE__ */ jsx(
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
Text.formatted,
|
|
128
|
+
{
|
|
129
|
+
size: "xs",
|
|
130
|
+
rule: "symbol",
|
|
131
|
+
weight: "semibold",
|
|
132
|
+
suffix,
|
|
133
|
+
...rest,
|
|
134
|
+
children: symbol
|
|
135
|
+
}
|
|
136
|
+
);
|
|
69
137
|
});
|
|
70
138
|
}
|
|
71
139
|
});
|
|
@@ -1076,6 +1144,101 @@ var init_marketsHeader_widget = __esm({
|
|
|
1076
1144
|
};
|
|
1077
1145
|
}
|
|
1078
1146
|
});
|
|
1147
|
+
function createCommunityBrokerFilter(selected) {
|
|
1148
|
+
return (data) => selected === "all" ? data?.filter((m) => Boolean(m?.broker_id)) : data?.filter((m) => m?.broker_id === selected);
|
|
1149
|
+
}
|
|
1150
|
+
function useCommunityTabs() {
|
|
1151
|
+
const brokerId = useConfig("brokerId");
|
|
1152
|
+
const [brokers] = useAllBrokers();
|
|
1153
|
+
const [allMarkets] = useMarkets(MarketsType.ALL);
|
|
1154
|
+
const lastSignatureRef = useRef("");
|
|
1155
|
+
const lastValueRef = useRef([]);
|
|
1156
|
+
return useMemo(() => {
|
|
1157
|
+
const brokerIdSet = /* @__PURE__ */ new Set();
|
|
1158
|
+
for (const m of allMarkets ?? []) {
|
|
1159
|
+
const id = m?.broker_id;
|
|
1160
|
+
if (typeof id === "string" && id.length) {
|
|
1161
|
+
brokerIdSet.add(id);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
const entries = Array.from(
|
|
1165
|
+
brokerIdSet
|
|
1166
|
+
).map((id) => ({
|
|
1167
|
+
id,
|
|
1168
|
+
name: brokers?.[id]
|
|
1169
|
+
}));
|
|
1170
|
+
const sorted = entries.map(({ id, name }) => ({
|
|
1171
|
+
id,
|
|
1172
|
+
label: name ?? id,
|
|
1173
|
+
sortKey: (name ?? id).toLowerCase()
|
|
1174
|
+
})).sort((a, b) => a.sortKey.localeCompare(b.sortKey));
|
|
1175
|
+
if (brokerId) {
|
|
1176
|
+
const idx = sorted.findIndex((x) => x.id === brokerId);
|
|
1177
|
+
if (idx > 0) {
|
|
1178
|
+
const [cur] = sorted.splice(idx, 1);
|
|
1179
|
+
sorted.unshift(cur);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
const signature = sorted.map((x) => `${x.id}:${x.label}`).join("|");
|
|
1183
|
+
if (signature === lastSignatureRef.current) {
|
|
1184
|
+
return lastValueRef.current;
|
|
1185
|
+
}
|
|
1186
|
+
lastSignatureRef.current = signature;
|
|
1187
|
+
lastValueRef.current = sorted;
|
|
1188
|
+
return sorted;
|
|
1189
|
+
}, [allMarkets, brokers, brokerId]);
|
|
1190
|
+
}
|
|
1191
|
+
var init_useCommunityTabs = __esm({
|
|
1192
|
+
"src/hooks/useCommunityTabs.ts"() {
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
var CommunityBrokerTabs;
|
|
1196
|
+
var init_communityBrokerTabs_ui = __esm({
|
|
1197
|
+
"src/components/communityBrokerTabs/communityBrokerTabs.ui.tsx"() {
|
|
1198
|
+
init_useCommunityTabs();
|
|
1199
|
+
CommunityBrokerTabs = (props) => {
|
|
1200
|
+
const {
|
|
1201
|
+
storageKey,
|
|
1202
|
+
className,
|
|
1203
|
+
classNames,
|
|
1204
|
+
variant = "contained",
|
|
1205
|
+
size = "sm",
|
|
1206
|
+
showScrollIndicator,
|
|
1207
|
+
allTitle,
|
|
1208
|
+
renderPanel
|
|
1209
|
+
} = props;
|
|
1210
|
+
const { t } = useTranslation();
|
|
1211
|
+
const [communitySubTab, setCommunitySubTab] = useLocalStorage(
|
|
1212
|
+
storageKey,
|
|
1213
|
+
"all"
|
|
1214
|
+
);
|
|
1215
|
+
const communityBrokerTabs = useCommunityTabs();
|
|
1216
|
+
return /* @__PURE__ */ jsxs(
|
|
1217
|
+
Tabs,
|
|
1218
|
+
{
|
|
1219
|
+
variant,
|
|
1220
|
+
size,
|
|
1221
|
+
value: communitySubTab,
|
|
1222
|
+
onValueChange: setCommunitySubTab,
|
|
1223
|
+
classNames,
|
|
1224
|
+
className,
|
|
1225
|
+
showScrollIndicator,
|
|
1226
|
+
children: [
|
|
1227
|
+
/* @__PURE__ */ jsx(TabPanel, { title: allTitle ?? t("common.all"), value: "all", children: renderPanel("all") }),
|
|
1228
|
+
communityBrokerTabs.map((b) => /* @__PURE__ */ jsx(TabPanel, { title: b.label, value: b.id, children: renderPanel(b.id) }, b.id))
|
|
1229
|
+
]
|
|
1230
|
+
}
|
|
1231
|
+
);
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
// src/components/communityBrokerTabs/index.ts
|
|
1237
|
+
var init_communityBrokerTabs = __esm({
|
|
1238
|
+
"src/components/communityBrokerTabs/index.ts"() {
|
|
1239
|
+
init_communityBrokerTabs_ui();
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1079
1242
|
var CollapseMarkets;
|
|
1080
1243
|
var init_collapseMarkets = __esm({
|
|
1081
1244
|
"src/components/collapseMarkets/index.tsx"() {
|
|
@@ -1176,6 +1339,7 @@ var init_collapseMarkets = __esm({
|
|
|
1176
1339
|
var FavoritesDropdownMenu;
|
|
1177
1340
|
var init_favoritesDropdownMenu_ui = __esm({
|
|
1178
1341
|
"src/components/favoritesDropdownMenu/favoritesDropdownMenu.ui.tsx"() {
|
|
1342
|
+
init_symbolBadge();
|
|
1179
1343
|
FavoritesDropdownMenu = (props) => {
|
|
1180
1344
|
const {
|
|
1181
1345
|
symbol,
|
|
@@ -1287,9 +1451,10 @@ var init_favoritesDropdownMenu_ui = __esm({
|
|
|
1287
1451
|
Text.formatted,
|
|
1288
1452
|
{
|
|
1289
1453
|
rule: "symbol",
|
|
1290
|
-
formatString: "base
|
|
1454
|
+
formatString: "base",
|
|
1291
1455
|
size: "base",
|
|
1292
1456
|
showIcon: true,
|
|
1457
|
+
suffix: /* @__PURE__ */ jsx(SymbolBadge, { symbol }),
|
|
1293
1458
|
children: symbol
|
|
1294
1459
|
}
|
|
1295
1460
|
)
|
|
@@ -1501,36 +1666,6 @@ var init_favoritesDropdownMenu = __esm({
|
|
|
1501
1666
|
init_favoritesDropdownMenu_widget();
|
|
1502
1667
|
}
|
|
1503
1668
|
});
|
|
1504
|
-
var RwaDotTooltip;
|
|
1505
|
-
var init_rwaDotTooltip = __esm({
|
|
1506
|
-
"src/components/rwaDotTooltip.tsx"() {
|
|
1507
|
-
RwaDotTooltip = ({ record }) => {
|
|
1508
|
-
const { t } = useTranslation();
|
|
1509
|
-
const isInTradingHours = isCurrentlyTrading(
|
|
1510
|
-
record.rwaNextClose,
|
|
1511
|
-
record.rwaStatus
|
|
1512
|
-
);
|
|
1513
|
-
if (!record.isRwa) {
|
|
1514
|
-
return null;
|
|
1515
|
-
}
|
|
1516
|
-
return /* @__PURE__ */ jsx(
|
|
1517
|
-
Tooltip,
|
|
1518
|
-
{
|
|
1519
|
-
content: /* @__PURE__ */ jsx(Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
|
|
1520
|
-
children: /* @__PURE__ */ jsx(Box, { p: 2, children: /* @__PURE__ */ jsx(
|
|
1521
|
-
Box,
|
|
1522
|
-
{
|
|
1523
|
-
width: 4,
|
|
1524
|
-
height: 4,
|
|
1525
|
-
r: "full",
|
|
1526
|
-
className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
|
|
1527
|
-
}
|
|
1528
|
-
) })
|
|
1529
|
-
}
|
|
1530
|
-
);
|
|
1531
|
-
};
|
|
1532
|
-
}
|
|
1533
|
-
});
|
|
1534
1669
|
function getSymbolColumn(favorite, isFavoriteList = false, options) {
|
|
1535
1670
|
return {
|
|
1536
1671
|
title: i18n.t("common.symbol"),
|
|
@@ -1565,8 +1700,7 @@ function getSymbolColumn(favorite, isFavoriteList = false, options) {
|
|
|
1565
1700
|
children: [
|
|
1566
1701
|
/* @__PURE__ */ jsxs(Flex, { gapX: 1, itemAlign: "center", children: [
|
|
1567
1702
|
/* @__PURE__ */ jsx(TokenIcon, { symbol: value, className: "oui-size-[18px]" }),
|
|
1568
|
-
/* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "2xs", children: value })
|
|
1569
|
-
/* @__PURE__ */ jsx(RwaDotTooltip, { record })
|
|
1703
|
+
/* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "2xs", record, children: value })
|
|
1570
1704
|
] }),
|
|
1571
1705
|
typeof record.leverage === "number" && /* @__PURE__ */ jsxs(Badge, { size: "xs", color: "primary", children: [
|
|
1572
1706
|
record.leverage,
|
|
@@ -1737,7 +1871,6 @@ var init_column = __esm({
|
|
|
1737
1871
|
init_icons();
|
|
1738
1872
|
init_icons();
|
|
1739
1873
|
init_favoritesDropdownMenu();
|
|
1740
|
-
init_rwaDotTooltip();
|
|
1741
1874
|
init_symbolDisplay();
|
|
1742
1875
|
}
|
|
1743
1876
|
});
|
|
@@ -1830,7 +1963,7 @@ var init_marketsList_ui = __esm({
|
|
|
1830
1963
|
});
|
|
1831
1964
|
|
|
1832
1965
|
// src/type.ts
|
|
1833
|
-
var MarketsPageTab, MarketsTabName, FundingTabName;
|
|
1966
|
+
var MarketsPageTab, MarketsTabName, CommunitySubTabName, FundingTabName;
|
|
1834
1967
|
var init_type = __esm({
|
|
1835
1968
|
"src/type.ts"() {
|
|
1836
1969
|
MarketsPageTab = /* @__PURE__ */ ((MarketsPageTab2) => {
|
|
@@ -1844,8 +1977,15 @@ var init_type = __esm({
|
|
|
1844
1977
|
MarketsTabName2["All"] = "all";
|
|
1845
1978
|
MarketsTabName2["Rwa"] = "rwa";
|
|
1846
1979
|
MarketsTabName2["NewListing"] = "newListing";
|
|
1980
|
+
MarketsTabName2["Community"] = "community";
|
|
1847
1981
|
return MarketsTabName2;
|
|
1848
1982
|
})(MarketsTabName || {});
|
|
1983
|
+
CommunitySubTabName = /* @__PURE__ */ ((CommunitySubTabName2) => {
|
|
1984
|
+
CommunitySubTabName2["All"] = "all";
|
|
1985
|
+
CommunitySubTabName2["MyListings"] = "myListings";
|
|
1986
|
+
CommunitySubTabName2["OtherListings"] = "otherListings";
|
|
1987
|
+
return CommunitySubTabName2;
|
|
1988
|
+
})(CommunitySubTabName || {});
|
|
1849
1989
|
FundingTabName = /* @__PURE__ */ ((FundingTabName2) => {
|
|
1850
1990
|
FundingTabName2["Overview"] = "overview";
|
|
1851
1991
|
FundingTabName2["Comparison"] = "comparison";
|
|
@@ -1861,6 +2001,7 @@ var init_marketsList_script = __esm({
|
|
|
1861
2001
|
init_marketsProvider();
|
|
1862
2002
|
MarketsTypeMap = {
|
|
1863
2003
|
["all" /* All */]: MarketsType.ALL,
|
|
2004
|
+
["community" /* Community */]: MarketsType.COMMUNITY,
|
|
1864
2005
|
["rwa" /* Rwa */]: MarketsType.RWA,
|
|
1865
2006
|
["favorites" /* Favorites */]: MarketsType.FAVORITES,
|
|
1866
2007
|
["recent" /* Recent */]: MarketsType.RECENT,
|
|
@@ -1960,18 +2101,7 @@ var init_rwaTab = __esm({
|
|
|
1960
2101
|
};
|
|
1961
2102
|
RwaTab = () => {
|
|
1962
2103
|
const { t } = useTranslation();
|
|
1963
|
-
return /* @__PURE__ */
|
|
1964
|
-
/* @__PURE__ */ jsx(Text, { children: t("common.rwa") }),
|
|
1965
|
-
/* @__PURE__ */ jsx(
|
|
1966
|
-
Box,
|
|
1967
|
-
{
|
|
1968
|
-
r: "base",
|
|
1969
|
-
px: 2,
|
|
1970
|
-
className: "oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)]",
|
|
1971
|
-
children: /* @__PURE__ */ jsx(GradientText, { color: "brand", children: t("common.new") })
|
|
1972
|
-
}
|
|
1973
|
-
)
|
|
1974
|
-
] });
|
|
2104
|
+
return /* @__PURE__ */ jsx(Flex, { gap: 1, children: /* @__PURE__ */ jsx(Text, { children: t("common.rwa") }) });
|
|
1975
2105
|
};
|
|
1976
2106
|
}
|
|
1977
2107
|
});
|
|
@@ -2484,19 +2614,137 @@ var init_useFavoritesExtraProps = __esm({
|
|
|
2484
2614
|
init_marketsProvider();
|
|
2485
2615
|
}
|
|
2486
2616
|
});
|
|
2617
|
+
function isBuiltInMarketTab(tab) {
|
|
2618
|
+
return "type" in tab;
|
|
2619
|
+
}
|
|
2620
|
+
function isCustomMarketTab(tab) {
|
|
2621
|
+
return "id" in tab;
|
|
2622
|
+
}
|
|
2623
|
+
function tabKey(tab, index) {
|
|
2624
|
+
return isBuiltInMarketTab(tab) ? tab.type : tab.id || `category_${index}`;
|
|
2625
|
+
}
|
|
2626
|
+
function resolveIcon(icon) {
|
|
2627
|
+
if (typeof icon === "string") {
|
|
2628
|
+
return createElement("img", {
|
|
2629
|
+
src: icon,
|
|
2630
|
+
alt: "",
|
|
2631
|
+
style: { width: 16, height: 16 }
|
|
2632
|
+
});
|
|
2633
|
+
}
|
|
2634
|
+
return icon;
|
|
2635
|
+
}
|
|
2636
|
+
function resolveSuffix(suffix) {
|
|
2637
|
+
if (typeof suffix === "undefined" || suffix === null) {
|
|
2638
|
+
return void 0;
|
|
2639
|
+
}
|
|
2640
|
+
if (typeof suffix === "string") {
|
|
2641
|
+
return /* @__PURE__ */ jsx("span", { className: "oui-ml-1 oui-inline-flex oui-items-center oui-rounded oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)] oui-px-2", children: /* @__PURE__ */ jsx(GradientText, { color: "brand", children: suffix }) });
|
|
2642
|
+
}
|
|
2643
|
+
return /* @__PURE__ */ jsx("span", { className: "oui-ml-1", children: suffix });
|
|
2644
|
+
}
|
|
2645
|
+
function composeTabTitle(label, options) {
|
|
2646
|
+
const icon = options?.icon;
|
|
2647
|
+
const suffix = resolveSuffix(options?.suffix);
|
|
2648
|
+
const hasLabel = typeof label !== "undefined" && label !== null && label !== "";
|
|
2649
|
+
if (!hasLabel) {
|
|
2650
|
+
if (!icon) {
|
|
2651
|
+
return suffix ?? null;
|
|
2652
|
+
}
|
|
2653
|
+
return suffix ? /* @__PURE__ */ jsxs("span", { className: "oui-inline-flex oui-items-center oui-gap-x-1", children: [
|
|
2654
|
+
icon,
|
|
2655
|
+
suffix
|
|
2656
|
+
] }) : icon;
|
|
2657
|
+
}
|
|
2658
|
+
if (icon) {
|
|
2659
|
+
return /* @__PURE__ */ jsxs("span", { className: "oui-inline-flex oui-items-center oui-gap-x-1", children: [
|
|
2660
|
+
icon,
|
|
2661
|
+
label,
|
|
2662
|
+
suffix
|
|
2663
|
+
] });
|
|
2664
|
+
}
|
|
2665
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2666
|
+
label,
|
|
2667
|
+
suffix
|
|
2668
|
+
] });
|
|
2669
|
+
}
|
|
2670
|
+
function resolveTabTriggerIcon(tab, fallbackIcon) {
|
|
2671
|
+
const resolvedIcon = typeof tab.icon !== "undefined" ? resolveIcon(tab.icon) : fallbackIcon;
|
|
2672
|
+
return isValidElement(resolvedIcon) ? resolvedIcon : void 0;
|
|
2673
|
+
}
|
|
2674
|
+
function resolveTabTitle(tab, titleOverrides, rwaTitle) {
|
|
2675
|
+
if (isBuiltInMarketTab(tab) && tab.type === "favorites") {
|
|
2676
|
+
return /* @__PURE__ */ jsx(FavoritesIcon, {});
|
|
2677
|
+
}
|
|
2678
|
+
if (isBuiltInMarketTab(tab) && tab.type === "rwa") {
|
|
2679
|
+
return rwaTitle;
|
|
2680
|
+
}
|
|
2681
|
+
if (isBuiltInMarketTab(tab) && titleOverrides[tab.type]) {
|
|
2682
|
+
return tab.name ?? titleOverrides[tab.type];
|
|
2683
|
+
}
|
|
2684
|
+
return composeTabTitle(tab.name, {
|
|
2685
|
+
icon: resolveIcon(tab.icon),
|
|
2686
|
+
suffix: tab.suffix
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
function useBuiltInTitles() {
|
|
2690
|
+
const { t } = useTranslation();
|
|
2691
|
+
return useMemo(
|
|
2692
|
+
() => Object.fromEntries(
|
|
2693
|
+
Object.entries(BUILT_IN_TITLE_MAP).map(([key, i18nKey]) => [
|
|
2694
|
+
key,
|
|
2695
|
+
t(i18nKey)
|
|
2696
|
+
])
|
|
2697
|
+
),
|
|
2698
|
+
[t]
|
|
2699
|
+
);
|
|
2700
|
+
}
|
|
2701
|
+
function getCustomTabDataFilter(tab) {
|
|
2702
|
+
if (!tab) return void 0;
|
|
2703
|
+
return (data) => data.filter((item) => tab.match(item));
|
|
2704
|
+
}
|
|
2705
|
+
function useCustomTabDataFilters(tabs) {
|
|
2706
|
+
return useMemo(() => {
|
|
2707
|
+
if (!tabs) return {};
|
|
2708
|
+
const result = {};
|
|
2709
|
+
tabs.forEach((tab, i) => {
|
|
2710
|
+
if (isCustomMarketTab(tab)) {
|
|
2711
|
+
result[tabKey(tab, i)] = (data) => data.filter((item) => tab.match(item));
|
|
2712
|
+
}
|
|
2713
|
+
});
|
|
2714
|
+
return result;
|
|
2715
|
+
}, [tabs]);
|
|
2716
|
+
}
|
|
2717
|
+
var BUILT_IN_TITLE_MAP;
|
|
2718
|
+
var init_tabUtils = __esm({
|
|
2719
|
+
"src/components/shared/tabUtils.tsx"() {
|
|
2720
|
+
init_icons();
|
|
2721
|
+
BUILT_IN_TITLE_MAP = {
|
|
2722
|
+
community: "markets.community",
|
|
2723
|
+
all: "common.all",
|
|
2724
|
+
newListing: "markets.newListings",
|
|
2725
|
+
recent: "markets.recent"
|
|
2726
|
+
};
|
|
2727
|
+
}
|
|
2728
|
+
});
|
|
2487
2729
|
var MobileMarketsDataList;
|
|
2488
2730
|
var init_marketsDataList_mobile_ui = __esm({
|
|
2489
2731
|
"src/pages/home/marketsDataList/marketsDataList.mobile.ui.tsx"() {
|
|
2732
|
+
init_communityBrokerTabs();
|
|
2490
2733
|
init_marketsList();
|
|
2734
|
+
init_marketsProvider();
|
|
2491
2735
|
init_rwaTab();
|
|
2492
2736
|
init_searchInput();
|
|
2493
2737
|
init_column();
|
|
2494
2738
|
init_useFavoritesExtraProps();
|
|
2739
|
+
init_tabUtils();
|
|
2740
|
+
init_useCommunityTabs();
|
|
2495
2741
|
init_icons();
|
|
2496
2742
|
init_type();
|
|
2497
2743
|
MobileMarketsDataList = (props) => {
|
|
2498
2744
|
const { activeTab, onTabChange, tabSort, onTabSort } = props;
|
|
2499
2745
|
const { t } = useTranslation();
|
|
2746
|
+
const { tabs } = useMarketsContext();
|
|
2747
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
2500
2748
|
const getColumns = useCallback(
|
|
2501
2749
|
(favorite, isFavoriteList = false) => {
|
|
2502
2750
|
return [
|
|
@@ -2510,6 +2758,37 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2510
2758
|
[]
|
|
2511
2759
|
);
|
|
2512
2760
|
const { getFavoritesProps } = useFavoritesProps();
|
|
2761
|
+
const builtInMeta = useMemo(
|
|
2762
|
+
() => ({
|
|
2763
|
+
favorites: {
|
|
2764
|
+
title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
|
|
2765
|
+
value: "favorites",
|
|
2766
|
+
tabName: "favorites" /* Favorites */
|
|
2767
|
+
},
|
|
2768
|
+
community: {
|
|
2769
|
+
title: t("markets.community"),
|
|
2770
|
+
value: "community"
|
|
2771
|
+
},
|
|
2772
|
+
all: {
|
|
2773
|
+
title: t("markets.allMarkets"),
|
|
2774
|
+
icon: /* @__PURE__ */ jsx(AllMarketsIcon, {}),
|
|
2775
|
+
value: "all",
|
|
2776
|
+
tabName: "all" /* All */
|
|
2777
|
+
},
|
|
2778
|
+
rwa: {
|
|
2779
|
+
title: /* @__PURE__ */ jsx(RwaIconTab, {}),
|
|
2780
|
+
value: "rwa",
|
|
2781
|
+
tabName: "rwa" /* Rwa */
|
|
2782
|
+
},
|
|
2783
|
+
newListing: {
|
|
2784
|
+
title: t("markets.newListings"),
|
|
2785
|
+
icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
|
|
2786
|
+
value: "new",
|
|
2787
|
+
tabName: "newListing" /* NewListing */
|
|
2788
|
+
}
|
|
2789
|
+
}),
|
|
2790
|
+
[t]
|
|
2791
|
+
);
|
|
2513
2792
|
const renderTab = (type) => {
|
|
2514
2793
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2515
2794
|
/* @__PURE__ */ jsx(
|
|
@@ -2536,7 +2815,20 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2536
2815
|
)
|
|
2537
2816
|
] });
|
|
2538
2817
|
};
|
|
2539
|
-
|
|
2818
|
+
const renderCommunityList = (selected) => {
|
|
2819
|
+
return /* @__PURE__ */ jsx(
|
|
2820
|
+
MarketsListWidget,
|
|
2821
|
+
{
|
|
2822
|
+
type: "all" /* All */,
|
|
2823
|
+
initialSort: tabSort["community" /* Community */],
|
|
2824
|
+
onSort: onTabSort("community" /* Community */),
|
|
2825
|
+
getColumns,
|
|
2826
|
+
rowClassName: "!oui-h-[34px]",
|
|
2827
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
2828
|
+
}
|
|
2829
|
+
);
|
|
2830
|
+
};
|
|
2831
|
+
return /* @__PURE__ */ jsx(Box, { id: "oui-markets-list", intensity: 900, py: 3, mt: 2, r: "2xl", children: /* @__PURE__ */ jsx(
|
|
2540
2832
|
Tabs,
|
|
2541
2833
|
{
|
|
2542
2834
|
variant: "contained",
|
|
@@ -2547,28 +2839,85 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2547
2839
|
scrollIndicator: "oui-mx-3"
|
|
2548
2840
|
},
|
|
2549
2841
|
showScrollIndicator: true,
|
|
2550
|
-
children:
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
icon: /* @__PURE__ */ jsx(
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2842
|
+
children: tabs?.map((tab, index) => {
|
|
2843
|
+
const key = tabKey(tab, index);
|
|
2844
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
2845
|
+
const meta = isBuiltIn ? builtInMeta[tab.type] : void 0;
|
|
2846
|
+
if (isBuiltIn && meta) {
|
|
2847
|
+
const title = tab.type === "favorites" ? composeTabTitle(tab.name, {
|
|
2848
|
+
icon: resolveTabTriggerIcon(tab, /* @__PURE__ */ jsx(FavoritesIcon, {})),
|
|
2849
|
+
suffix: tab.suffix
|
|
2850
|
+
}) : tab.type === "rwa" ? resolveTabTitle(tab, {}, /* @__PURE__ */ jsx(RwaIconTab, {})) : composeTabTitle(tab.name ?? meta.title, {
|
|
2851
|
+
suffix: tab.suffix
|
|
2852
|
+
});
|
|
2853
|
+
return /* @__PURE__ */ jsx(
|
|
2854
|
+
TabPanel,
|
|
2855
|
+
{
|
|
2856
|
+
title,
|
|
2857
|
+
icon: tab.type === "favorites" || tab.type === "rwa" ? void 0 : resolveTabTriggerIcon(tab, meta.icon),
|
|
2858
|
+
value: meta.value,
|
|
2859
|
+
children: tab.type === "community" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2860
|
+
/* @__PURE__ */ jsx(
|
|
2861
|
+
SearchInput,
|
|
2862
|
+
{
|
|
2863
|
+
classNames: {
|
|
2864
|
+
root: cn("oui-mx-3 oui-mb-4 oui-mt-5", "oui-mb-2")
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
),
|
|
2868
|
+
/* @__PURE__ */ jsx(
|
|
2869
|
+
CommunityBrokerTabs,
|
|
2870
|
+
{
|
|
2871
|
+
storageKey: "orderly_mobile_markets_datalist_community_sel_sub_tab",
|
|
2872
|
+
size: "md",
|
|
2873
|
+
classNames: {
|
|
2874
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
2875
|
+
tabsContent: "oui-h-full",
|
|
2876
|
+
scrollIndicator: "oui-mx-3"
|
|
2877
|
+
},
|
|
2878
|
+
className: "oui-mobileMarketsDataList-community-tabs",
|
|
2879
|
+
showScrollIndicator: true,
|
|
2880
|
+
renderPanel: renderCommunityList
|
|
2881
|
+
}
|
|
2882
|
+
)
|
|
2883
|
+
] }) : renderTab(meta.tabName)
|
|
2884
|
+
},
|
|
2885
|
+
key
|
|
2886
|
+
);
|
|
2887
|
+
}
|
|
2888
|
+
return /* @__PURE__ */ jsxs(
|
|
2563
2889
|
TabPanel,
|
|
2564
2890
|
{
|
|
2565
|
-
title:
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2891
|
+
title: composeTabTitle(tab.name ?? key, {
|
|
2892
|
+
icon: resolveTabTriggerIcon(tab),
|
|
2893
|
+
suffix: tab.suffix
|
|
2894
|
+
}),
|
|
2895
|
+
value: key,
|
|
2896
|
+
children: [
|
|
2897
|
+
/* @__PURE__ */ jsx(
|
|
2898
|
+
SearchInput,
|
|
2899
|
+
{
|
|
2900
|
+
classNames: {
|
|
2901
|
+
root: cn("oui-mx-3 oui-mb-4 oui-mt-5", "oui-mb-2")
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
),
|
|
2905
|
+
/* @__PURE__ */ jsx(
|
|
2906
|
+
MarketsListWidget,
|
|
2907
|
+
{
|
|
2908
|
+
type: "all" /* All */,
|
|
2909
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
2910
|
+
initialSort: tabSort[key],
|
|
2911
|
+
onSort: onTabSort(key),
|
|
2912
|
+
getColumns,
|
|
2913
|
+
rowClassName: "!oui-h-[34px]"
|
|
2914
|
+
}
|
|
2915
|
+
)
|
|
2916
|
+
]
|
|
2917
|
+
},
|
|
2918
|
+
key
|
|
2919
|
+
);
|
|
2920
|
+
})
|
|
2572
2921
|
}
|
|
2573
2922
|
) });
|
|
2574
2923
|
};
|
|
@@ -2983,7 +3332,7 @@ var init_marketsListFull_script = __esm({
|
|
|
2983
3332
|
rwa: MarketsType.RWA
|
|
2984
3333
|
};
|
|
2985
3334
|
useMarketsListFullScript = (options) => {
|
|
2986
|
-
const { type = "all" } = options;
|
|
3335
|
+
const { type = "all", dataFilter } = options;
|
|
2987
3336
|
const [loading, setLoading] = useState(true);
|
|
2988
3337
|
const { setPage, pagination } = usePagination({
|
|
2989
3338
|
pageSize: 100
|
|
@@ -2992,9 +3341,10 @@ var init_marketsListFull_script = __esm({
|
|
|
2992
3341
|
const { searchValue } = useMarketsContext();
|
|
2993
3342
|
const { onSort, getSortedList, sort } = useSort(options.initialSort);
|
|
2994
3343
|
const dataSource = useMemo(() => {
|
|
2995
|
-
const
|
|
3344
|
+
const filtered = typeof dataFilter === "function" ? dataFilter(data) : data;
|
|
3345
|
+
const searchList = searchBySymbol(filtered, searchValue, "base-type");
|
|
2996
3346
|
return getSortedList(searchList);
|
|
2997
|
-
}, [data, getSortedList, searchValue]);
|
|
3347
|
+
}, [data, dataFilter, getSortedList, searchValue]);
|
|
2998
3348
|
useEffect(() => {
|
|
2999
3349
|
setLoading(false);
|
|
3000
3350
|
}, [data]);
|
|
@@ -3050,11 +3400,15 @@ var init_marketsListFull = __esm({
|
|
|
3050
3400
|
init_marketsListFull_widget();
|
|
3051
3401
|
}
|
|
3052
3402
|
});
|
|
3053
|
-
var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget, MarketsDataList;
|
|
3403
|
+
var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget, DEFAULT_SORT, MarketsDataList;
|
|
3054
3404
|
var init_marketsDataList_ui = __esm({
|
|
3055
3405
|
"src/pages/home/marketsDataList/marketsDataList.ui.tsx"() {
|
|
3406
|
+
init_communityBrokerTabs();
|
|
3056
3407
|
init_favoritesEmpty();
|
|
3408
|
+
init_marketsProvider();
|
|
3057
3409
|
init_rwaTab();
|
|
3410
|
+
init_tabUtils();
|
|
3411
|
+
init_useCommunityTabs();
|
|
3058
3412
|
init_icons();
|
|
3059
3413
|
init_type();
|
|
3060
3414
|
LazySearchInput = React6.lazy(
|
|
@@ -3072,10 +3426,53 @@ var init_marketsDataList_ui = __esm({
|
|
|
3072
3426
|
return { default: mod.MarketsListFullWidget };
|
|
3073
3427
|
})
|
|
3074
3428
|
);
|
|
3429
|
+
DEFAULT_SORT = { sortKey: "24h_amount", sortOrder: "desc" };
|
|
3075
3430
|
MarketsDataList = (props) => {
|
|
3076
3431
|
const { searchValue, activeTab, onTabChange } = props;
|
|
3077
3432
|
const { t } = useTranslation();
|
|
3078
|
-
|
|
3433
|
+
const { tabs } = useMarketsContext();
|
|
3434
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
3435
|
+
const builtInMeta = useMemo(
|
|
3436
|
+
() => ({
|
|
3437
|
+
favorites: {
|
|
3438
|
+
title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
|
|
3439
|
+
value: "favorites",
|
|
3440
|
+
testid: "oui-testid-markets-favorites-tab",
|
|
3441
|
+
initialSort: DEFAULT_SORT
|
|
3442
|
+
},
|
|
3443
|
+
community: {
|
|
3444
|
+
title: t("markets.community"),
|
|
3445
|
+
value: "community",
|
|
3446
|
+
testid: "oui-testid-markets-community-tab",
|
|
3447
|
+
initialSort: DEFAULT_SORT
|
|
3448
|
+
},
|
|
3449
|
+
all: {
|
|
3450
|
+
title: t("markets.allMarkets"),
|
|
3451
|
+
icon: /* @__PURE__ */ jsx(AllMarketsIcon, {}),
|
|
3452
|
+
value: "all",
|
|
3453
|
+
testid: "oui-testid-markets-all-tab",
|
|
3454
|
+
listType: "all",
|
|
3455
|
+
initialSort: DEFAULT_SORT
|
|
3456
|
+
},
|
|
3457
|
+
rwa: {
|
|
3458
|
+
title: /* @__PURE__ */ jsx(RwaIconTab, {}),
|
|
3459
|
+
value: "rwa",
|
|
3460
|
+
testid: "oui-testid-markets-rwa-tab",
|
|
3461
|
+
listType: "rwa",
|
|
3462
|
+
initialSort: DEFAULT_SORT
|
|
3463
|
+
},
|
|
3464
|
+
newListing: {
|
|
3465
|
+
title: t("markets.newListings"),
|
|
3466
|
+
icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
|
|
3467
|
+
value: "new",
|
|
3468
|
+
testid: "oui-testid-markets-newListing-tab",
|
|
3469
|
+
listType: "new",
|
|
3470
|
+
initialSort: { sortKey: "created_time", sortOrder: "desc" }
|
|
3471
|
+
}
|
|
3472
|
+
}),
|
|
3473
|
+
[t]
|
|
3474
|
+
);
|
|
3475
|
+
return /* @__PURE__ */ jsx(Box, { id: "oui-markets-list", intensity: 900, p: 6, r: "2xl", children: /* @__PURE__ */ jsx(
|
|
3079
3476
|
Tabs,
|
|
3080
3477
|
{
|
|
3081
3478
|
variant: "contained",
|
|
@@ -3085,93 +3482,98 @@ var init_marketsDataList_ui = __esm({
|
|
|
3085
3482
|
trailing: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazySearchInput, { classNames: { root: "oui-my-1 oui-w-[240px]" } }) }),
|
|
3086
3483
|
classNames: {
|
|
3087
3484
|
tabsList: "oui-tabs-markets-list",
|
|
3088
|
-
tabsContent: "oui-tabs-markets-content"
|
|
3485
|
+
tabsContent: "oui-tabs-markets-content",
|
|
3486
|
+
scrollIndicator: "oui-mr-3"
|
|
3089
3487
|
},
|
|
3090
3488
|
className: "oui-markets-list-tabs",
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3489
|
+
showScrollIndicator: true,
|
|
3490
|
+
children: tabs?.map((tab, index) => {
|
|
3491
|
+
const key = tabKey(tab, index);
|
|
3492
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
3493
|
+
const meta = isBuiltIn ? builtInMeta[tab.type] : void 0;
|
|
3494
|
+
if (isBuiltIn && meta) {
|
|
3495
|
+
const title = tab.type === "favorites" ? composeTabTitle(tab.name, {
|
|
3496
|
+
icon: resolveTabTriggerIcon(tab, /* @__PURE__ */ jsx(FavoritesIcon, {})),
|
|
3497
|
+
suffix: tab.suffix
|
|
3498
|
+
}) : tab.type === "rwa" ? resolveTabTitle(tab, {}, /* @__PURE__ */ jsx(RwaIconTab, {})) : composeTabTitle(tab.name ?? meta.title, {
|
|
3499
|
+
suffix: tab.suffix
|
|
3500
|
+
});
|
|
3501
|
+
return /* @__PURE__ */ jsx(
|
|
3502
|
+
TabPanel,
|
|
3503
|
+
{
|
|
3504
|
+
classNames: {
|
|
3505
|
+
trigger: `oui-tabs-${meta.value}-trigger`,
|
|
3506
|
+
content: `oui-tabs-${meta.value}-content`
|
|
3507
|
+
},
|
|
3508
|
+
title,
|
|
3509
|
+
icon: tab.type === "favorites" || tab.type === "rwa" ? void 0 : resolveTabTriggerIcon(tab, meta.icon),
|
|
3510
|
+
value: meta.value,
|
|
3511
|
+
testid: meta.testid,
|
|
3512
|
+
children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: tab.type === "favorites" ? /* @__PURE__ */ jsx(
|
|
3513
|
+
LazyFavoritesListFullWidget,
|
|
3514
|
+
{
|
|
3515
|
+
emptyView: !searchValue && /* @__PURE__ */ jsx(
|
|
3516
|
+
FavoritesEmpty,
|
|
3517
|
+
{
|
|
3518
|
+
onClick: () => onTabChange("all" /* All */)
|
|
3519
|
+
}
|
|
3520
|
+
)
|
|
3521
|
+
}
|
|
3522
|
+
) : tab.type === "community" ? /* @__PURE__ */ jsx(
|
|
3523
|
+
CommunityBrokerTabs,
|
|
3524
|
+
{
|
|
3525
|
+
storageKey: "orderly_markets_datalist_community_sel_sub_tab",
|
|
3526
|
+
size: "md",
|
|
3527
|
+
classNames: {
|
|
3528
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
3529
|
+
tabsContent: "oui-h-full"
|
|
3530
|
+
},
|
|
3531
|
+
className: "oui-marketsDataList-community-tabs",
|
|
3532
|
+
showScrollIndicator: true,
|
|
3533
|
+
renderPanel: (selected) => /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3534
|
+
LazyMarketsListFullWidget,
|
|
3535
|
+
{
|
|
3536
|
+
type: "all",
|
|
3537
|
+
initialSort: meta.initialSort,
|
|
3538
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
3539
|
+
}
|
|
3540
|
+
) })
|
|
3541
|
+
}
|
|
3542
|
+
) : /* @__PURE__ */ jsx(
|
|
3543
|
+
LazyMarketsListFullWidget,
|
|
3544
|
+
{
|
|
3545
|
+
type: meta.listType,
|
|
3546
|
+
initialSort: meta.initialSort
|
|
3547
|
+
}
|
|
3548
|
+
) })
|
|
3098
3549
|
},
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
LazyFavoritesListFullWidget,
|
|
3104
|
-
{
|
|
3105
|
-
emptyView: !searchValue && /* @__PURE__ */ jsx(
|
|
3106
|
-
FavoritesEmpty,
|
|
3107
|
-
{
|
|
3108
|
-
onClick: () => onTabChange("all" /* All */)
|
|
3109
|
-
}
|
|
3110
|
-
)
|
|
3111
|
-
}
|
|
3112
|
-
) })
|
|
3113
|
-
}
|
|
3114
|
-
),
|
|
3115
|
-
/* @__PURE__ */ jsx(
|
|
3550
|
+
key
|
|
3551
|
+
);
|
|
3552
|
+
}
|
|
3553
|
+
return /* @__PURE__ */ jsx(
|
|
3116
3554
|
TabPanel,
|
|
3117
3555
|
{
|
|
3118
3556
|
classNames: {
|
|
3119
|
-
trigger:
|
|
3120
|
-
content:
|
|
3557
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
3558
|
+
content: `oui-tabs-${key}-content`
|
|
3121
3559
|
},
|
|
3122
|
-
title:
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3560
|
+
title: composeTabTitle(tab.name ?? key, {
|
|
3561
|
+
icon: resolveTabTriggerIcon(tab),
|
|
3562
|
+
suffix: tab.suffix
|
|
3563
|
+
}),
|
|
3564
|
+
value: key,
|
|
3126
3565
|
children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3127
3566
|
LazyMarketsListFullWidget,
|
|
3128
3567
|
{
|
|
3129
3568
|
type: "all",
|
|
3130
|
-
initialSort:
|
|
3569
|
+
initialSort: DEFAULT_SORT,
|
|
3570
|
+
dataFilter: tabDataFilters[key]
|
|
3131
3571
|
}
|
|
3132
3572
|
) })
|
|
3133
|
-
}
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
{
|
|
3138
|
-
classNames: {
|
|
3139
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
3140
|
-
content: "oui-tabs-rwa-content"
|
|
3141
|
-
},
|
|
3142
|
-
title: /* @__PURE__ */ jsx(RwaIconTab, {}),
|
|
3143
|
-
value: "rwa",
|
|
3144
|
-
testid: "oui-testid-markets-rwa-tab",
|
|
3145
|
-
children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3146
|
-
LazyMarketsListFullWidget,
|
|
3147
|
-
{
|
|
3148
|
-
type: "rwa",
|
|
3149
|
-
initialSort: { sortKey: "24h_amount", sortOrder: "desc" }
|
|
3150
|
-
}
|
|
3151
|
-
) })
|
|
3152
|
-
}
|
|
3153
|
-
),
|
|
3154
|
-
/* @__PURE__ */ jsx(
|
|
3155
|
-
TabPanel,
|
|
3156
|
-
{
|
|
3157
|
-
classNames: {
|
|
3158
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
3159
|
-
content: "oui-tabs-newListings-content"
|
|
3160
|
-
},
|
|
3161
|
-
title: t("markets.newListings"),
|
|
3162
|
-
icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
|
|
3163
|
-
value: "new",
|
|
3164
|
-
testid: "oui-testid-markets-newListings-tab",
|
|
3165
|
-
children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3166
|
-
LazyMarketsListFullWidget,
|
|
3167
|
-
{
|
|
3168
|
-
type: "new",
|
|
3169
|
-
initialSort: { sortKey: "created_time", sortOrder: "desc" }
|
|
3170
|
-
}
|
|
3171
|
-
) })
|
|
3172
|
-
}
|
|
3173
|
-
)
|
|
3174
|
-
]
|
|
3573
|
+
},
|
|
3574
|
+
key
|
|
3575
|
+
);
|
|
3576
|
+
})
|
|
3175
3577
|
}
|
|
3176
3578
|
) });
|
|
3177
3579
|
};
|
|
@@ -3208,10 +3610,13 @@ var init_marketsDataList = __esm({
|
|
|
3208
3610
|
var LazySearchInput2, LazyMarketsListWidget, cls, ExpandMarkets;
|
|
3209
3611
|
var init_expandMarkets_ui = __esm({
|
|
3210
3612
|
"src/components/expandMarkets/expandMarkets.ui.tsx"() {
|
|
3211
|
-
|
|
3613
|
+
init_useCommunityTabs();
|
|
3212
3614
|
init_type();
|
|
3615
|
+
init_communityBrokerTabs();
|
|
3616
|
+
init_marketsProvider();
|
|
3213
3617
|
init_rwaTab();
|
|
3214
3618
|
init_useFavoritesExtraProps();
|
|
3619
|
+
init_tabUtils();
|
|
3215
3620
|
LazySearchInput2 = React6.lazy(
|
|
3216
3621
|
() => Promise.resolve().then(() => (init_searchInput(), searchInput_exports)).then((mod) => {
|
|
3217
3622
|
return { default: mod.SearchInput };
|
|
@@ -3225,25 +3630,28 @@ var init_expandMarkets_ui = __esm({
|
|
|
3225
3630
|
cls = "oui-h-[calc(100%_-_36px)]";
|
|
3226
3631
|
ExpandMarkets = (props) => {
|
|
3227
3632
|
const { activeTab, onTabChange, tabSort, onTabSort } = props;
|
|
3228
|
-
const { t } = useTranslation();
|
|
3229
3633
|
const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
|
|
3230
|
-
const
|
|
3634
|
+
const builtInTitles = useBuiltInTitles();
|
|
3635
|
+
const { tabs } = useMarketsContext();
|
|
3636
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
3637
|
+
const renderBuiltInContent = (type) => {
|
|
3638
|
+
const tabType = type;
|
|
3231
3639
|
return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3232
3640
|
LazyMarketsListWidget,
|
|
3233
3641
|
{
|
|
3234
|
-
type,
|
|
3642
|
+
type: tabType,
|
|
3235
3643
|
initialSort: tabSort[type],
|
|
3236
|
-
onSort: onTabSort(
|
|
3644
|
+
onSort: onTabSort(tabType),
|
|
3237
3645
|
tableClassNames: {
|
|
3238
3646
|
root: "oui-expandMarkets-list",
|
|
3239
3647
|
scroll: cn(
|
|
3240
3648
|
"oui-px-1",
|
|
3241
|
-
|
|
3649
|
+
tabType === "favorites" /* Favorites */ ? "oui-pb-9" : "oui-pb-2"
|
|
3242
3650
|
)
|
|
3243
3651
|
},
|
|
3244
|
-
...getFavoritesProps(
|
|
3652
|
+
...getFavoritesProps(tabType),
|
|
3245
3653
|
emptyView: renderEmptyView({
|
|
3246
|
-
type,
|
|
3654
|
+
type: tabType,
|
|
3247
3655
|
onClick: () => {
|
|
3248
3656
|
onTabChange("all" /* All */);
|
|
3249
3657
|
}
|
|
@@ -3251,6 +3659,48 @@ var init_expandMarkets_ui = __esm({
|
|
|
3251
3659
|
}
|
|
3252
3660
|
) }) });
|
|
3253
3661
|
};
|
|
3662
|
+
const renderCommunityContent = () => {
|
|
3663
|
+
return /* @__PURE__ */ jsx(
|
|
3664
|
+
CommunityBrokerTabs,
|
|
3665
|
+
{
|
|
3666
|
+
storageKey: "orderly_expand_markets_community_sel_sub_tab",
|
|
3667
|
+
classNames: {
|
|
3668
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
3669
|
+
tabsContent: "oui-h-full"
|
|
3670
|
+
},
|
|
3671
|
+
className: cn("oui-expandMarkets-community-tabs", cls),
|
|
3672
|
+
showScrollIndicator: true,
|
|
3673
|
+
renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3674
|
+
LazyMarketsListWidget,
|
|
3675
|
+
{
|
|
3676
|
+
type: "all" /* All */,
|
|
3677
|
+
initialSort: tabSort["community" /* Community */],
|
|
3678
|
+
onSort: onTabSort("community" /* Community */),
|
|
3679
|
+
tableClassNames: {
|
|
3680
|
+
root: "oui-expandMarkets-list",
|
|
3681
|
+
scroll: cn("oui-px-1", "oui-pb-2")
|
|
3682
|
+
},
|
|
3683
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
3684
|
+
}
|
|
3685
|
+
) }) })
|
|
3686
|
+
}
|
|
3687
|
+
);
|
|
3688
|
+
};
|
|
3689
|
+
const renderCustomContent = (key) => {
|
|
3690
|
+
return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3691
|
+
LazyMarketsListWidget,
|
|
3692
|
+
{
|
|
3693
|
+
type: "all" /* All */,
|
|
3694
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
3695
|
+
initialSort: tabSort[key],
|
|
3696
|
+
onSort: onTabSort(key),
|
|
3697
|
+
tableClassNames: {
|
|
3698
|
+
root: "oui-expandMarkets-list",
|
|
3699
|
+
scroll: cn("oui-px-1", "oui-pb-2")
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
) }) });
|
|
3703
|
+
};
|
|
3254
3704
|
return /* @__PURE__ */ jsxs(
|
|
3255
3705
|
Box,
|
|
3256
3706
|
{
|
|
@@ -3266,7 +3716,7 @@ var init_expandMarkets_ui = __esm({
|
|
|
3266
3716
|
classNames: { root: "oui-expandMarkets-search-input" }
|
|
3267
3717
|
}
|
|
3268
3718
|
) }) }),
|
|
3269
|
-
/* @__PURE__ */
|
|
3719
|
+
/* @__PURE__ */ jsx(
|
|
3270
3720
|
Tabs,
|
|
3271
3721
|
{
|
|
3272
3722
|
variant: "contained",
|
|
@@ -3280,68 +3730,24 @@ var init_expandMarkets_ui = __esm({
|
|
|
3280
3730
|
},
|
|
3281
3731
|
className: cn("oui-expandMarkets-tabs", cls),
|
|
3282
3732
|
showScrollIndicator: true,
|
|
3283
|
-
children:
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
trigger: "oui-tabs-favorites-trigger",
|
|
3289
|
-
content: "oui-tabs-favorites-content"
|
|
3290
|
-
},
|
|
3291
|
-
title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
|
|
3292
|
-
value: "favorites" /* Favorites */,
|
|
3293
|
-
children: renderTab("favorites" /* Favorites */)
|
|
3294
|
-
}
|
|
3295
|
-
),
|
|
3296
|
-
/* @__PURE__ */ jsx(
|
|
3733
|
+
children: tabs?.map((tab, index) => {
|
|
3734
|
+
const key = tabKey(tab, index);
|
|
3735
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
3736
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
3737
|
+
return /* @__PURE__ */ jsx(
|
|
3297
3738
|
TabPanel,
|
|
3298
3739
|
{
|
|
3299
3740
|
classNames: {
|
|
3300
|
-
trigger:
|
|
3301
|
-
content:
|
|
3741
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
3742
|
+
content: `oui-tabs-${key}-content`
|
|
3302
3743
|
},
|
|
3303
|
-
title:
|
|
3304
|
-
value:
|
|
3305
|
-
children:
|
|
3306
|
-
}
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
{
|
|
3311
|
-
classNames: {
|
|
3312
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
3313
|
-
content: "oui-tabs-rwa-content"
|
|
3314
|
-
},
|
|
3315
|
-
title: /* @__PURE__ */ jsx(RwaTab, {}),
|
|
3316
|
-
value: "rwa" /* Rwa */,
|
|
3317
|
-
children: renderTab("rwa" /* Rwa */)
|
|
3318
|
-
}
|
|
3319
|
-
),
|
|
3320
|
-
/* @__PURE__ */ jsx(
|
|
3321
|
-
TabPanel,
|
|
3322
|
-
{
|
|
3323
|
-
classNames: {
|
|
3324
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
3325
|
-
content: "oui-tabs-newListings-content"
|
|
3326
|
-
},
|
|
3327
|
-
title: t("markets.newListings"),
|
|
3328
|
-
value: "newListing" /* NewListing */,
|
|
3329
|
-
children: renderTab("newListing" /* NewListing */)
|
|
3330
|
-
}
|
|
3331
|
-
),
|
|
3332
|
-
/* @__PURE__ */ jsx(
|
|
3333
|
-
TabPanel,
|
|
3334
|
-
{
|
|
3335
|
-
classNames: {
|
|
3336
|
-
trigger: "oui-tabs-recent-trigger",
|
|
3337
|
-
content: "oui-tabs-recent-content"
|
|
3338
|
-
},
|
|
3339
|
-
title: t("markets.recent"),
|
|
3340
|
-
value: "recent" /* Recent */,
|
|
3341
|
-
children: renderTab("recent" /* Recent */)
|
|
3342
|
-
}
|
|
3343
|
-
)
|
|
3344
|
-
]
|
|
3744
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaTab, {})),
|
|
3745
|
+
value: key,
|
|
3746
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
3747
|
+
},
|
|
3748
|
+
key
|
|
3749
|
+
);
|
|
3750
|
+
})
|
|
3345
3751
|
}
|
|
3346
3752
|
)
|
|
3347
3753
|
]
|
|
@@ -3398,10 +3804,94 @@ var init_expandMarkets_script = __esm({
|
|
|
3398
3804
|
init_useTabSort();
|
|
3399
3805
|
}
|
|
3400
3806
|
});
|
|
3807
|
+
|
|
3808
|
+
// src/registry/builtInTabRegistry.ts
|
|
3809
|
+
var builtInTabs, componentDefaultTabs;
|
|
3810
|
+
var init_builtInTabRegistry = __esm({
|
|
3811
|
+
"src/registry/builtInTabRegistry.ts"() {
|
|
3812
|
+
builtInTabs = {
|
|
3813
|
+
favorites: { type: "favorites" },
|
|
3814
|
+
community: {
|
|
3815
|
+
type: "community",
|
|
3816
|
+
isVisible: (symbolList) => {
|
|
3817
|
+
return symbolList.some((m) => Boolean(m?.broker_id));
|
|
3818
|
+
}
|
|
3819
|
+
},
|
|
3820
|
+
all: { type: "all" },
|
|
3821
|
+
rwa: { type: "rwa" },
|
|
3822
|
+
newListing: { type: "newListing" },
|
|
3823
|
+
recent: { type: "recent" }
|
|
3824
|
+
};
|
|
3825
|
+
componentDefaultTabs = {
|
|
3826
|
+
marketsSheet: [
|
|
3827
|
+
{ type: "favorites" },
|
|
3828
|
+
{ type: "all" },
|
|
3829
|
+
{ type: "rwa" },
|
|
3830
|
+
{ ...builtInTabs.community }
|
|
3831
|
+
],
|
|
3832
|
+
expandMarkets: [
|
|
3833
|
+
{ type: "favorites" },
|
|
3834
|
+
{ type: "all" },
|
|
3835
|
+
{ type: "rwa" },
|
|
3836
|
+
{ ...builtInTabs.community },
|
|
3837
|
+
{ type: "newListing" },
|
|
3838
|
+
{ type: "recent" }
|
|
3839
|
+
],
|
|
3840
|
+
dropDownMarkets: [
|
|
3841
|
+
{ type: "favorites" },
|
|
3842
|
+
{ type: "all" },
|
|
3843
|
+
{ type: "rwa" },
|
|
3844
|
+
{ ...builtInTabs.community },
|
|
3845
|
+
{ type: "newListing" },
|
|
3846
|
+
{ type: "recent" }
|
|
3847
|
+
],
|
|
3848
|
+
subMenuMarkets: [
|
|
3849
|
+
{ type: "favorites" },
|
|
3850
|
+
{ type: "all" },
|
|
3851
|
+
{ type: "rwa" },
|
|
3852
|
+
{ ...builtInTabs.community },
|
|
3853
|
+
{ type: "newListing" },
|
|
3854
|
+
{ type: "recent" }
|
|
3855
|
+
],
|
|
3856
|
+
marketsDataList: [
|
|
3857
|
+
{ type: "favorites" },
|
|
3858
|
+
{ type: "all" },
|
|
3859
|
+
{ type: "rwa" },
|
|
3860
|
+
{ ...builtInTabs.community },
|
|
3861
|
+
{ type: "newListing" }
|
|
3862
|
+
],
|
|
3863
|
+
horizontalMarkets: [
|
|
3864
|
+
{ type: "all" },
|
|
3865
|
+
{ type: "recent" },
|
|
3866
|
+
{ type: "newListing" },
|
|
3867
|
+
{ type: "favorites" }
|
|
3868
|
+
]
|
|
3869
|
+
};
|
|
3870
|
+
}
|
|
3871
|
+
});
|
|
3872
|
+
function useMarketCategories(componentKey) {
|
|
3873
|
+
const marketTabs = useMarketCategoriesConfig();
|
|
3874
|
+
const { i18n: i18n2 } = useTranslation();
|
|
3875
|
+
const symbolList = useMarketList();
|
|
3876
|
+
const rwaSymbolsInfo = useRwaSymbolsInfo();
|
|
3877
|
+
return useMemo(() => {
|
|
3878
|
+
const original = componentDefaultTabs[componentKey];
|
|
3879
|
+
const resolved = marketTabs ? marketTabs(original, { componentKey, builtIn: builtInTabs }) : original;
|
|
3880
|
+
return resolved.filter(
|
|
3881
|
+
(tab) => tab.isVisible?.(symbolList, { rwaSymbolsInfo }) ?? true
|
|
3882
|
+
);
|
|
3883
|
+
}, [marketTabs, componentKey, i18n2.language, symbolList, rwaSymbolsInfo]);
|
|
3884
|
+
}
|
|
3885
|
+
var init_useMarketCategories = __esm({
|
|
3886
|
+
"src/components/shared/hooks/useMarketCategories.ts"() {
|
|
3887
|
+
init_builtInTabRegistry();
|
|
3888
|
+
}
|
|
3889
|
+
});
|
|
3401
3890
|
var ExpandMarketsWidget;
|
|
3402
3891
|
var init_expandMarkets_widget = __esm({
|
|
3403
3892
|
"src/components/expandMarkets/expandMarkets.widget.tsx"() {
|
|
3404
3893
|
init_marketsProvider();
|
|
3894
|
+
init_useMarketCategories();
|
|
3405
3895
|
init_expandMarkets_script();
|
|
3406
3896
|
init_expandMarkets_ui();
|
|
3407
3897
|
ExpandMarketsWidget = (props) => {
|
|
@@ -3409,11 +3899,13 @@ var init_expandMarkets_widget = __esm({
|
|
|
3409
3899
|
activeTab: props.activeTab,
|
|
3410
3900
|
onTabChange: props.onTabChange
|
|
3411
3901
|
});
|
|
3902
|
+
const tabs = useMarketCategories("expandMarkets");
|
|
3412
3903
|
return /* @__PURE__ */ jsx(
|
|
3413
3904
|
MarketsProvider,
|
|
3414
3905
|
{
|
|
3415
3906
|
symbol: props.symbol,
|
|
3416
3907
|
onSymbolChange: props.onSymbolChange,
|
|
3908
|
+
tabs,
|
|
3417
3909
|
children: /* @__PURE__ */ jsx(ExpandMarkets, { ...state })
|
|
3418
3910
|
}
|
|
3419
3911
|
);
|
|
@@ -3458,7 +3950,7 @@ var init_columns = __esm({
|
|
|
3458
3950
|
title: t("markets.column.market"),
|
|
3459
3951
|
dataIndex: "symbol",
|
|
3460
3952
|
onSort: true,
|
|
3461
|
-
width:
|
|
3953
|
+
width: 180,
|
|
3462
3954
|
className: isMobile ? "oui-pl-0" : void 0,
|
|
3463
3955
|
render: (value, record) => {
|
|
3464
3956
|
if (isMobile) {
|
|
@@ -3848,7 +4340,7 @@ var init_columns2 = __esm({
|
|
|
3848
4340
|
{
|
|
3849
4341
|
title: t("markets.column.market"),
|
|
3850
4342
|
dataIndex: "symbol",
|
|
3851
|
-
width:
|
|
4343
|
+
width: 220,
|
|
3852
4344
|
onSort: true,
|
|
3853
4345
|
className: isMobile ? "oui-pl-0" : void 0,
|
|
3854
4346
|
render: (value, record) => {
|
|
@@ -4302,12 +4794,15 @@ var init_column4 = __esm({
|
|
|
4302
4794
|
var DropDownMarkets, DropDownMarketsConetnt;
|
|
4303
4795
|
var init_dropDownMarkets_ui = __esm({
|
|
4304
4796
|
"src/components/dropDownMarkets/dropDownMarkets.ui.tsx"() {
|
|
4305
|
-
|
|
4797
|
+
init_useCommunityTabs();
|
|
4306
4798
|
init_type();
|
|
4799
|
+
init_communityBrokerTabs();
|
|
4307
4800
|
init_marketsList();
|
|
4801
|
+
init_marketsProvider();
|
|
4308
4802
|
init_rwaTab();
|
|
4309
4803
|
init_searchInput();
|
|
4310
4804
|
init_useFavoritesExtraProps();
|
|
4805
|
+
init_tabUtils();
|
|
4311
4806
|
init_column4();
|
|
4312
4807
|
DropDownMarkets = (props) => {
|
|
4313
4808
|
return /* @__PURE__ */ jsxs(DropdownMenuRoot, { open: props.open, onOpenChange: props.onOpenChange, children: [
|
|
@@ -4331,8 +4826,8 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4331
4826
|
};
|
|
4332
4827
|
DropDownMarketsConetnt = (props) => {
|
|
4333
4828
|
const { activeTab, onTabChange, tabSort, onTabSort } = props;
|
|
4334
|
-
const { t } = useTranslation();
|
|
4335
4829
|
const getColumns = useDropDownMarketsColumns();
|
|
4830
|
+
const builtInTitles = useBuiltInTitles();
|
|
4336
4831
|
const search = /* @__PURE__ */ jsxs(Flex, { className: "oui-dropDownMarkets-search", mx: 3, gapX: 3, pt: 3, pb: 2, children: [
|
|
4337
4832
|
/* @__PURE__ */ jsx(
|
|
4338
4833
|
SearchInput,
|
|
@@ -4354,22 +4849,24 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4354
4849
|
] });
|
|
4355
4850
|
const cls3 = "oui-h-[calc(100%_-_36px)]";
|
|
4356
4851
|
const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
|
|
4357
|
-
const
|
|
4852
|
+
const { tabs } = useMarketsContext();
|
|
4853
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
4854
|
+
const renderBuiltInContent = (tabType) => {
|
|
4358
4855
|
return /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
|
|
4359
4856
|
MarketsListWidget,
|
|
4360
4857
|
{
|
|
4361
|
-
type,
|
|
4362
|
-
initialSort: tabSort[
|
|
4363
|
-
onSort: onTabSort(
|
|
4858
|
+
type: tabType,
|
|
4859
|
+
initialSort: tabSort[tabType],
|
|
4860
|
+
onSort: onTabSort(tabType),
|
|
4364
4861
|
getColumns,
|
|
4365
4862
|
tableClassNames: {
|
|
4366
4863
|
root: cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
|
|
4367
4864
|
scroll: "oui-pb-5 oui-px-1"
|
|
4368
4865
|
},
|
|
4369
4866
|
rowClassName: "!oui-h-[34px]",
|
|
4370
|
-
...getFavoritesProps(
|
|
4867
|
+
...getFavoritesProps(tabType),
|
|
4371
4868
|
emptyView: renderEmptyView({
|
|
4372
|
-
type,
|
|
4869
|
+
type: tabType,
|
|
4373
4870
|
onClick: () => {
|
|
4374
4871
|
onTabChange("all" /* All */);
|
|
4375
4872
|
}
|
|
@@ -4377,6 +4874,52 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4377
4874
|
}
|
|
4378
4875
|
) });
|
|
4379
4876
|
};
|
|
4877
|
+
const renderCommunityContent = () => {
|
|
4878
|
+
return /* @__PURE__ */ jsx(
|
|
4879
|
+
CommunityBrokerTabs,
|
|
4880
|
+
{
|
|
4881
|
+
storageKey: "orderly_dropdown_markets_community_sel_sub_tab",
|
|
4882
|
+
classNames: {
|
|
4883
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
4884
|
+
tabsContent: "oui-h-full"
|
|
4885
|
+
},
|
|
4886
|
+
className: cn("oui-dropDownMarkets-community-tabs", cls3),
|
|
4887
|
+
showScrollIndicator: true,
|
|
4888
|
+
renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
|
|
4889
|
+
MarketsListWidget,
|
|
4890
|
+
{
|
|
4891
|
+
type: "all" /* All */,
|
|
4892
|
+
initialSort: tabSort["community" /* Community */],
|
|
4893
|
+
onSort: onTabSort("community" /* Community */),
|
|
4894
|
+
getColumns,
|
|
4895
|
+
tableClassNames: {
|
|
4896
|
+
root: cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
|
|
4897
|
+
scroll: "oui-pb-5 oui-px-1"
|
|
4898
|
+
},
|
|
4899
|
+
rowClassName: "!oui-h-[34px]",
|
|
4900
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
4901
|
+
}
|
|
4902
|
+
) })
|
|
4903
|
+
}
|
|
4904
|
+
);
|
|
4905
|
+
};
|
|
4906
|
+
const renderCustomContent = (key) => {
|
|
4907
|
+
return /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
|
|
4908
|
+
MarketsListWidget,
|
|
4909
|
+
{
|
|
4910
|
+
type: "all" /* All */,
|
|
4911
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
4912
|
+
initialSort: tabSort[key],
|
|
4913
|
+
onSort: onTabSort(key),
|
|
4914
|
+
getColumns,
|
|
4915
|
+
tableClassNames: {
|
|
4916
|
+
root: cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
|
|
4917
|
+
scroll: "oui-pb-5 oui-px-1"
|
|
4918
|
+
},
|
|
4919
|
+
rowClassName: "!oui-h-[34px]"
|
|
4920
|
+
}
|
|
4921
|
+
) });
|
|
4922
|
+
};
|
|
4380
4923
|
return /* @__PURE__ */ jsxs(
|
|
4381
4924
|
Box,
|
|
4382
4925
|
{
|
|
@@ -4388,7 +4931,7 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4388
4931
|
intensity: 800,
|
|
4389
4932
|
children: [
|
|
4390
4933
|
search,
|
|
4391
|
-
/* @__PURE__ */
|
|
4934
|
+
/* @__PURE__ */ jsx(
|
|
4392
4935
|
Tabs,
|
|
4393
4936
|
{
|
|
4394
4937
|
variant: "contained",
|
|
@@ -4396,72 +4939,31 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4396
4939
|
value: activeTab,
|
|
4397
4940
|
onValueChange: onTabChange,
|
|
4398
4941
|
classNames: {
|
|
4399
|
-
|
|
4400
|
-
|
|
4942
|
+
tabsListContainer: "oui-px-3",
|
|
4943
|
+
tabsList: "oui-my-[6px]",
|
|
4944
|
+
tabsContent: "oui-h-full",
|
|
4945
|
+
scrollIndicator: "oui-mx-0"
|
|
4401
4946
|
},
|
|
4402
4947
|
className: cn("oui-dropDownMarkets-tabs", cls3),
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
content: "oui-tabs-favorites-content"
|
|
4410
|
-
},
|
|
4411
|
-
title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
|
|
4412
|
-
value: "favorites" /* Favorites */,
|
|
4413
|
-
children: renderTab("favorites" /* Favorites */)
|
|
4414
|
-
}
|
|
4415
|
-
),
|
|
4416
|
-
/* @__PURE__ */ jsx(
|
|
4417
|
-
TabPanel,
|
|
4418
|
-
{
|
|
4419
|
-
classNames: {
|
|
4420
|
-
trigger: "oui-tabs-all-trigger",
|
|
4421
|
-
content: "oui-tabs-all-content"
|
|
4422
|
-
},
|
|
4423
|
-
title: t("common.all"),
|
|
4424
|
-
value: "all" /* All */,
|
|
4425
|
-
children: renderTab("all" /* All */)
|
|
4426
|
-
}
|
|
4427
|
-
),
|
|
4428
|
-
/* @__PURE__ */ jsx(
|
|
4429
|
-
TabPanel,
|
|
4430
|
-
{
|
|
4431
|
-
classNames: {
|
|
4432
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
4433
|
-
content: "oui-tabs-rwa-content"
|
|
4434
|
-
},
|
|
4435
|
-
title: /* @__PURE__ */ jsx(RwaTab, {}),
|
|
4436
|
-
value: "rwa" /* Rwa */,
|
|
4437
|
-
children: renderTab("rwa" /* Rwa */)
|
|
4438
|
-
}
|
|
4439
|
-
),
|
|
4440
|
-
/* @__PURE__ */ jsx(
|
|
4441
|
-
TabPanel,
|
|
4442
|
-
{
|
|
4443
|
-
classNames: {
|
|
4444
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
4445
|
-
content: "oui-tabs-newListings-content"
|
|
4446
|
-
},
|
|
4447
|
-
title: t("markets.newListings"),
|
|
4448
|
-
value: "newListing" /* NewListing */,
|
|
4449
|
-
children: renderTab("newListing" /* NewListing */)
|
|
4450
|
-
}
|
|
4451
|
-
),
|
|
4452
|
-
/* @__PURE__ */ jsx(
|
|
4948
|
+
showScrollIndicator: true,
|
|
4949
|
+
children: tabs?.map((tab, index) => {
|
|
4950
|
+
const key = tabKey(tab, index);
|
|
4951
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
4952
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
4953
|
+
return /* @__PURE__ */ jsx(
|
|
4453
4954
|
TabPanel,
|
|
4454
4955
|
{
|
|
4455
4956
|
classNames: {
|
|
4456
|
-
trigger:
|
|
4457
|
-
content:
|
|
4957
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
4958
|
+
content: `oui-tabs-${key}-content`
|
|
4458
4959
|
},
|
|
4459
|
-
title:
|
|
4460
|
-
value:
|
|
4461
|
-
children:
|
|
4462
|
-
}
|
|
4463
|
-
|
|
4464
|
-
|
|
4960
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaTab, {})),
|
|
4961
|
+
value: key,
|
|
4962
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
4963
|
+
},
|
|
4964
|
+
key
|
|
4965
|
+
);
|
|
4966
|
+
})
|
|
4465
4967
|
}
|
|
4466
4968
|
)
|
|
4467
4969
|
]
|
|
@@ -4510,15 +5012,18 @@ var DropDownMarketsWidget;
|
|
|
4510
5012
|
var init_dropDownMarkets_widget = __esm({
|
|
4511
5013
|
"src/components/dropDownMarkets/dropDownMarkets.widget.tsx"() {
|
|
4512
5014
|
init_marketsProvider();
|
|
5015
|
+
init_useMarketCategories();
|
|
4513
5016
|
init_dropDownMarkets_script();
|
|
4514
5017
|
init_dropDownMarkets_ui();
|
|
4515
5018
|
DropDownMarketsWidget = (props) => {
|
|
4516
5019
|
const state = useDropDownMarketsScript();
|
|
5020
|
+
const tabs = useMarketCategories("dropDownMarkets");
|
|
4517
5021
|
return /* @__PURE__ */ jsx(
|
|
4518
5022
|
MarketsProvider,
|
|
4519
5023
|
{
|
|
4520
5024
|
symbol: props.symbol,
|
|
4521
5025
|
onSymbolChange: props.onSymbolChange,
|
|
5026
|
+
tabs,
|
|
4522
5027
|
children: /* @__PURE__ */ jsx(DropDownMarkets, { ...state, contentClassName: props.contentClassName, children: props.children })
|
|
4523
5028
|
}
|
|
4524
5029
|
);
|
|
@@ -4659,26 +5164,47 @@ var init_marketItem_ui = __esm({
|
|
|
4659
5164
|
MarketItem.displayName = "MarketItem";
|
|
4660
5165
|
}
|
|
4661
5166
|
});
|
|
4662
|
-
var
|
|
5167
|
+
var MarketTypeFilter;
|
|
4663
5168
|
var init_marketTypeFilter_ui = __esm({
|
|
4664
5169
|
"src/components/horizontalMarkets/marketTypeFilter.ui.tsx"() {
|
|
4665
5170
|
init_icons();
|
|
4666
|
-
|
|
4667
|
-
{ value: "recent", label: "Recent", translationKey: "Recent" },
|
|
4668
|
-
{ value: "all", label: "All Markets", translationKey: "All" },
|
|
4669
|
-
{ value: "newListing", label: "New Listing", translationKey: "New listing" }
|
|
4670
|
-
];
|
|
5171
|
+
init_tabUtils();
|
|
4671
5172
|
MarketTypeFilter = (props) => {
|
|
4672
5173
|
const {
|
|
4673
5174
|
selectedMarketType,
|
|
4674
5175
|
onMarketTypeChange,
|
|
4675
5176
|
className,
|
|
4676
|
-
position = "bottom"
|
|
5177
|
+
position = "bottom",
|
|
5178
|
+
tabs
|
|
4677
5179
|
} = props;
|
|
5180
|
+
const { t } = useTranslation();
|
|
5181
|
+
const orderedOptions = React6.useMemo(() => {
|
|
5182
|
+
if (!tabs) return [];
|
|
5183
|
+
return tabs.filter(
|
|
5184
|
+
(tab) => isCustomMarketTab(tab) || isBuiltInMarketTab(tab) && tab.type !== "favorites"
|
|
5185
|
+
);
|
|
5186
|
+
}, [tabs]);
|
|
5187
|
+
const hasFavoritesTab = React6.useMemo(() => {
|
|
5188
|
+
return tabs?.some(
|
|
5189
|
+
(tab) => isBuiltInMarketTab(tab) && tab.type === "favorites"
|
|
5190
|
+
);
|
|
5191
|
+
}, [tabs]);
|
|
4678
5192
|
const [isOpen, setIsOpen] = useState(false);
|
|
4679
5193
|
const dropdownRef = useRef(null);
|
|
4680
5194
|
const [, favorite] = useMarkets(MarketsType.FAVORITES);
|
|
4681
5195
|
const hasFavorites = (favorite?.favorites?.length || 0) > 0;
|
|
5196
|
+
const titleOverrides = React6.useMemo(
|
|
5197
|
+
() => ({
|
|
5198
|
+
all: t("markets.allMarkets"),
|
|
5199
|
+
newListing: t("markets.newListings"),
|
|
5200
|
+
recent: t("markets.recent")
|
|
5201
|
+
}),
|
|
5202
|
+
[t]
|
|
5203
|
+
);
|
|
5204
|
+
const getOptionLabel = useCallback(
|
|
5205
|
+
(tab) => resolveTabTitle(tab, titleOverrides, t("common.rwa")),
|
|
5206
|
+
[t, titleOverrides]
|
|
5207
|
+
);
|
|
4682
5208
|
useEffect(() => {
|
|
4683
5209
|
const handleClickOutside = (event) => {
|
|
4684
5210
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -4744,41 +5270,46 @@ var init_marketTypeFilter_ui = __esm({
|
|
|
4744
5270
|
wrap: "wrap",
|
|
4745
5271
|
gapY: 1,
|
|
4746
5272
|
className: "oui-gap-x-2 md:oui-gap-x-3",
|
|
4747
|
-
children:
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
5273
|
+
children: orderedOptions.map((tab) => {
|
|
5274
|
+
const optionValue = isCustomMarketTab(tab) ? tab.id : tab.type;
|
|
5275
|
+
const isActive = selectedMarketType === optionValue;
|
|
5276
|
+
const htmlId = `toggle_market_type_${optionValue}`;
|
|
5277
|
+
return /* @__PURE__ */ jsxs(
|
|
5278
|
+
Flex,
|
|
5279
|
+
{
|
|
5280
|
+
className: cn("oui-cursor-pointer"),
|
|
5281
|
+
itemAlign: "center",
|
|
5282
|
+
onClick: () => handleOptionClick(optionValue),
|
|
5283
|
+
children: [
|
|
5284
|
+
/* @__PURE__ */ jsx(
|
|
5285
|
+
Checkbox,
|
|
5286
|
+
{
|
|
5287
|
+
"data-testid": `oui-testid-marketType-${optionValue}-checkBox`,
|
|
5288
|
+
id: htmlId,
|
|
5289
|
+
className: "oui-peer",
|
|
5290
|
+
color: "white",
|
|
5291
|
+
checked: isActive
|
|
5292
|
+
}
|
|
5293
|
+
),
|
|
5294
|
+
/* @__PURE__ */ jsx(
|
|
5295
|
+
"label",
|
|
5296
|
+
{
|
|
5297
|
+
htmlFor: htmlId,
|
|
5298
|
+
className: cn(
|
|
5299
|
+
"oui-text-2xs oui-ml-1",
|
|
5300
|
+
"oui-break-normal oui-whitespace-nowrap oui-cursor-pointer"
|
|
5301
|
+
),
|
|
5302
|
+
children: getOptionLabel(tab)
|
|
5303
|
+
}
|
|
5304
|
+
)
|
|
5305
|
+
]
|
|
5306
|
+
},
|
|
5307
|
+
optionValue
|
|
5308
|
+
);
|
|
5309
|
+
})
|
|
4779
5310
|
}
|
|
4780
5311
|
),
|
|
4781
|
-
hasFavorites && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5312
|
+
hasFavoritesTab && hasFavorites && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4782
5313
|
/* @__PURE__ */ jsx(
|
|
4783
5314
|
Divider,
|
|
4784
5315
|
{
|
|
@@ -4857,6 +5388,7 @@ __export(horizontalMarkets_ui_exports, {
|
|
|
4857
5388
|
var HorizontalMarkets;
|
|
4858
5389
|
var init_horizontalMarkets_ui = __esm({
|
|
4859
5390
|
"src/components/horizontalMarkets/horizontalMarkets.ui.tsx"() {
|
|
5391
|
+
init_marketsProvider();
|
|
4860
5392
|
init_marketItem_ui();
|
|
4861
5393
|
init_marketTypeFilter_ui();
|
|
4862
5394
|
HorizontalMarkets = React6.memo((props) => {
|
|
@@ -4870,6 +5402,7 @@ var init_horizontalMarkets_ui = __esm({
|
|
|
4870
5402
|
className,
|
|
4871
5403
|
dropdownPos
|
|
4872
5404
|
} = props;
|
|
5405
|
+
const { tabs } = useMarketsContext();
|
|
4873
5406
|
const renderMarketItem = React6.useCallback(
|
|
4874
5407
|
(symbol, index) => {
|
|
4875
5408
|
const data = tickerData[symbol];
|
|
@@ -4928,7 +5461,8 @@ var init_horizontalMarkets_ui = __esm({
|
|
|
4928
5461
|
{
|
|
4929
5462
|
selectedMarketType,
|
|
4930
5463
|
onMarketTypeChange,
|
|
4931
|
-
position: dropdownPos
|
|
5464
|
+
position: dropdownPos,
|
|
5465
|
+
tabs
|
|
4932
5466
|
}
|
|
4933
5467
|
),
|
|
4934
5468
|
/* @__PURE__ */ jsx(
|
|
@@ -5145,12 +5679,15 @@ init_favoritesTabs();
|
|
|
5145
5679
|
init_expandMarkets();
|
|
5146
5680
|
|
|
5147
5681
|
// src/components/subMenuMarkets/subMenuMarkets.ui.tsx
|
|
5148
|
-
|
|
5682
|
+
init_useCommunityTabs();
|
|
5149
5683
|
init_type();
|
|
5684
|
+
init_communityBrokerTabs();
|
|
5150
5685
|
init_favoritesTabs();
|
|
5151
5686
|
init_marketsList();
|
|
5687
|
+
init_marketsProvider();
|
|
5152
5688
|
init_rwaTab();
|
|
5153
5689
|
init_useFavoritesExtraProps();
|
|
5690
|
+
init_tabUtils();
|
|
5154
5691
|
init_symbolDisplay();
|
|
5155
5692
|
var LIST_ROW_COMPACT = "oui-h-auto";
|
|
5156
5693
|
var TABLE_CLASSNAMES = {
|
|
@@ -5187,8 +5724,10 @@ var MarketTabPanel = ({
|
|
|
5187
5724
|
};
|
|
5188
5725
|
var SubMenuMarkets = (props) => {
|
|
5189
5726
|
const { activeTab, onTabChange, className, tabSort, onTabSort } = props;
|
|
5190
|
-
const { t } = useTranslation();
|
|
5191
5727
|
const { getFavoritesProps } = useFavoritesProps();
|
|
5728
|
+
const builtInTitles = useBuiltInTitles();
|
|
5729
|
+
const { tabs } = useMarketsContext();
|
|
5730
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
5192
5731
|
const getColumns = (_favorite, _isFavoritesList) => {
|
|
5193
5732
|
return [
|
|
5194
5733
|
{
|
|
@@ -5208,6 +5747,71 @@ var SubMenuMarkets = (props) => {
|
|
|
5208
5747
|
}
|
|
5209
5748
|
];
|
|
5210
5749
|
};
|
|
5750
|
+
const renderBuiltInContent = (tabType) => {
|
|
5751
|
+
if (tabType === "favorites" /* Favorites */) {
|
|
5752
|
+
const favProps = getFavoritesProps("favorites" /* Favorites */);
|
|
5753
|
+
return /* @__PURE__ */ jsx(
|
|
5754
|
+
MarketTabPanel,
|
|
5755
|
+
{
|
|
5756
|
+
type: "favorites" /* Favorites */,
|
|
5757
|
+
getColumns,
|
|
5758
|
+
dataFilter: favProps?.dataFilter,
|
|
5759
|
+
renderHeader: (favorite) => /* @__PURE__ */ jsx(Box, { className: "oui-px-1 oui-my-1", children: /* @__PURE__ */ jsx(FavoritesTabWidget, { favorite, size: "sm" }) }),
|
|
5760
|
+
initialSort: tabSort["favorites" /* Favorites */],
|
|
5761
|
+
onSort: onTabSort("favorites" /* Favorites */),
|
|
5762
|
+
emptyView: /* @__PURE__ */ jsx(EmptyDataState, {})
|
|
5763
|
+
}
|
|
5764
|
+
);
|
|
5765
|
+
}
|
|
5766
|
+
return /* @__PURE__ */ jsx(
|
|
5767
|
+
MarketTabPanel,
|
|
5768
|
+
{
|
|
5769
|
+
type: tabType,
|
|
5770
|
+
getColumns,
|
|
5771
|
+
initialSort: tabSort[tabType],
|
|
5772
|
+
onSort: onTabSort(tabType)
|
|
5773
|
+
}
|
|
5774
|
+
);
|
|
5775
|
+
};
|
|
5776
|
+
const renderCommunityContent = () => {
|
|
5777
|
+
return /* @__PURE__ */ jsx(
|
|
5778
|
+
CommunityBrokerTabs,
|
|
5779
|
+
{
|
|
5780
|
+
storageKey: "orderly_submenu_markets_community_sel_sub_tab",
|
|
5781
|
+
classNames: {
|
|
5782
|
+
tabsList: "oui-px-1 oui-pt-1 oui-pb-2",
|
|
5783
|
+
tabsContent: "oui-h-full",
|
|
5784
|
+
scrollIndicator: "oui-mx-1"
|
|
5785
|
+
},
|
|
5786
|
+
className: cn("oui-subMenuMarkets-community-tabs", cls2),
|
|
5787
|
+
showScrollIndicator: true,
|
|
5788
|
+
renderPanel: (selected) => /* @__PURE__ */ jsx(
|
|
5789
|
+
MarketTabPanel,
|
|
5790
|
+
{
|
|
5791
|
+
type: "all" /* All */,
|
|
5792
|
+
getColumns,
|
|
5793
|
+
dataFilter: createCommunityBrokerFilter(selected),
|
|
5794
|
+
initialSort: tabSort["community" /* Community */],
|
|
5795
|
+
onSort: onTabSort("community" /* Community */)
|
|
5796
|
+
}
|
|
5797
|
+
)
|
|
5798
|
+
}
|
|
5799
|
+
);
|
|
5800
|
+
};
|
|
5801
|
+
const renderCustomContent = (key) => {
|
|
5802
|
+
return /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
|
|
5803
|
+
MarketsListWidget,
|
|
5804
|
+
{
|
|
5805
|
+
type: "all" /* All */,
|
|
5806
|
+
getColumns,
|
|
5807
|
+
tableClassNames: TABLE_CLASSNAMES,
|
|
5808
|
+
rowClassName: LIST_ROW_COMPACT,
|
|
5809
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
5810
|
+
initialSort: tabSort[key],
|
|
5811
|
+
onSort: onTabSort(key)
|
|
5812
|
+
}
|
|
5813
|
+
) });
|
|
5814
|
+
};
|
|
5211
5815
|
return /* @__PURE__ */ jsxs(
|
|
5212
5816
|
Box,
|
|
5213
5817
|
{
|
|
@@ -5218,7 +5822,7 @@ var SubMenuMarkets = (props) => {
|
|
|
5218
5822
|
height: "100%",
|
|
5219
5823
|
children: [
|
|
5220
5824
|
/* @__PURE__ */ jsx(Box, { className: "oui-p-1", children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazySearchInput3, {}) }) }),
|
|
5221
|
-
/* @__PURE__ */
|
|
5825
|
+
/* @__PURE__ */ jsx(
|
|
5222
5826
|
Tabs,
|
|
5223
5827
|
{
|
|
5224
5828
|
variant: "contained",
|
|
@@ -5232,114 +5836,24 @@ var SubMenuMarkets = (props) => {
|
|
|
5232
5836
|
},
|
|
5233
5837
|
className: cn(cls2, "oui-subMenuMarkets-tabs oui-my-1.5"),
|
|
5234
5838
|
showScrollIndicator: true,
|
|
5235
|
-
children:
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
trigger: "oui-tabs-favorites-trigger",
|
|
5241
|
-
content: "oui-tabs-favorites-content"
|
|
5242
|
-
},
|
|
5243
|
-
title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
|
|
5244
|
-
value: "favorites" /* Favorites */,
|
|
5245
|
-
children: (() => {
|
|
5246
|
-
const favProps = getFavoritesProps("favorites" /* Favorites */);
|
|
5247
|
-
return /* @__PURE__ */ jsx(
|
|
5248
|
-
MarketTabPanel,
|
|
5249
|
-
{
|
|
5250
|
-
type: "favorites" /* Favorites */,
|
|
5251
|
-
getColumns,
|
|
5252
|
-
dataFilter: favProps?.dataFilter,
|
|
5253
|
-
renderHeader: (favorite) => /* @__PURE__ */ jsx(Box, { className: "oui-px-1 oui-my-1", children: /* @__PURE__ */ jsx(FavoritesTabWidget, { favorite, size: "sm" }) }),
|
|
5254
|
-
initialSort: tabSort["favorites" /* Favorites */],
|
|
5255
|
-
onSort: onTabSort("favorites" /* Favorites */),
|
|
5256
|
-
emptyView: /* @__PURE__ */ jsx(EmptyDataState, {})
|
|
5257
|
-
}
|
|
5258
|
-
);
|
|
5259
|
-
})()
|
|
5260
|
-
}
|
|
5261
|
-
),
|
|
5262
|
-
/* @__PURE__ */ jsx(
|
|
5263
|
-
TabPanel,
|
|
5264
|
-
{
|
|
5265
|
-
classNames: {
|
|
5266
|
-
trigger: "oui-tabs-all-trigger",
|
|
5267
|
-
content: "oui-tabs-all-content"
|
|
5268
|
-
},
|
|
5269
|
-
title: t("common.all"),
|
|
5270
|
-
value: "all" /* All */,
|
|
5271
|
-
children: /* @__PURE__ */ jsx(
|
|
5272
|
-
MarketTabPanel,
|
|
5273
|
-
{
|
|
5274
|
-
type: "all" /* All */,
|
|
5275
|
-
getColumns,
|
|
5276
|
-
initialSort: tabSort["all" /* All */],
|
|
5277
|
-
onSort: onTabSort("all" /* All */)
|
|
5278
|
-
}
|
|
5279
|
-
)
|
|
5280
|
-
}
|
|
5281
|
-
),
|
|
5282
|
-
/* @__PURE__ */ jsx(
|
|
5283
|
-
TabPanel,
|
|
5284
|
-
{
|
|
5285
|
-
classNames: {
|
|
5286
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
5287
|
-
content: "oui-tabs-rwa-content"
|
|
5288
|
-
},
|
|
5289
|
-
title: /* @__PURE__ */ jsx(RwaIconTab, {}),
|
|
5290
|
-
value: "rwa" /* Rwa */,
|
|
5291
|
-
children: /* @__PURE__ */ jsx(
|
|
5292
|
-
MarketTabPanel,
|
|
5293
|
-
{
|
|
5294
|
-
type: "rwa" /* Rwa */,
|
|
5295
|
-
getColumns,
|
|
5296
|
-
initialSort: tabSort["rwa" /* Rwa */],
|
|
5297
|
-
onSort: onTabSort("rwa" /* Rwa */)
|
|
5298
|
-
}
|
|
5299
|
-
)
|
|
5300
|
-
}
|
|
5301
|
-
),
|
|
5302
|
-
/* @__PURE__ */ jsx(
|
|
5303
|
-
TabPanel,
|
|
5304
|
-
{
|
|
5305
|
-
classNames: {
|
|
5306
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
5307
|
-
content: "oui-tabs-newListings-content"
|
|
5308
|
-
},
|
|
5309
|
-
title: t("markets.newListings"),
|
|
5310
|
-
value: "newListing" /* NewListing */,
|
|
5311
|
-
children: /* @__PURE__ */ jsx(
|
|
5312
|
-
MarketTabPanel,
|
|
5313
|
-
{
|
|
5314
|
-
type: "newListing" /* NewListing */,
|
|
5315
|
-
getColumns,
|
|
5316
|
-
initialSort: tabSort["newListing" /* NewListing */],
|
|
5317
|
-
onSort: onTabSort("newListing" /* NewListing */)
|
|
5318
|
-
}
|
|
5319
|
-
)
|
|
5320
|
-
}
|
|
5321
|
-
),
|
|
5322
|
-
/* @__PURE__ */ jsx(
|
|
5839
|
+
children: tabs?.map((tab, index) => {
|
|
5840
|
+
const key = tabKey(tab, index);
|
|
5841
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
5842
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
5843
|
+
return /* @__PURE__ */ jsx(
|
|
5323
5844
|
TabPanel,
|
|
5324
5845
|
{
|
|
5325
5846
|
classNames: {
|
|
5326
|
-
trigger:
|
|
5327
|
-
content:
|
|
5847
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
5848
|
+
content: `oui-tabs-${key}-content`
|
|
5328
5849
|
},
|
|
5329
|
-
title:
|
|
5330
|
-
value:
|
|
5331
|
-
children:
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
initialSort: tabSort["recent" /* Recent */],
|
|
5337
|
-
onSort: onTabSort("recent" /* Recent */)
|
|
5338
|
-
}
|
|
5339
|
-
)
|
|
5340
|
-
}
|
|
5341
|
-
)
|
|
5342
|
-
]
|
|
5850
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaIconTab, {})),
|
|
5851
|
+
value: key,
|
|
5852
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
5853
|
+
},
|
|
5854
|
+
key
|
|
5855
|
+
);
|
|
5856
|
+
})
|
|
5343
5857
|
}
|
|
5344
5858
|
)
|
|
5345
5859
|
]
|
|
@@ -5349,6 +5863,7 @@ var SubMenuMarkets = (props) => {
|
|
|
5349
5863
|
|
|
5350
5864
|
// src/components/subMenuMarkets/subMenuMarkets.widget.tsx
|
|
5351
5865
|
init_marketsProvider();
|
|
5866
|
+
init_useMarketCategories();
|
|
5352
5867
|
|
|
5353
5868
|
// src/components/subMenuMarkets/subMenuMarkets.script.ts
|
|
5354
5869
|
init_constant();
|
|
@@ -5393,11 +5908,13 @@ var SubMenuMarketsWidget = (props) => {
|
|
|
5393
5908
|
activeTab: props.activeTab,
|
|
5394
5909
|
onTabChange: props.onTabChange
|
|
5395
5910
|
});
|
|
5911
|
+
const tabs = useMarketCategories("subMenuMarkets");
|
|
5396
5912
|
return /* @__PURE__ */ jsx(
|
|
5397
5913
|
MarketsProvider,
|
|
5398
5914
|
{
|
|
5399
5915
|
symbol: props.symbol,
|
|
5400
5916
|
onSymbolChange: props.onSymbolChange,
|
|
5917
|
+
tabs,
|
|
5401
5918
|
children: /* @__PURE__ */ jsx(
|
|
5402
5919
|
SubMenuMarkets,
|
|
5403
5920
|
{
|
|
@@ -5476,12 +5993,15 @@ var SideMarketsWidget = (props) => {
|
|
|
5476
5993
|
init_dropDownMarkets();
|
|
5477
5994
|
|
|
5478
5995
|
// src/components/marketsSheet/marketsSheet.ui.tsx
|
|
5479
|
-
|
|
5996
|
+
init_useCommunityTabs();
|
|
5480
5997
|
init_type();
|
|
5998
|
+
init_communityBrokerTabs();
|
|
5481
5999
|
init_marketsList();
|
|
6000
|
+
init_marketsProvider();
|
|
5482
6001
|
init_rwaTab();
|
|
5483
6002
|
init_searchInput();
|
|
5484
6003
|
init_useFavoritesExtraProps();
|
|
6004
|
+
init_tabUtils();
|
|
5485
6005
|
|
|
5486
6006
|
// src/components/marketsSheet/column.tsx
|
|
5487
6007
|
init_column();
|
|
@@ -5498,14 +6018,17 @@ var MarketsSheet = (props) => {
|
|
|
5498
6018
|
const { className, tabSort, onTabSort } = props;
|
|
5499
6019
|
const { t } = useTranslation();
|
|
5500
6020
|
const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
|
|
5501
|
-
const
|
|
5502
|
-
|
|
6021
|
+
const { tabs } = useMarketsContext();
|
|
6022
|
+
const builtInTitles = useBuiltInTitles();
|
|
6023
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
6024
|
+
const renderBuiltInContent = (tabType) => {
|
|
6025
|
+
const isFavorites = tabType === "favorites" /* Favorites */;
|
|
5503
6026
|
return /* @__PURE__ */ jsx(
|
|
5504
6027
|
MarketsListWidget,
|
|
5505
6028
|
{
|
|
5506
|
-
type,
|
|
5507
|
-
initialSort: tabSort[
|
|
5508
|
-
onSort: onTabSort(
|
|
6029
|
+
type: tabType,
|
|
6030
|
+
initialSort: tabSort[tabType],
|
|
6031
|
+
onSort: onTabSort(tabType),
|
|
5509
6032
|
getColumns: getMarketsSheetColumns,
|
|
5510
6033
|
tableClassNames: {
|
|
5511
6034
|
root: cn("oui-marketsSheet-list", "!oui-bg-base-8"),
|
|
@@ -5515,12 +6038,65 @@ var MarketsSheet = (props) => {
|
|
|
5515
6038
|
)
|
|
5516
6039
|
},
|
|
5517
6040
|
emptyView: renderEmptyView({
|
|
5518
|
-
type,
|
|
6041
|
+
type: tabType,
|
|
5519
6042
|
onClick: () => {
|
|
5520
6043
|
props.onTabChange("all" /* All */);
|
|
5521
6044
|
}
|
|
5522
6045
|
}),
|
|
5523
|
-
...getFavoritesProps(
|
|
6046
|
+
...getFavoritesProps(tabType)
|
|
6047
|
+
}
|
|
6048
|
+
);
|
|
6049
|
+
};
|
|
6050
|
+
const renderCommunityContent = () => {
|
|
6051
|
+
return /* @__PURE__ */ jsx(
|
|
6052
|
+
CommunityBrokerTabs,
|
|
6053
|
+
{
|
|
6054
|
+
storageKey: "orderly_markets_sheet_community_sel_sub_tab",
|
|
6055
|
+
classNames: {
|
|
6056
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
6057
|
+
tabsContent: "oui-h-full"
|
|
6058
|
+
},
|
|
6059
|
+
className: cn(
|
|
6060
|
+
"oui-marketsSheet-community-tabs",
|
|
6061
|
+
"oui-h-[calc(100%_-_36px)]"
|
|
6062
|
+
),
|
|
6063
|
+
showScrollIndicator: true,
|
|
6064
|
+
renderPanel: (selected) => /* @__PURE__ */ jsx(
|
|
6065
|
+
MarketsListWidget,
|
|
6066
|
+
{
|
|
6067
|
+
type: "all" /* All */,
|
|
6068
|
+
initialSort: tabSort["community" /* Community */],
|
|
6069
|
+
onSort: onTabSort("community" /* Community */),
|
|
6070
|
+
getColumns: getMarketsSheetColumns,
|
|
6071
|
+
tableClassNames: {
|
|
6072
|
+
root: cn("oui-marketsSheet-list", "!oui-bg-base-8"),
|
|
6073
|
+
scroll: cn(
|
|
6074
|
+
"oui-pb-[env(safe-area-inset-bottom,_20px)]",
|
|
6075
|
+
"oui-h-[calc(100%_-_40px)]"
|
|
6076
|
+
)
|
|
6077
|
+
},
|
|
6078
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
6079
|
+
}
|
|
6080
|
+
)
|
|
6081
|
+
}
|
|
6082
|
+
);
|
|
6083
|
+
};
|
|
6084
|
+
const renderCustomContent = (key) => {
|
|
6085
|
+
return /* @__PURE__ */ jsx(
|
|
6086
|
+
MarketsListWidget,
|
|
6087
|
+
{
|
|
6088
|
+
type: "all" /* All */,
|
|
6089
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
6090
|
+
initialSort: tabSort[key],
|
|
6091
|
+
onSort: onTabSort(key),
|
|
6092
|
+
getColumns: getMarketsSheetColumns,
|
|
6093
|
+
tableClassNames: {
|
|
6094
|
+
root: cn("oui-marketsSheet-list", "!oui-bg-base-8"),
|
|
6095
|
+
scroll: cn(
|
|
6096
|
+
"oui-pb-[env(safe-area-inset-bottom,_20px)]",
|
|
6097
|
+
"oui-h-[calc(100%_-_40px)]"
|
|
6098
|
+
)
|
|
6099
|
+
}
|
|
5524
6100
|
}
|
|
5525
6101
|
);
|
|
5526
6102
|
};
|
|
@@ -5539,7 +6115,7 @@ var MarketsSheet = (props) => {
|
|
|
5539
6115
|
}
|
|
5540
6116
|
)
|
|
5541
6117
|
] }),
|
|
5542
|
-
/* @__PURE__ */
|
|
6118
|
+
/* @__PURE__ */ jsx(
|
|
5543
6119
|
Tabs,
|
|
5544
6120
|
{
|
|
5545
6121
|
variant: "contained",
|
|
@@ -5553,44 +6129,24 @@ var MarketsSheet = (props) => {
|
|
|
5553
6129
|
},
|
|
5554
6130
|
className: cn("oui-marketsSheet-tabs", "oui-h-[calc(100%_-_92px)]"),
|
|
5555
6131
|
showScrollIndicator: true,
|
|
5556
|
-
children:
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
trigger: "oui-tabs-favorites-trigger",
|
|
5562
|
-
content: "oui-tabs-favorites-content"
|
|
5563
|
-
},
|
|
5564
|
-
title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
|
|
5565
|
-
value: "favorites" /* Favorites */,
|
|
5566
|
-
children: renderTab("favorites" /* Favorites */)
|
|
5567
|
-
}
|
|
5568
|
-
),
|
|
5569
|
-
/* @__PURE__ */ jsx(
|
|
5570
|
-
TabPanel,
|
|
5571
|
-
{
|
|
5572
|
-
classNames: {
|
|
5573
|
-
trigger: "oui-tabs-all-trigger",
|
|
5574
|
-
content: "oui-tabs-all-content"
|
|
5575
|
-
},
|
|
5576
|
-
title: t("common.all"),
|
|
5577
|
-
value: "all" /* All */,
|
|
5578
|
-
children: renderTab("all" /* All */)
|
|
5579
|
-
}
|
|
5580
|
-
),
|
|
5581
|
-
/* @__PURE__ */ jsx(
|
|
6132
|
+
children: tabs?.map((tab, index) => {
|
|
6133
|
+
const key = tabKey(tab, index);
|
|
6134
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
6135
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
6136
|
+
return /* @__PURE__ */ jsx(
|
|
5582
6137
|
TabPanel,
|
|
5583
6138
|
{
|
|
5584
6139
|
classNames: {
|
|
5585
|
-
trigger:
|
|
5586
|
-
content:
|
|
6140
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
6141
|
+
content: `oui-tabs-${key}-content`
|
|
5587
6142
|
},
|
|
5588
|
-
title: /* @__PURE__ */ jsx(RwaTab, {}),
|
|
5589
|
-
value:
|
|
5590
|
-
children:
|
|
5591
|
-
}
|
|
5592
|
-
|
|
5593
|
-
|
|
6143
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaTab, {})),
|
|
6144
|
+
value: key,
|
|
6145
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
6146
|
+
},
|
|
6147
|
+
key
|
|
6148
|
+
);
|
|
6149
|
+
})
|
|
5594
6150
|
}
|
|
5595
6151
|
)
|
|
5596
6152
|
]
|
|
@@ -5621,13 +6177,16 @@ function useMarketsSheetScript() {
|
|
|
5621
6177
|
|
|
5622
6178
|
// src/components/marketsSheet/marketsSheet.widget.tsx
|
|
5623
6179
|
init_marketsProvider();
|
|
6180
|
+
init_useMarketCategories();
|
|
5624
6181
|
var MarketsSheetWidget = (props) => {
|
|
5625
6182
|
const state = useMarketsSheetScript();
|
|
6183
|
+
const tabs = useMarketCategories("marketsSheet");
|
|
5626
6184
|
return /* @__PURE__ */ jsx(
|
|
5627
6185
|
MarketsProvider,
|
|
5628
6186
|
{
|
|
5629
6187
|
symbol: props.symbol,
|
|
5630
6188
|
onSymbolChange: props.onSymbolChange,
|
|
6189
|
+
tabs,
|
|
5631
6190
|
children: /* @__PURE__ */ jsx(MarketsSheet, { ...state, className: props.className })
|
|
5632
6191
|
}
|
|
5633
6192
|
);
|
|
@@ -5635,6 +6194,7 @@ var MarketsSheetWidget = (props) => {
|
|
|
5635
6194
|
|
|
5636
6195
|
// src/components/symbolInfoBar/symbolInfoBar.ui.tsx
|
|
5637
6196
|
init_icons();
|
|
6197
|
+
init_symbolBadge();
|
|
5638
6198
|
init_symbolDisplay();
|
|
5639
6199
|
var RwaTooltip = (props) => {
|
|
5640
6200
|
const { isRwa, open, closeTimeInterval, openTimeInterval } = props;
|
|
@@ -5791,7 +6351,7 @@ var SymbolInfoBar = (props) => {
|
|
|
5791
6351
|
className: "oui-h-5 oui-cursor-pointer oui-gap-x-[6px]",
|
|
5792
6352
|
onClick: onSymbol,
|
|
5793
6353
|
children: [
|
|
5794
|
-
/* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "sm", children: symbol }),
|
|
6354
|
+
/* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "sm", showBadge: false, children: symbol }),
|
|
5795
6355
|
/* @__PURE__ */ jsx(TriangleDownIcon, { className: "oui-size-[14px] oui-text-base-contrast-54" })
|
|
5796
6356
|
]
|
|
5797
6357
|
}
|
|
@@ -5799,32 +6359,37 @@ var SymbolInfoBar = (props) => {
|
|
|
5799
6359
|
return /* @__PURE__ */ jsxs(
|
|
5800
6360
|
Flex,
|
|
5801
6361
|
{
|
|
6362
|
+
intensity: 900,
|
|
6363
|
+
mx: 1,
|
|
6364
|
+
px: 3,
|
|
6365
|
+
py: 2,
|
|
5802
6366
|
className: cn(
|
|
5803
6367
|
"oui-symbol-info-bar-mobile",
|
|
5804
|
-
"oui-h-full oui-font-semibold",
|
|
6368
|
+
"oui-h-full oui-font-semibold oui-rounded-xl",
|
|
5805
6369
|
props.className
|
|
5806
6370
|
),
|
|
5807
6371
|
children: [
|
|
5808
6372
|
/* @__PURE__ */ jsxs(Flex, { gapX: 3, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
|
|
5809
6373
|
/* @__PURE__ */ jsxs(Flex, { gapX: 3, children: [
|
|
5810
6374
|
/* @__PURE__ */ jsx(TokenIcon, { symbol, size: "xs" }),
|
|
5811
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", children: [
|
|
6375
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
|
|
5812
6376
|
symbolView,
|
|
5813
6377
|
/* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
|
|
5814
6378
|
/* @__PURE__ */ jsxs(Badge, { size: "xs", color: "primary", children: [
|
|
5815
6379
|
leverage,
|
|
5816
6380
|
"x"
|
|
5817
6381
|
] }),
|
|
5818
|
-
/* @__PURE__ */ jsx(
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
6382
|
+
/* @__PURE__ */ jsx(SymbolBadge, { symbol })
|
|
6383
|
+
] }),
|
|
6384
|
+
/* @__PURE__ */ jsx(
|
|
6385
|
+
RwaTooltip,
|
|
6386
|
+
{
|
|
6387
|
+
isRwa,
|
|
6388
|
+
open,
|
|
6389
|
+
closeTimeInterval,
|
|
6390
|
+
openTimeInterval
|
|
6391
|
+
}
|
|
6392
|
+
)
|
|
5828
6393
|
] })
|
|
5829
6394
|
] }),
|
|
5830
6395
|
/* @__PURE__ */ jsx(Divider, { className: "oui-h-[38px]", direction: "vertical", intensity: 8 }),
|
|
@@ -6034,6 +6599,7 @@ var FundingRateHintWidget = (props) => {
|
|
|
6034
6599
|
};
|
|
6035
6600
|
|
|
6036
6601
|
// src/components/symbolInfoBarFull/symbolInfoBarFull.ui.tsx
|
|
6602
|
+
init_symbolBadge();
|
|
6037
6603
|
init_symbolDisplay();
|
|
6038
6604
|
var LazyDropDownMarketsWidget = React6.lazy(
|
|
6039
6605
|
() => Promise.resolve().then(() => (init_dropDownMarkets(), dropDownMarkets_exports)).then((mod) => {
|
|
@@ -6050,6 +6616,92 @@ var LazyDataItem = React6.lazy(
|
|
|
6050
6616
|
return { default: mod.DataItem };
|
|
6051
6617
|
})
|
|
6052
6618
|
);
|
|
6619
|
+
var RISK_NOTICE_LEARN_MORE_URL = "https://orderly.network";
|
|
6620
|
+
var SymbolInfoBarRiskNotice = ({ className, visible, symbolWithBroker, brokerName, autoHeight }) => {
|
|
6621
|
+
const { t } = useTranslation();
|
|
6622
|
+
if (!visible) return null;
|
|
6623
|
+
return /* @__PURE__ */ jsx(
|
|
6624
|
+
"a",
|
|
6625
|
+
{
|
|
6626
|
+
href: RISK_NOTICE_LEARN_MORE_URL,
|
|
6627
|
+
target: "_blank",
|
|
6628
|
+
rel: "noopener noreferrer",
|
|
6629
|
+
className: cn(
|
|
6630
|
+
"oui-symbol-info-bar-risk-notice oui-w-full oui-bg-warning-darken/10 oui-rounded-none oui-text-warning-darken hover:oui-cursor-pointer oui-block",
|
|
6631
|
+
className
|
|
6632
|
+
),
|
|
6633
|
+
children: /* @__PURE__ */ jsxs(
|
|
6634
|
+
Flex,
|
|
6635
|
+
{
|
|
6636
|
+
itemAlign: "center",
|
|
6637
|
+
gap: 2,
|
|
6638
|
+
className: autoHeight ? "oui-min-h-0 oui-py-2 oui-px-2" : "oui-h-[46px] oui-px-3",
|
|
6639
|
+
children: [
|
|
6640
|
+
/* @__PURE__ */ jsx(WarningIcon, { className: "oui-shrink-0 oui-size-4 oui-text-warning-darken" }),
|
|
6641
|
+
/* @__PURE__ */ jsxs(Text, { size: "xs", className: "oui-text-warning-darken oui-flex-1", children: [
|
|
6642
|
+
t("markets.symbolInfoBar.riskNotice.content", {
|
|
6643
|
+
symbolWithBroker,
|
|
6644
|
+
brokerName
|
|
6645
|
+
}),
|
|
6646
|
+
" ",
|
|
6647
|
+
/* @__PURE__ */ jsx("span", { className: "oui-underline", children: t("common.learnMore") })
|
|
6648
|
+
] })
|
|
6649
|
+
]
|
|
6650
|
+
}
|
|
6651
|
+
)
|
|
6652
|
+
}
|
|
6653
|
+
);
|
|
6654
|
+
};
|
|
6655
|
+
var SymbolInfoBarDesktop = ({
|
|
6656
|
+
className,
|
|
6657
|
+
trailing,
|
|
6658
|
+
leftSection,
|
|
6659
|
+
priceSection,
|
|
6660
|
+
scrollableContent,
|
|
6661
|
+
containerRef,
|
|
6662
|
+
leadingVisible,
|
|
6663
|
+
tailingVisible,
|
|
6664
|
+
onScroll
|
|
6665
|
+
}) => /* @__PURE__ */ jsxs(
|
|
6666
|
+
Flex,
|
|
6667
|
+
{
|
|
6668
|
+
intensity: 900,
|
|
6669
|
+
r: "2xl",
|
|
6670
|
+
mt: 1,
|
|
6671
|
+
px: 3,
|
|
6672
|
+
className: cn(
|
|
6673
|
+
"oui-symbol-info-bar-desktop",
|
|
6674
|
+
"oui-font-semibold",
|
|
6675
|
+
"oui-flex-1 oui-w-full",
|
|
6676
|
+
"oui-py-2",
|
|
6677
|
+
className
|
|
6678
|
+
),
|
|
6679
|
+
style: {
|
|
6680
|
+
transform: "translateZ(0)",
|
|
6681
|
+
willChange: "transform"
|
|
6682
|
+
},
|
|
6683
|
+
children: [
|
|
6684
|
+
/* @__PURE__ */ jsxs(Flex, { gapX: 6, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
|
|
6685
|
+
/* @__PURE__ */ jsx(Flex, { gapX: 1, className: "oui-flex-none oui-shrink-0", children: leftSection }),
|
|
6686
|
+
/* @__PURE__ */ jsx(Divider, { className: "oui-h-[26px]", direction: "vertical", intensity: 8 }),
|
|
6687
|
+
priceSection,
|
|
6688
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-relative oui-h-full oui-overflow-hidden", children: [
|
|
6689
|
+
/* @__PURE__ */ jsx(
|
|
6690
|
+
"div",
|
|
6691
|
+
{
|
|
6692
|
+
ref: containerRef,
|
|
6693
|
+
className: "oui-hide-scrollbar oui-h-full oui-overflow-x-auto",
|
|
6694
|
+
children: scrollableContent
|
|
6695
|
+
}
|
|
6696
|
+
),
|
|
6697
|
+
/* @__PURE__ */ jsx(ScrollIndicator2, { leading: true, onClick: onScroll, visible: leadingVisible }),
|
|
6698
|
+
/* @__PURE__ */ jsx(ScrollIndicator2, { tailing: true, onClick: onScroll, visible: tailingVisible })
|
|
6699
|
+
] })
|
|
6700
|
+
] }),
|
|
6701
|
+
trailing
|
|
6702
|
+
]
|
|
6703
|
+
}
|
|
6704
|
+
);
|
|
6053
6705
|
var SymbolInfoBarFull = (props) => {
|
|
6054
6706
|
const {
|
|
6055
6707
|
symbol,
|
|
@@ -6075,6 +6727,10 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6075
6727
|
showCountdown
|
|
6076
6728
|
} = props;
|
|
6077
6729
|
const { t } = useTranslation();
|
|
6730
|
+
const { brokerId, brokerName, brokerNameRaw, displayName } = useBadgeBySymbol(symbol);
|
|
6731
|
+
const isCommunityListed = Boolean(brokerId ?? brokerName);
|
|
6732
|
+
const baseFromSymbol = symbol?.split("_")[1] ?? symbol;
|
|
6733
|
+
const symbolWithBroker = brokerName != null ? `${baseFromSymbol}-${brokerNameRaw}` : displayName ?? symbol;
|
|
6078
6734
|
const favoriteIcon = /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyFavoritesDropdownMenuWidget, { row: { symbol }, favorite, children: /* @__PURE__ */ jsx(
|
|
6079
6735
|
Flex,
|
|
6080
6736
|
{
|
|
@@ -6099,7 +6755,7 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6099
6755
|
contentClassName: "oui-w-[580px] oui-h-[496px]",
|
|
6100
6756
|
symbol: props.symbol,
|
|
6101
6757
|
onSymbolChange: props.onSymbolChange,
|
|
6102
|
-
children: /* @__PURE__ */ jsxs(Flex, { gapX: 1, className: "oui-cursor-pointer", children: [
|
|
6758
|
+
children: /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 1, children: /* @__PURE__ */ jsxs(Flex, { gapX: 1, className: "oui-cursor-pointer", children: [
|
|
6103
6759
|
/* @__PURE__ */ jsx(TokenIcon, { symbol, className: "oui-size-4" }),
|
|
6104
6760
|
/* @__PURE__ */ jsx(
|
|
6105
6761
|
SymbolDisplay,
|
|
@@ -6107,22 +6763,26 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6107
6763
|
formatString: "base",
|
|
6108
6764
|
size: "xs",
|
|
6109
6765
|
className: "oui-text-base-contrast",
|
|
6766
|
+
showBadge: false,
|
|
6110
6767
|
children: symbol
|
|
6111
6768
|
}
|
|
6112
6769
|
),
|
|
6113
6770
|
/* @__PURE__ */ jsx(TriangleDownIcon, { className: "oui-text-base-contrast-54" })
|
|
6114
|
-
] })
|
|
6771
|
+
] }) })
|
|
6115
6772
|
}
|
|
6116
6773
|
),
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6774
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
|
|
6775
|
+
/* @__PURE__ */ jsx(SymbolBadge, { symbol }),
|
|
6776
|
+
isRwa && /* @__PURE__ */ jsx(
|
|
6777
|
+
RwaTooltip,
|
|
6778
|
+
{
|
|
6779
|
+
isRwa,
|
|
6780
|
+
open,
|
|
6781
|
+
closeTimeInterval,
|
|
6782
|
+
openTimeInterval
|
|
6783
|
+
}
|
|
6784
|
+
)
|
|
6785
|
+
] })
|
|
6126
6786
|
]
|
|
6127
6787
|
}
|
|
6128
6788
|
) });
|
|
@@ -6151,129 +6811,92 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6151
6811
|
}
|
|
6152
6812
|
)
|
|
6153
6813
|
] });
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6814
|
+
const leftSection = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6815
|
+
favoriteIcon,
|
|
6816
|
+
symbolView
|
|
6817
|
+
] });
|
|
6818
|
+
const priceSection = /* @__PURE__ */ jsx(
|
|
6819
|
+
Tooltip,
|
|
6820
|
+
{
|
|
6821
|
+
content: t("markets.symbolInfoBar.lastPrice.tooltip"),
|
|
6822
|
+
className: "oui-max-w-[240px]",
|
|
6823
|
+
children: /* @__PURE__ */ jsx("span", { className: "oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12 oui-inline-block", children: price })
|
|
6824
|
+
}
|
|
6825
|
+
);
|
|
6826
|
+
const scrollableContent = /* @__PURE__ */ jsxs(Flex, { gapX: 8, height: "100%", children: [
|
|
6827
|
+
/* @__PURE__ */ jsx("div", { ref: leadingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyDataItem, { label: t("markets.column.24hChange"), value: change }) }) }),
|
|
6828
|
+
/* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6829
|
+
LazyDataItem,
|
|
6157
6830
|
{
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6831
|
+
label: t("markets.symbolInfoBar.Mark"),
|
|
6832
|
+
value: /* @__PURE__ */ jsx(
|
|
6833
|
+
Text.numeral,
|
|
6834
|
+
{
|
|
6835
|
+
dp: quotoDp,
|
|
6836
|
+
"data-testid": "oui-testid-tokenInfo-markPrice-value",
|
|
6837
|
+
children: data?.["mark_price"]
|
|
6838
|
+
}
|
|
6163
6839
|
),
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
hint: t("markets.symbolInfoBar.Index.tooltip")
|
|
6225
|
-
}
|
|
6226
|
-
) }),
|
|
6227
|
-
/* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6228
|
-
LazyDataItem,
|
|
6229
|
-
{
|
|
6230
|
-
label: t("markets.symbolInfoBar.24hVolume"),
|
|
6231
|
-
value: /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: data?.["24h_amount"] }),
|
|
6232
|
-
hint: t("markets.symbolInfoBar.24hVolume.tooltip")
|
|
6233
|
-
}
|
|
6234
|
-
) }),
|
|
6235
|
-
/* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6236
|
-
LazyDataItem,
|
|
6237
|
-
{
|
|
6238
|
-
label: t("markets.symbolInfoBar.predFundingRate"),
|
|
6239
|
-
value: /* @__PURE__ */ jsx(FundingRate, { symbol }),
|
|
6240
|
-
hint: /* @__PURE__ */ jsx(FundingRateHintWidget, { symbol })
|
|
6241
|
-
}
|
|
6242
|
-
) }),
|
|
6243
|
-
/* @__PURE__ */ jsx("div", { ref: tailingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6244
|
-
LazyDataItem,
|
|
6245
|
-
{
|
|
6246
|
-
label: t("markets.openInterest"),
|
|
6247
|
-
value: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6248
|
-
/* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: openInterest }),
|
|
6249
|
-
/* @__PURE__ */ jsx(Text, { intensity: 36, children: ` USDC` })
|
|
6250
|
-
] }),
|
|
6251
|
-
hint: t("markets.openInterest.tooltip")
|
|
6252
|
-
}
|
|
6253
|
-
) }) })
|
|
6254
|
-
] })
|
|
6255
|
-
}
|
|
6256
|
-
),
|
|
6257
|
-
/* @__PURE__ */ jsx(
|
|
6258
|
-
ScrollIndicator2,
|
|
6259
|
-
{
|
|
6260
|
-
leading: true,
|
|
6261
|
-
onClick: onScoll,
|
|
6262
|
-
visible: leadingVisible
|
|
6263
|
-
}
|
|
6264
|
-
),
|
|
6265
|
-
/* @__PURE__ */ jsx(
|
|
6266
|
-
ScrollIndicator2,
|
|
6267
|
-
{
|
|
6268
|
-
tailing: true,
|
|
6269
|
-
onClick: onScoll,
|
|
6270
|
-
visible: tailingVisible
|
|
6271
|
-
}
|
|
6272
|
-
)
|
|
6273
|
-
] })
|
|
6274
|
-
] }),
|
|
6275
|
-
props.trailing
|
|
6276
|
-
]
|
|
6840
|
+
hint: t("markets.symbolInfoBar.Mark.tooltip")
|
|
6841
|
+
}
|
|
6842
|
+
) }),
|
|
6843
|
+
/* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6844
|
+
LazyDataItem,
|
|
6845
|
+
{
|
|
6846
|
+
label: t("markets.symbolInfoBar.Index"),
|
|
6847
|
+
value: /* @__PURE__ */ jsx(Text.numeral, { dp: quotoDp, children: data?.["index_price"] }),
|
|
6848
|
+
hint: t("markets.symbolInfoBar.Index.tooltip")
|
|
6849
|
+
}
|
|
6850
|
+
) }),
|
|
6851
|
+
/* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6852
|
+
LazyDataItem,
|
|
6853
|
+
{
|
|
6854
|
+
label: t("markets.symbolInfoBar.24hVolume"),
|
|
6855
|
+
value: /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: data?.["24h_amount"] }),
|
|
6856
|
+
hint: t("markets.symbolInfoBar.24hVolume.tooltip")
|
|
6857
|
+
}
|
|
6858
|
+
) }),
|
|
6859
|
+
/* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6860
|
+
LazyDataItem,
|
|
6861
|
+
{
|
|
6862
|
+
label: t("markets.symbolInfoBar.predFundingRate"),
|
|
6863
|
+
value: /* @__PURE__ */ jsx(FundingRate, { symbol }),
|
|
6864
|
+
hint: /* @__PURE__ */ jsx(FundingRateHintWidget, { symbol })
|
|
6865
|
+
}
|
|
6866
|
+
) }),
|
|
6867
|
+
/* @__PURE__ */ jsx("div", { ref: tailingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
6868
|
+
LazyDataItem,
|
|
6869
|
+
{
|
|
6870
|
+
label: t("markets.openInterest"),
|
|
6871
|
+
value: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6872
|
+
/* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: openInterest }),
|
|
6873
|
+
/* @__PURE__ */ jsx(Text, { intensity: 36, children: ` USDC` })
|
|
6874
|
+
] }),
|
|
6875
|
+
hint: t("markets.openInterest.tooltip")
|
|
6876
|
+
}
|
|
6877
|
+
) }) })
|
|
6878
|
+
] });
|
|
6879
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "oui-h-full oui-w-full", gapY: 1, children: [
|
|
6880
|
+
/* @__PURE__ */ jsx(
|
|
6881
|
+
SymbolInfoBarRiskNotice,
|
|
6882
|
+
{
|
|
6883
|
+
visible: isCommunityListed,
|
|
6884
|
+
symbolWithBroker,
|
|
6885
|
+
brokerName: brokerNameRaw ?? brokerName ?? ""
|
|
6886
|
+
}
|
|
6887
|
+
),
|
|
6888
|
+
/* @__PURE__ */ jsx(
|
|
6889
|
+
SymbolInfoBarDesktop,
|
|
6890
|
+
{
|
|
6891
|
+
className: props.className,
|
|
6892
|
+
trailing: props.trailing,
|
|
6893
|
+
leftSection,
|
|
6894
|
+
priceSection,
|
|
6895
|
+
scrollableContent,
|
|
6896
|
+
containerRef,
|
|
6897
|
+
leadingVisible,
|
|
6898
|
+
tailingVisible,
|
|
6899
|
+
onScroll: onScoll
|
|
6277
6900
|
}
|
|
6278
6901
|
),
|
|
6279
6902
|
showCountdown && /* @__PURE__ */ jsx(
|
|
@@ -6474,34 +7097,57 @@ var SymbolInfoBarFullWidget = (props) => {
|
|
|
6474
7097
|
|
|
6475
7098
|
// src/components/horizontalMarkets/horizontalMarkets.widget.tsx
|
|
6476
7099
|
init_marketsProvider();
|
|
7100
|
+
init_useMarketCategories();
|
|
6477
7101
|
|
|
6478
7102
|
// src/components/horizontalMarkets/horizontalMarkets.script.ts
|
|
6479
7103
|
init_constant();
|
|
6480
7104
|
init_utils();
|
|
6481
7105
|
init_marketsProvider();
|
|
6482
7106
|
init_useTabSort();
|
|
7107
|
+
init_tabUtils();
|
|
6483
7108
|
var useHorizontalMarketsScript = (options) => {
|
|
6484
7109
|
const {
|
|
6485
7110
|
symbols: optionSymbols,
|
|
6486
7111
|
maxItems: optionMaxItems,
|
|
6487
7112
|
defaultMarketType
|
|
6488
7113
|
} = options || {};
|
|
6489
|
-
const { symbol: currentSymbol, onSymbolChange } = useMarketsContext();
|
|
7114
|
+
const { symbol: currentSymbol, onSymbolChange, tabs } = useMarketsContext();
|
|
6490
7115
|
const [selectedMarketType, setSelectedMarketType] = useLocalStorage(
|
|
6491
7116
|
SIDE_MARKETS_SEL_TAB_KEY,
|
|
6492
7117
|
defaultMarketType || "all"
|
|
6493
7118
|
);
|
|
7119
|
+
const availableMarketTypes = useMemo(
|
|
7120
|
+
() => tabs?.map((tab, index) => tabKey(tab, index)) ?? ["all"],
|
|
7121
|
+
[tabs]
|
|
7122
|
+
);
|
|
6494
7123
|
const MarketsTypeMap3 = {
|
|
6495
7124
|
all: MarketsType.ALL,
|
|
6496
7125
|
recent: MarketsType.RECENT,
|
|
6497
7126
|
newListing: MarketsType.NEW_LISTING,
|
|
6498
7127
|
favorites: MarketsType.FAVORITES
|
|
6499
7128
|
};
|
|
6500
|
-
const
|
|
7129
|
+
const isCustomCategory = typeof selectedMarketType === "string" && !MarketsTypeMap3[selectedMarketType];
|
|
7130
|
+
const marketTypeKey = isCustomCategory ? "all" : selectedMarketType || "all";
|
|
6501
7131
|
const [markets, favorite] = useMarkets(
|
|
6502
7132
|
MarketsTypeMap3[marketTypeKey] || MarketsType.ALL
|
|
6503
7133
|
);
|
|
7134
|
+
useEffect(() => {
|
|
7135
|
+
if (!availableMarketTypes.includes(selectedMarketType)) {
|
|
7136
|
+
setSelectedMarketType(availableMarketTypes[0] ?? "all");
|
|
7137
|
+
}
|
|
7138
|
+
}, [availableMarketTypes, selectedMarketType, setSelectedMarketType]);
|
|
7139
|
+
const customCategoryFilter = useMemo(() => {
|
|
7140
|
+
if (!isCustomCategory || !tabs) return null;
|
|
7141
|
+
const customTabs = tabs.filter(isCustomMarketTab);
|
|
7142
|
+
const tab = customTabs.find(
|
|
7143
|
+
(item, index) => tabKey(item, index) === selectedMarketType
|
|
7144
|
+
);
|
|
7145
|
+
return tab ? getCustomTabDataFilter(tab) ?? null : null;
|
|
7146
|
+
}, [isCustomCategory, tabs, selectedMarketType]);
|
|
6504
7147
|
const filteredMarkets = useMemo(() => {
|
|
7148
|
+
if (isCustomCategory && customCategoryFilter) {
|
|
7149
|
+
return customCategoryFilter(markets);
|
|
7150
|
+
}
|
|
6505
7151
|
if (selectedMarketType === "favorites") {
|
|
6506
7152
|
const { favorites, selectedFavoriteTab } = favorite;
|
|
6507
7153
|
const symbolsInTab = favorites?.filter(
|
|
@@ -6523,7 +7169,9 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6523
7169
|
favorite.favorites,
|
|
6524
7170
|
favorite.selectedFavoriteTab,
|
|
6525
7171
|
favorite.recent,
|
|
6526
|
-
selectedMarketType
|
|
7172
|
+
selectedMarketType,
|
|
7173
|
+
isCustomCategory,
|
|
7174
|
+
customCategoryFilter
|
|
6527
7175
|
]);
|
|
6528
7176
|
const { tabSort } = useTabSort({
|
|
6529
7177
|
storageKey: SIDE_MARKETS_TAB_SORT_STORAGE_KEY
|
|
@@ -6608,7 +7256,8 @@ var HorizontalMarketsWidget = (props) => {
|
|
|
6608
7256
|
dropdownPos,
|
|
6609
7257
|
...providerProps
|
|
6610
7258
|
} = props;
|
|
6611
|
-
|
|
7259
|
+
const tabs = useMarketCategories("horizontalMarkets");
|
|
7260
|
+
return /* @__PURE__ */ jsx(MarketsProvider, { ...providerProps, tabs, children: /* @__PURE__ */ jsx(
|
|
6612
7261
|
HorizontalMarketsInner,
|
|
6613
7262
|
{
|
|
6614
7263
|
symbols,
|
|
@@ -6848,6 +7497,7 @@ init_type();
|
|
|
6848
7497
|
|
|
6849
7498
|
// src/pages/home/page.tsx
|
|
6850
7499
|
init_marketsProvider();
|
|
7500
|
+
init_useMarketCategories();
|
|
6851
7501
|
init_type();
|
|
6852
7502
|
var LazyMarketsHeaderWidget = React6.lazy(
|
|
6853
7503
|
() => Promise.resolve().then(() => (init_marketsHeader_widget(), marketsHeader_widget_exports)).then((mod) => {
|
|
@@ -6869,6 +7519,7 @@ var MarketsHomePage = (props) => {
|
|
|
6869
7519
|
const [activeTab, setActiveTab] = useState(
|
|
6870
7520
|
"markets" /* Markets */
|
|
6871
7521
|
);
|
|
7522
|
+
const tabs = useMarketCategories("marketsDataList");
|
|
6872
7523
|
return /* @__PURE__ */ jsx(
|
|
6873
7524
|
MarketsProvider,
|
|
6874
7525
|
{
|
|
@@ -6876,6 +7527,7 @@ var MarketsHomePage = (props) => {
|
|
|
6876
7527
|
onSymbolChange: props.onSymbolChange,
|
|
6877
7528
|
navProps: props.navProps,
|
|
6878
7529
|
comparisonProps: props.comparisonProps,
|
|
7530
|
+
tabs,
|
|
6879
7531
|
children: /* @__PURE__ */ jsx(
|
|
6880
7532
|
"div",
|
|
6881
7533
|
{
|
|
@@ -6999,7 +7651,8 @@ var MarketsMobileContent = (props) => {
|
|
|
6999
7651
|
// src/index.ts
|
|
7000
7652
|
init_marketsProvider();
|
|
7001
7653
|
init_symbolDisplay();
|
|
7654
|
+
init_builtInTabRegistry();
|
|
7002
7655
|
|
|
7003
|
-
export { CollapseMarkets, DropDownMarkets, DropDownMarketsConetnt, DropDownMarketsWidget, ExpandMarkets, ExpandMarketsWidget, FavoritesDropdownMenu, FavoritesDropdownMenuWidget, FavoritesList, FavoritesListFull, FavoritesListFullWidget, FavoritesListWidget, FavoritesTab, FavoritesTabWidget, FundingComparison, FundingComparisonWidget, FundingOverview, FundingOverviewWidget, FundingTabName, HorizontalMarkets, HorizontalMarketsWidget, MarketItem, MarketTypeFilter, MarketsDataList, MarketsDataListWidget, MarketsHeader, MarketsHeaderWidget, MarketsHomePage, MarketsList, MarketsListFull, MarketsListFullWidget, MarketsListWidget, MarketsPageTab, MarketsProvider, MarketsSheet, MarketsSheetWidget, MarketsTabName, NewListingList, NewListingListWidget, RecentList, RecentListWidget, SideMarkets, SideMarketsWidget, SubMenuMarkets, SubMenuMarketsWidget, SymbolDisplay, SymbolInfoBar, SymbolInfoBarFull, SymbolInfoBarFullWidget, SymbolInfoBarWidget, useDropDownMarketsColumns, useDropDownMarketsScript, useExpandMarketsScript, useFavoritesDropdownMenuScript, useFavoritesListFullScript, useFavoritesListScript, useFavoritesTabScript, useFundingComparisonScript, useFundingOverviewScript, useHorizontalMarketsScript, useMarketsDataListScript, useMarketsHeaderScript, useMarketsListFullScript, useMarketsListScript, useMarketsSheetScript, useNewListingListScript, useRecentListScript, useSideMarketsScript, useSubMenuMarketsScript, useSymbolInfoBarFullScript, useSymbolInfoBarScript };
|
|
7656
|
+
export { CollapseMarkets, CommunitySubTabName, DropDownMarkets, DropDownMarketsConetnt, DropDownMarketsWidget, ExpandMarkets, ExpandMarketsWidget, FavoritesDropdownMenu, FavoritesDropdownMenuWidget, FavoritesList, FavoritesListFull, FavoritesListFullWidget, FavoritesListWidget, FavoritesTab, FavoritesTabWidget, FundingComparison, FundingComparisonWidget, FundingOverview, FundingOverviewWidget, FundingTabName, HorizontalMarkets, HorizontalMarketsWidget, MarketItem, MarketTypeFilter, MarketsDataList, MarketsDataListWidget, MarketsHeader, MarketsHeaderWidget, MarketsHomePage, MarketsList, MarketsListFull, MarketsListFullWidget, MarketsListWidget, MarketsPageTab, MarketsProvider, MarketsSheet, MarketsSheetWidget, MarketsTabName, NewListingList, NewListingListWidget, RecentList, RecentListWidget, SideMarkets, SideMarketsWidget, SubMenuMarkets, SubMenuMarketsWidget, SymbolDisplay, SymbolInfoBar, SymbolInfoBarFull, SymbolInfoBarFullWidget, SymbolInfoBarRiskNotice, SymbolInfoBarWidget, builtInTabs, useDropDownMarketsColumns, useDropDownMarketsScript, useExpandMarketsScript, useFavoritesDropdownMenuScript, useFavoritesListFullScript, useFavoritesListScript, useFavoritesTabScript, useFundingComparisonScript, useFundingOverviewScript, useHorizontalMarketsScript, useMarketsDataListScript, useMarketsHeaderScript, useMarketsListFullScript, useMarketsListScript, useMarketsSheetScript, useNewListingListScript, useRecentListScript, useSideMarketsScript, useSubMenuMarketsScript, useSymbolInfoBarFullScript, useSymbolInfoBarScript };
|
|
7004
7657
|
//# sourceMappingURL=index.mjs.map
|
|
7005
7658
|
//# sourceMappingURL=index.mjs.map
|