@kodiak-finance/orderly-trading-leaderboard 2.8.22-beta.2 → 2.8.22-beta.3
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +44 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1131,16 +1131,16 @@ var formatDateLocal = (date) => {
|
|
|
1131
1131
|
const day = String(date.getDate()).padStart(2, "0");
|
|
1132
1132
|
return `${year}-${month}-${day}`;
|
|
1133
1133
|
};
|
|
1134
|
-
var getApiUrl = (dateRange) => {
|
|
1134
|
+
var getApiUrl = (dateRange, foxifyOnly) => {
|
|
1135
1135
|
if (!dateRange?.from || !dateRange?.to) {
|
|
1136
1136
|
const today = /* @__PURE__ */ new Date();
|
|
1137
1137
|
const startDate2 = formatDateLocal(today);
|
|
1138
1138
|
const endDate2 = formatDateLocal(today);
|
|
1139
|
-
return `${API_BASE}?start_date=${startDate2}&end_date=${endDate2}`;
|
|
1139
|
+
return `${API_BASE}?start_date=${startDate2}&end_date=${endDate2}${foxifyOnly ? "&foxify_only=true" : ""}`;
|
|
1140
1140
|
}
|
|
1141
1141
|
const startDate = formatDateLocal(dateRange.from);
|
|
1142
1142
|
const endDate = formatDateLocal(dateRange.to);
|
|
1143
|
-
return `${API_BASE}?start_date=${startDate}&end_date=${endDate}`;
|
|
1143
|
+
return `${API_BASE}?start_date=${startDate}&end_date=${endDate}${foxifyOnly ? "&foxify_only=true" : ""}`;
|
|
1144
1144
|
};
|
|
1145
1145
|
var customFetcher = async (url) => {
|
|
1146
1146
|
const response = await fetch(url);
|
|
@@ -1167,11 +1167,14 @@ var formatCurrency = (num, showSign = false) => {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
return formatted;
|
|
1169
1169
|
};
|
|
1170
|
-
var BrokerStatsWidget = ({
|
|
1170
|
+
var BrokerStatsWidget = ({
|
|
1171
|
+
dateRange,
|
|
1172
|
+
foxifyOnly
|
|
1173
|
+
}) => {
|
|
1171
1174
|
const { isMobile } = useScreen();
|
|
1172
1175
|
const url = useMemo(
|
|
1173
|
-
() => getApiUrl(dateRange),
|
|
1174
|
-
[dateRange?.from, dateRange?.to]
|
|
1176
|
+
() => getApiUrl(dateRange, foxifyOnly),
|
|
1177
|
+
[dateRange?.from, dateRange?.to, foxifyOnly]
|
|
1175
1178
|
);
|
|
1176
1179
|
const {
|
|
1177
1180
|
data: apiData,
|
|
@@ -3557,7 +3560,13 @@ var GeneralLeaderboard = (props) => {
|
|
|
3557
3560
|
}, [isMobile, props.activeTab, props.leaderboardEndpoint]);
|
|
3558
3561
|
if (isMobile) {
|
|
3559
3562
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3560
|
-
/* @__PURE__ */ jsx(
|
|
3563
|
+
/* @__PURE__ */ jsx(
|
|
3564
|
+
BrokerStatsWidget,
|
|
3565
|
+
{
|
|
3566
|
+
dateRange: props.dateRange,
|
|
3567
|
+
foxifyOnly: props.foxifyOnly
|
|
3568
|
+
}
|
|
3569
|
+
),
|
|
3561
3570
|
/* @__PURE__ */ jsxs(
|
|
3562
3571
|
Box,
|
|
3563
3572
|
{
|
|
@@ -3600,7 +3609,13 @@ var GeneralLeaderboard = (props) => {
|
|
|
3600
3609
|
] });
|
|
3601
3610
|
}
|
|
3602
3611
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3603
|
-
/* @__PURE__ */ jsx(
|
|
3612
|
+
/* @__PURE__ */ jsx(
|
|
3613
|
+
BrokerStatsWidget,
|
|
3614
|
+
{
|
|
3615
|
+
dateRange: props.dateRange,
|
|
3616
|
+
foxifyOnly: props.foxifyOnly
|
|
3617
|
+
}
|
|
3618
|
+
),
|
|
3604
3619
|
/* @__PURE__ */ jsxs(
|
|
3605
3620
|
Box,
|
|
3606
3621
|
{
|
|
@@ -7671,7 +7686,13 @@ var LeaderboardSection = (props) => {
|
|
|
7671
7686
|
if (currentCampaignId === "general") {
|
|
7672
7687
|
return /* @__PURE__ */ jsxs(Box, { px: 3, className: cn("oui-mix-blend-screen"), children: [
|
|
7673
7688
|
/* @__PURE__ */ jsx(LeaderboardBackground, { backgroundSrc }),
|
|
7674
|
-
/* @__PURE__ */ jsx(
|
|
7689
|
+
/* @__PURE__ */ jsx(
|
|
7690
|
+
BrokerStatsWidget,
|
|
7691
|
+
{
|
|
7692
|
+
dateRange: memoizedDateRange,
|
|
7693
|
+
foxifyOnly: leaderboardScript.foxifyOnly
|
|
7694
|
+
}
|
|
7695
|
+
),
|
|
7675
7696
|
/* @__PURE__ */ jsx(
|
|
7676
7697
|
GeneralLeaderboard,
|
|
7677
7698
|
{
|
|
@@ -7683,7 +7704,13 @@ var LeaderboardSection = (props) => {
|
|
|
7683
7704
|
}
|
|
7684
7705
|
if (currentCampaign?.leaderboard_config?.use_general_leaderboard) {
|
|
7685
7706
|
return /* @__PURE__ */ jsxs(Box, { px: 3, children: [
|
|
7686
|
-
/* @__PURE__ */ jsx(
|
|
7707
|
+
/* @__PURE__ */ jsx(
|
|
7708
|
+
BrokerStatsWidget,
|
|
7709
|
+
{
|
|
7710
|
+
dateRange: memoizedDateRange,
|
|
7711
|
+
foxifyOnly: leaderboardScript.foxifyOnly
|
|
7712
|
+
}
|
|
7713
|
+
),
|
|
7687
7714
|
/* @__PURE__ */ jsx(
|
|
7688
7715
|
LeaderboardTitle,
|
|
7689
7716
|
{
|
|
@@ -7704,7 +7731,13 @@ var LeaderboardSection = (props) => {
|
|
|
7704
7731
|
}
|
|
7705
7732
|
if (currentCampaign && !currentCampaign.hide_arena && currentCampaignId != "general") {
|
|
7706
7733
|
return /* @__PURE__ */ jsxs(Box, { px: 3, children: [
|
|
7707
|
-
/* @__PURE__ */ jsx(
|
|
7734
|
+
/* @__PURE__ */ jsx(
|
|
7735
|
+
BrokerStatsWidget,
|
|
7736
|
+
{
|
|
7737
|
+
dateRange: memoizedDateRange,
|
|
7738
|
+
foxifyOnly: leaderboardScript.foxifyOnly
|
|
7739
|
+
}
|
|
7740
|
+
),
|
|
7708
7741
|
/* @__PURE__ */ jsx(
|
|
7709
7742
|
LeaderboardTitle,
|
|
7710
7743
|
{
|