@kodiak-finance/orderly-trading-leaderboard 2.8.21-rc.2 → 2.8.21

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { subDays, parseISO, differenceInDays, isBefore, addDays, isAfter, isWithinInterval, format } from 'date-fns';
2
2
  import { createContext, lazy, memo, useState, useRef, useCallback, useEffect, useMemo, useContext, Suspense } from 'react';
3
3
  import { useTranslation, i18n, Trans } from '@kodiak-finance/orderly-i18n';
4
- import { useEmblaCarousel, ChevronLeftIcon, ChevronRightIcon, cn, Text, useScreen, DataTable, Flex, Spinner, usePagination, Box, Select, Button, DataFilter, Input, CloseCircleFillIcon, Divider, ScrollIndicator as ScrollIndicator$1, Tabs, TabPanel, toast, Tooltip, InfoCircleIcon, useLongPress, modal } from '@kodiak-finance/orderly-ui';
4
+ import { useEmblaCarousel, ChevronLeftIcon, ChevronRightIcon, cn, Text, useScreen, DataTable, Flex, Spinner, usePagination, Box, Select, Button, DataFilter, Input, CloseCircleFillIcon, Divider, ScrollIndicator as ScrollIndicator$1, Tabs, TabPanel, toast, Tooltip, InfoCircleIcon } from '@kodiak-finance/orderly-ui';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
6
  import { useAccount, useConfig, useQuery, useInfiniteQuery, useSWR, useTrack, usePrivateQuery, noCacheConfig, useMemoizedFn, useMutation } from '@kodiak-finance/orderly-hooks';
7
7
  import { TrendingUp, TrendingDown, Wallet, DollarSign, BarChart3 } from 'lucide-react';
@@ -512,61 +512,19 @@ var init_column = __esm({
512
512
  );
513
513
  };
514
514
  PnLColumnTitle = ({ type }) => {
515
- const { isMobile } = useScreen();
516
515
  const { t } = useTranslation();
517
- const tooltipContent = type === "general" ? t("tradingLeaderboard.realizedPnl.tooltip") : t("tradingLeaderboard.pnl.tooltip");
518
- const longPress = useLongPress(() => {
519
- modal.alert({
520
- title: t("common.tips"),
521
- message: tooltipContent
522
- });
523
- });
524
- const view = /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
525
- /* @__PURE__ */ jsx("div", { children: type === "general" ? t("common.realizedPnl") : t("common.pnl") }),
526
- /* @__PURE__ */ jsx(InfoCircleIcon, { opacity: 1, className: "w-4 h-4 cursor-pointer" })
527
- ] });
528
- if (isMobile) {
529
- return /* @__PURE__ */ jsx("div", { ...longPress, children: view });
530
- }
531
- return /* @__PURE__ */ jsx(Tooltip, { content: tooltipContent, children: view });
516
+ const view = /* @__PURE__ */ jsx(Flex, { gap: 1, children: /* @__PURE__ */ jsx("div", { children: type === "general" ? t("common.realizedPnl") : t("common.pnl") }) });
517
+ return view;
532
518
  };
533
519
  VolumeColumnTitle = () => {
534
- const { isMobile } = useScreen();
535
520
  const { t } = useTranslation();
536
- const tooltipContent = "Total trading volume generated during the campaign period. Updated every 30 seconds.";
537
- const longPress = useLongPress(() => {
538
- modal.alert({
539
- title: t("common.tips"),
540
- message: tooltipContent
541
- });
542
- });
543
- const view = /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
544
- /* @__PURE__ */ jsx("div", { children: t("tradingLeaderboard.tradingVolume") }),
545
- /* @__PURE__ */ jsx(InfoCircleIcon, { opacity: 1, className: "w-4 h-4 cursor-pointer" })
546
- ] });
547
- if (isMobile) {
548
- return /* @__PURE__ */ jsx("div", { ...longPress, children: view });
549
- }
550
- return /* @__PURE__ */ jsx(Tooltip, { content: tooltipContent, children: view });
521
+ const view = /* @__PURE__ */ jsx(Flex, { gap: 1, children: /* @__PURE__ */ jsx("div", { children: t("tradingLeaderboard.tradingVolume") }) });
522
+ return view;
551
523
  };
552
524
  PointsColumnTitle = () => {
553
- const { isMobile } = useScreen();
554
525
  const { t } = useTranslation();
555
- const tooltipContent = "Total points accumulated based on trading activity. Updated periodically.";
556
- const longPress = useLongPress(() => {
557
- modal.alert({
558
- title: t("common.tips"),
559
- message: tooltipContent
560
- });
561
- });
562
- const view = /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
563
- /* @__PURE__ */ jsx("div", { children: t("tradingLeaderboard.points") }),
564
- /* @__PURE__ */ jsx(InfoCircleIcon, { opacity: 1, className: "w-4 h-4 cursor-pointer" })
565
- ] });
566
- if (isMobile) {
567
- return /* @__PURE__ */ jsx("div", { ...longPress, children: view });
568
- }
569
- return /* @__PURE__ */ jsx(Tooltip, { content: tooltipContent, children: view });
526
+ const view = /* @__PURE__ */ jsx(Flex, { gap: 1, children: /* @__PURE__ */ jsx("div", { children: t("tradingLeaderboard.points") }) });
527
+ return view;
570
528
  };
571
529
  }
572
530
  });
@@ -1196,7 +1154,7 @@ var BrokerStatsWidget = ({ dateRange }) => {
1196
1154
  { key: "pnl", label: "PnL", value: stats?.pnl || 0, icon: "pnl" }
1197
1155
  ];
1198
1156
  }, [stats]);
1199
- const statsToDisplay = isMobile ? allStats.filter((s) => s.key === "volume" || s.key === "pnl") : allStats;
1157
+ const statsToDisplay = allStats;
1200
1158
  if (error) {
1201
1159
  return /* @__PURE__ */ jsx("div", { className: "w-full oui-mx-auto oui-mb-6 oui-max-w-[992px]", children: /* @__PURE__ */ jsx("div", { className: "oui-text-center oui-text-sm oui-text-red-500", children: "Failed to load statistics" }) });
1202
1160
  }
@@ -1294,19 +1252,19 @@ var StatCardComponent = ({
1294
1252
  };
1295
1253
  const iconStyles = getIconStyles();
1296
1254
  const valueColor = isPnL ? isPositive ? "#22c55e" : "#ef4444" : "inherit";
1297
- return /* @__PURE__ */ jsxs("div", { className: "oui-rounded-lg oui-border oui-border-base-4 oui-bg-base-8 oui-p-4 oui-transition-all", children: [
1298
- /* @__PURE__ */ jsxs("div", { className: "oui-mb-3 oui-flex oui-items-start oui-gap-3", children: [
1255
+ return /* @__PURE__ */ jsxs("div", { className: "oui-rounded-lg oui-border oui-border-base-4 oui-bg-base-8 oui-p-3 md:oui-p-4 oui-transition-all", children: [
1256
+ /* @__PURE__ */ jsxs("div", { className: "oui-mb-2 md:oui-mb-3 oui-flex oui-items-start oui-gap-2 md:oui-gap-3", children: [
1299
1257
  /* @__PURE__ */ jsx(
1300
1258
  "div",
1301
1259
  {
1302
- className: "oui-flex oui-shrink-0 oui-items-center oui-justify-center oui-rounded-md oui-p-2",
1260
+ className: "oui-flex oui-shrink-0 oui-items-center oui-justify-center oui-rounded-md oui-p-1.5 md:oui-p-2",
1303
1261
  style: iconStyles,
1304
1262
  children: isPnL ? getPnLIcon(isPositive) : STAT_ICON_MAP[stat.icon]
1305
1263
  }
1306
1264
  ),
1307
1265
  /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-flex-col", children: [
1308
- /* @__PURE__ */ jsx("span", { className: "oui-text-sm oui-font-medium oui-text-base-contrast", children: stat.label }),
1309
- /* @__PURE__ */ jsxs("span", { className: "oui-text-base-contrast-60 oui-text-xs", children: [
1266
+ /* @__PURE__ */ jsx("span", { className: "oui-text-xs md:oui-text-sm oui-font-medium oui-text-base-contrast", children: stat.label }),
1267
+ /* @__PURE__ */ jsxs("span", { className: "oui-text-base-contrast-60 oui-text-2xs md:oui-text-xs", children: [
1310
1268
  "(",
1311
1269
  getDateRangeLabel(dateRange),
1312
1270
  ")"
@@ -1316,8 +1274,8 @@ var StatCardComponent = ({
1316
1274
  /* @__PURE__ */ jsx(
1317
1275
  "div",
1318
1276
  {
1319
- className: "oui-text-xl oui-font-bold",
1320
- style: { color: valueColor, minHeight: "32px" },
1277
+ className: "oui-text-lg md:oui-text-xl oui-font-bold",
1278
+ style: { color: valueColor, minHeight: "28px" },
1321
1279
  children: loading ? /* @__PURE__ */ jsx(Spinner, { size: "sm", color: "primary" }) : formatCurrency(stat.value, isPnL)
1322
1280
  }
1323
1281
  )