@agg-build/ui 4.19.1 → 4.21.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/{chunk-KRYMEFPL.mjs → chunk-5PA5KLXN.mjs} +1 -1
- package/dist/{chunk-DXASFSVL.mjs → chunk-JLO2BGSF.mjs} +546 -225
- package/dist/events.js +419 -99
- package/dist/events.mjs +4 -2
- package/dist/index.js +2942 -2619
- package/dist/index.mjs +5 -3
- package/dist/pages.js +3122 -2801
- package/dist/pages.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/types/events/list/event-list-venue-strip.d.mts +29 -0
- package/dist/types/events/list/event-list-venue-strip.d.ts +29 -0
- package/dist/types/events/list/index.d.mts +2 -0
- package/dist/types/events/list/index.d.ts +2 -0
- package/package.json +3 -3
package/dist/events.js
CHANGED
|
@@ -65,6 +65,7 @@ __export(events_exports, {
|
|
|
65
65
|
EventListItem: () => EventListItem,
|
|
66
66
|
EventListItemDetails: () => EventListItemDetails,
|
|
67
67
|
EventListItemV2: () => EventListItemV2,
|
|
68
|
+
EventListVenueStrip: () => EventListVenueStrip,
|
|
68
69
|
MarketDetails: () => MarketDetails,
|
|
69
70
|
MarketDetailsList: () => MarketDetailsList,
|
|
70
71
|
Orderbook: () => Orderbook,
|
|
@@ -16415,10 +16416,10 @@ var MarketDetailsList = ({
|
|
|
16415
16416
|
MarketDetailsList.displayName = "MarketDetailsList";
|
|
16416
16417
|
|
|
16417
16418
|
// src/events/list/index.tsx
|
|
16418
|
-
var
|
|
16419
|
+
var import_hooks59 = require("@agg-build/hooks");
|
|
16419
16420
|
var import_sdk17 = require("@agg-build/sdk");
|
|
16420
16421
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
16421
|
-
var
|
|
16422
|
+
var import_react32 = require("react");
|
|
16422
16423
|
|
|
16423
16424
|
// src/events/list/category-sidebar.tsx
|
|
16424
16425
|
var import_react29 = require("react");
|
|
@@ -16741,8 +16742,327 @@ var EventListTabs = ({
|
|
|
16741
16742
|
};
|
|
16742
16743
|
EventListTabs.displayName = "EventListTabs";
|
|
16743
16744
|
|
|
16744
|
-
// src/events/list/
|
|
16745
|
+
// src/events/list/event-list-venue-strip.tsx
|
|
16746
|
+
var import_hooks58 = require("@agg-build/hooks");
|
|
16747
|
+
var import_react31 = require("react");
|
|
16745
16748
|
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
16749
|
+
var TILE = 28;
|
|
16750
|
+
var TILE_GAP = 4;
|
|
16751
|
+
var CHIP = 36;
|
|
16752
|
+
var STRIP_INSET = 7;
|
|
16753
|
+
var FIT_TOLERANCE = 0.5;
|
|
16754
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? import_react31.useEffect : import_react31.useLayoutEffect;
|
|
16755
|
+
var isTabUnavailable = (tab) => !!tab.disabled || !!tab.isComingSoon;
|
|
16756
|
+
var resolveTabLabel = (tab) => tab.isComingSoon ? `${tab.label} (soon)` : tab.label;
|
|
16757
|
+
var StripFrame = ({
|
|
16758
|
+
className,
|
|
16759
|
+
children,
|
|
16760
|
+
frameRef
|
|
16761
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16762
|
+
"div",
|
|
16763
|
+
{
|
|
16764
|
+
ref: frameRef,
|
|
16765
|
+
className: cn(
|
|
16766
|
+
"inline-flex items-center gap-1 rounded-agg-lg border border-agg-separator bg-agg-secondary p-1.5",
|
|
16767
|
+
className
|
|
16768
|
+
),
|
|
16769
|
+
children
|
|
16770
|
+
}
|
|
16771
|
+
);
|
|
16772
|
+
var StripTile = ({
|
|
16773
|
+
tab,
|
|
16774
|
+
isActive,
|
|
16775
|
+
shape,
|
|
16776
|
+
motionClassName,
|
|
16777
|
+
onSelect,
|
|
16778
|
+
showTooltip = true,
|
|
16779
|
+
isVenue = false
|
|
16780
|
+
}) => {
|
|
16781
|
+
const isUnavailable = isTabUnavailable(tab);
|
|
16782
|
+
const label2 = resolveTabLabel(tab);
|
|
16783
|
+
const isExpanded = shape === "pill" || isActive;
|
|
16784
|
+
const glyphClassName = cn(
|
|
16785
|
+
"shrink-0",
|
|
16786
|
+
motionClassName,
|
|
16787
|
+
!isActive && shape === "tile" && "opacity-70 group-hover:opacity-100"
|
|
16788
|
+
);
|
|
16789
|
+
const glyph = tab.venueLogo ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small", className: glyphClassName }) : tab.iconName ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16790
|
+
Icon,
|
|
16791
|
+
{
|
|
16792
|
+
name: tab.iconName,
|
|
16793
|
+
size: "small",
|
|
16794
|
+
color: "currentColor",
|
|
16795
|
+
className: cn(tab.iconName === "warning-filled" ? "shrink-0" : glyphClassName)
|
|
16796
|
+
}
|
|
16797
|
+
) : null;
|
|
16798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
|
|
16799
|
+
"button",
|
|
16800
|
+
{
|
|
16801
|
+
type: "button",
|
|
16802
|
+
"data-venue-tile": isVenue ? "" : void 0,
|
|
16803
|
+
"aria-pressed": isActive,
|
|
16804
|
+
"aria-label": label2,
|
|
16805
|
+
disabled: isUnavailable,
|
|
16806
|
+
onClick: () => onSelect == null ? void 0 : onSelect(tab.value),
|
|
16807
|
+
className: cn(
|
|
16808
|
+
"agg-venue-strip-tile group relative inline-flex h-7 shrink-0 items-center gap-1.5",
|
|
16809
|
+
"rounded-agg-sm font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
16810
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
16811
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary/40",
|
|
16812
|
+
motionClassName,
|
|
16813
|
+
isExpanded ? "px-3" : "w-7 justify-center",
|
|
16814
|
+
isActive ? "bg-agg-primary/10 text-agg-primary" : "bg-transparent text-agg-foreground hover:bg-agg-secondary-hover",
|
|
16815
|
+
isUnavailable && "opacity-50 hover:bg-transparent"
|
|
16816
|
+
),
|
|
16817
|
+
children: [
|
|
16818
|
+
glyph,
|
|
16819
|
+
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("span", { className: "whitespace-nowrap", children: tab.label }) : null,
|
|
16820
|
+
!isExpanded && showTooltip ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16821
|
+
"span",
|
|
16822
|
+
{
|
|
16823
|
+
role: "tooltip",
|
|
16824
|
+
className: cn(
|
|
16825
|
+
"pointer-events-none absolute left-1/2 top-[calc(100%+6px)] z-10 -translate-x-1/2",
|
|
16826
|
+
"whitespace-nowrap rounded-agg-sm border border-agg-separator bg-agg-secondary px-2 py-1",
|
|
16827
|
+
"text-agg-xs text-agg-foreground shadow-agg-card-hover",
|
|
16828
|
+
"opacity-0 transition-opacity delay-150 group-hover:opacity-100 group-focus-visible:opacity-100"
|
|
16829
|
+
),
|
|
16830
|
+
children: label2
|
|
16831
|
+
}
|
|
16832
|
+
) : null
|
|
16833
|
+
]
|
|
16834
|
+
}
|
|
16835
|
+
);
|
|
16836
|
+
};
|
|
16837
|
+
var EventListVenueStrip = ({
|
|
16838
|
+
tabs,
|
|
16839
|
+
activeTab,
|
|
16840
|
+
onTabChange,
|
|
16841
|
+
ariaLabel,
|
|
16842
|
+
className,
|
|
16843
|
+
fullWidth = false
|
|
16844
|
+
}) => {
|
|
16845
|
+
const labels = (0, import_hooks58.useLabels)();
|
|
16846
|
+
const {
|
|
16847
|
+
features: { enableAnimations }
|
|
16848
|
+
} = (0, import_hooks58.useSdkUiConfig)();
|
|
16849
|
+
const { isLoading: isAppConfigLoading } = (0, import_hooks58.useAppConfig)();
|
|
16850
|
+
const resolvedTabs = useEventListTabs(tabs);
|
|
16851
|
+
const wrapRef = (0, import_react31.useRef)(null);
|
|
16852
|
+
const ghostRef = (0, import_react31.useRef)(null);
|
|
16853
|
+
const [fit, setFit] = (0, import_react31.useState)(null);
|
|
16854
|
+
const [isListOpen, setIsListOpen] = (0, import_react31.useState)(false);
|
|
16855
|
+
const motionClassName = getMotionClassName(
|
|
16856
|
+
enableAnimations,
|
|
16857
|
+
"transition-[color,background-color,opacity] duration-200 motion-reduce:transition-none"
|
|
16858
|
+
);
|
|
16859
|
+
const modeTabs = (0, import_react31.useMemo)(() => resolvedTabs.filter((tab) => !tab.venueLogo), [resolvedTabs]);
|
|
16860
|
+
const venueTabs = (0, import_react31.useMemo)(() => resolvedTabs.filter((tab) => !!tab.venueLogo), [resolvedTabs]);
|
|
16861
|
+
const activeVenueIndex = venueTabs.findIndex((tab) => tab.value === activeTab);
|
|
16862
|
+
(0, import_react31.useEffect)(() => {
|
|
16863
|
+
if (isAppConfigLoading) return;
|
|
16864
|
+
const fallbackTab = resolvedTabs.find((tab) => !isTabUnavailable(tab));
|
|
16865
|
+
if (!fallbackTab) return;
|
|
16866
|
+
if (resolvedTabs.some((tab) => tab.value === activeTab && !isTabUnavailable(tab))) return;
|
|
16867
|
+
onTabChange(fallbackTab.value);
|
|
16868
|
+
}, [activeTab, isAppConfigLoading, onTabChange, resolvedTabs]);
|
|
16869
|
+
useIsomorphicLayoutEffect(() => {
|
|
16870
|
+
const wrap = wrapRef.current;
|
|
16871
|
+
const ghost = ghostRef.current;
|
|
16872
|
+
if (!wrap || !ghost) return;
|
|
16873
|
+
const measure = () => {
|
|
16874
|
+
const available = wrap.getBoundingClientRect().width;
|
|
16875
|
+
const strip = ghost.getBoundingClientRect();
|
|
16876
|
+
if (strip.width <= available + FIT_TOLERANCE) {
|
|
16877
|
+
setFit(null);
|
|
16878
|
+
return;
|
|
16879
|
+
}
|
|
16880
|
+
const firstTile = ghost.querySelector("[data-venue-tile]");
|
|
16881
|
+
if (!firstTile) {
|
|
16882
|
+
setFit(null);
|
|
16883
|
+
return;
|
|
16884
|
+
}
|
|
16885
|
+
const activeTile = ghost.querySelector('[data-venue-tile][aria-pressed="true"]');
|
|
16886
|
+
const room = strip.right - STRIP_INSET - firstTile.getBoundingClientRect().left - (strip.width - available);
|
|
16887
|
+
const activeWidth = activeTile ? activeTile.getBoundingClientRect().width + TILE_GAP : 0;
|
|
16888
|
+
const plain = Math.max(0, Math.floor((room - CHIP - activeWidth) / (TILE + TILE_GAP)));
|
|
16889
|
+
setFit(plain + (activeTile ? 1 : 0));
|
|
16890
|
+
};
|
|
16891
|
+
measure();
|
|
16892
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
16893
|
+
const observer = new ResizeObserver(measure);
|
|
16894
|
+
observer.observe(wrap);
|
|
16895
|
+
observer.observe(ghost);
|
|
16896
|
+
return () => {
|
|
16897
|
+
observer.disconnect();
|
|
16898
|
+
};
|
|
16899
|
+
}, [venueTabs, activeVenueIndex, fullWidth]);
|
|
16900
|
+
(0, import_react31.useEffect)(() => {
|
|
16901
|
+
if (!isListOpen) return;
|
|
16902
|
+
const handlePointerDown = (event) => {
|
|
16903
|
+
var _a;
|
|
16904
|
+
if (!((_a = wrapRef.current) == null ? void 0 : _a.contains(event.target))) setIsListOpen(false);
|
|
16905
|
+
};
|
|
16906
|
+
const handleKeyDown = (event) => {
|
|
16907
|
+
if (event.key === "Escape") setIsListOpen(false);
|
|
16908
|
+
};
|
|
16909
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
16910
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
16911
|
+
return () => {
|
|
16912
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
16913
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
16914
|
+
};
|
|
16915
|
+
}, [isListOpen]);
|
|
16916
|
+
const shownVenueTabs = (0, import_react31.useMemo)(() => {
|
|
16917
|
+
if (fit === null) return venueTabs;
|
|
16918
|
+
if (activeVenueIndex >= fit) {
|
|
16919
|
+
const activeVenueTab = venueTabs[activeVenueIndex];
|
|
16920
|
+
return activeVenueTab ? [...venueTabs.slice(0, Math.max(0, fit - 1)), activeVenueTab] : venueTabs.slice(0, fit);
|
|
16921
|
+
}
|
|
16922
|
+
return venueTabs.slice(0, fit);
|
|
16923
|
+
}, [activeVenueIndex, fit, venueTabs]);
|
|
16924
|
+
const foldedVenueTabs = (0, import_react31.useMemo)(
|
|
16925
|
+
() => venueTabs.filter((tab) => !shownVenueTabs.includes(tab)),
|
|
16926
|
+
[shownVenueTabs, venueTabs]
|
|
16927
|
+
);
|
|
16928
|
+
const foldedCount = foldedVenueTabs.length;
|
|
16929
|
+
const modeShape = fullWidth ? "tile" : "pill";
|
|
16930
|
+
const separator = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("span", { className: "mx-0.5 h-4 w-px shrink-0 bg-agg-separator", "aria-hidden": true });
|
|
16931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
|
|
16932
|
+
"div",
|
|
16933
|
+
{
|
|
16934
|
+
ref: wrapRef,
|
|
16935
|
+
className: cn(
|
|
16936
|
+
"agg-venue-strip relative flex min-w-0 max-w-full flex-col items-end",
|
|
16937
|
+
fullWidth && "w-full",
|
|
16938
|
+
className
|
|
16939
|
+
),
|
|
16940
|
+
children: [
|
|
16941
|
+
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadProps(__spreadValues({ "aria-hidden": true }, { inert: "" }), { className: "h-0 w-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(StripFrame, { frameRef: ghostRef, className: "w-max", children: [
|
|
16942
|
+
modeTabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16943
|
+
StripTile,
|
|
16944
|
+
{
|
|
16945
|
+
tab,
|
|
16946
|
+
isActive: tab.value === activeTab,
|
|
16947
|
+
shape: modeShape,
|
|
16948
|
+
showTooltip: false
|
|
16949
|
+
},
|
|
16950
|
+
tab.value
|
|
16951
|
+
)),
|
|
16952
|
+
venueTabs.length > 0 && modeTabs.length > 0 ? separator : null,
|
|
16953
|
+
venueTabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16954
|
+
StripTile,
|
|
16955
|
+
{
|
|
16956
|
+
tab,
|
|
16957
|
+
isActive: tab.value === activeTab,
|
|
16958
|
+
shape: "tile",
|
|
16959
|
+
showTooltip: false,
|
|
16960
|
+
isVenue: true
|
|
16961
|
+
},
|
|
16962
|
+
tab.value
|
|
16963
|
+
))
|
|
16964
|
+
] }) })),
|
|
16965
|
+
/* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(StripFrame, { className: cn("agg-venue-strip-bar relative", fullWidth && "w-full"), children: [
|
|
16966
|
+
/* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { role: "group", "aria-label": ariaLabel, className: "contents", children: [
|
|
16967
|
+
modeTabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16968
|
+
StripTile,
|
|
16969
|
+
{
|
|
16970
|
+
tab,
|
|
16971
|
+
isActive: tab.value === activeTab,
|
|
16972
|
+
shape: modeShape,
|
|
16973
|
+
motionClassName,
|
|
16974
|
+
showTooltip: false,
|
|
16975
|
+
onSelect: onTabChange
|
|
16976
|
+
},
|
|
16977
|
+
tab.value
|
|
16978
|
+
)),
|
|
16979
|
+
venueTabs.length > 0 && modeTabs.length > 0 ? separator : null,
|
|
16980
|
+
shownVenueTabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
16981
|
+
StripTile,
|
|
16982
|
+
{
|
|
16983
|
+
tab,
|
|
16984
|
+
isActive: tab.value === activeTab,
|
|
16985
|
+
shape: "tile",
|
|
16986
|
+
motionClassName,
|
|
16987
|
+
onSelect: onTabChange,
|
|
16988
|
+
isVenue: true
|
|
16989
|
+
},
|
|
16990
|
+
tab.value
|
|
16991
|
+
))
|
|
16992
|
+
] }),
|
|
16993
|
+
foldedCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
|
|
16994
|
+
"button",
|
|
16995
|
+
{
|
|
16996
|
+
type: "button",
|
|
16997
|
+
"aria-haspopup": "listbox",
|
|
16998
|
+
"aria-expanded": isListOpen,
|
|
16999
|
+
"aria-label": labels.eventList.moreVenuesAria(foldedCount),
|
|
17000
|
+
onClick: () => setIsListOpen((open) => !open),
|
|
17001
|
+
className: cn(
|
|
17002
|
+
"agg-venue-strip-more inline-flex h-7 w-9 shrink-0 items-center justify-center",
|
|
17003
|
+
"rounded-agg-sm font-agg-sans text-agg-xs tabular-nums cursor-pointer",
|
|
17004
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary/40",
|
|
17005
|
+
motionClassName,
|
|
17006
|
+
fullWidth && "ml-auto",
|
|
17007
|
+
isListOpen ? "bg-agg-secondary-hover text-agg-foreground" : "text-agg-foreground/70 hover:bg-agg-secondary-hover hover:text-agg-foreground"
|
|
17008
|
+
),
|
|
17009
|
+
children: [
|
|
17010
|
+
"+",
|
|
17011
|
+
foldedCount
|
|
17012
|
+
]
|
|
17013
|
+
}
|
|
17014
|
+
) : null
|
|
17015
|
+
] }),
|
|
17016
|
+
isListOpen ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
17017
|
+
"div",
|
|
17018
|
+
{
|
|
17019
|
+
role: "listbox",
|
|
17020
|
+
"aria-label": labels.eventList.moreVenuesListAria,
|
|
17021
|
+
className: cn(
|
|
17022
|
+
"agg-venue-strip-list absolute right-0 top-[calc(100%+6px)] z-20 flex flex-col",
|
|
17023
|
+
"rounded-agg-lg border border-agg-separator bg-agg-secondary p-1.5 shadow-agg-card-hover",
|
|
17024
|
+
fullWidth ? "left-0" : "w-[248px]"
|
|
17025
|
+
),
|
|
17026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "flex max-h-[352px] flex-col overflow-y-auto", children: foldedVenueTabs.map((tab) => {
|
|
17027
|
+
const isActive = tab.value === activeTab;
|
|
17028
|
+
const isUnavailable = isTabUnavailable(tab);
|
|
17029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
|
|
17030
|
+
"button",
|
|
17031
|
+
{
|
|
17032
|
+
type: "button",
|
|
17033
|
+
role: "option",
|
|
17034
|
+
"aria-selected": isActive,
|
|
17035
|
+
"aria-disabled": isUnavailable || void 0,
|
|
17036
|
+
disabled: isUnavailable,
|
|
17037
|
+
onClick: () => {
|
|
17038
|
+
onTabChange(tab.value);
|
|
17039
|
+
setIsListOpen(false);
|
|
17040
|
+
},
|
|
17041
|
+
className: cn(
|
|
17042
|
+
"flex h-8 shrink-0 items-center gap-2.5 rounded-agg-sm px-2.5",
|
|
17043
|
+
"font-agg-sans text-agg-sm leading-agg-5 cursor-pointer disabled:cursor-not-allowed",
|
|
17044
|
+
motionClassName,
|
|
17045
|
+
isActive ? "bg-agg-primary/10 text-agg-primary" : "text-agg-foreground hover:bg-agg-secondary-hover",
|
|
17046
|
+
isUnavailable && "opacity-50 hover:bg-transparent"
|
|
17047
|
+
),
|
|
17048
|
+
children: [
|
|
17049
|
+
tab.iconName === "warning-filled" ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" }) : tab.venueLogo ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small", className: "shrink-0" }) : null,
|
|
17050
|
+
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)("span", { className: "flex-1 truncate text-left", children: resolveTabLabel(tab) })
|
|
17051
|
+
]
|
|
17052
|
+
},
|
|
17053
|
+
tab.value
|
|
17054
|
+
);
|
|
17055
|
+
}) })
|
|
17056
|
+
}
|
|
17057
|
+
) : null
|
|
17058
|
+
]
|
|
17059
|
+
}
|
|
17060
|
+
);
|
|
17061
|
+
};
|
|
17062
|
+
EventListVenueStrip.displayName = "EventListVenueStrip";
|
|
17063
|
+
|
|
17064
|
+
// src/events/list/index.tsx
|
|
17065
|
+
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
16746
17066
|
var SORT_ICON_BY_VALUE = {
|
|
16747
17067
|
volume24hr: "sort-volume-24hr",
|
|
16748
17068
|
topArbitrage: "sort-top-arbitrage",
|
|
@@ -16803,69 +17123,69 @@ var EventList = ({
|
|
|
16803
17123
|
stateRef
|
|
16804
17124
|
}) => {
|
|
16805
17125
|
var _a, _b, _c, _d, _e, _f;
|
|
16806
|
-
const labels = (0,
|
|
16807
|
-
const { disabledVenues } = (0,
|
|
17126
|
+
const labels = (0, import_hooks59.useLabels)();
|
|
17127
|
+
const { disabledVenues } = (0, import_hooks59.useAppConfig)();
|
|
16808
17128
|
const {
|
|
16809
17129
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
16810
|
-
} = (0,
|
|
17130
|
+
} = (0, import_hooks59.useSdkUiConfig)();
|
|
16811
17131
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
16812
17132
|
const resolvedTabs = useEventListTabs();
|
|
16813
|
-
const visibleVenues = (0,
|
|
16814
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
17133
|
+
const visibleVenues = (0, import_react32.useMemo)(
|
|
17134
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks59.getVisibleVenueIdsByConfig)(import_sdk17.VENUES, disabledVenues),
|
|
16815
17135
|
[disabledVenues]
|
|
16816
17136
|
);
|
|
16817
|
-
const [internalActiveTabValue, setInternalActiveTabValue] = (0,
|
|
17137
|
+
const [internalActiveTabValue, setInternalActiveTabValue] = (0, import_react32.useState)(
|
|
16818
17138
|
(_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
16819
17139
|
);
|
|
16820
17140
|
const activeTabValue = controlledActiveVenueTab != null ? controlledActiveVenueTab : internalActiveTabValue;
|
|
16821
|
-
const [internalSelectedSort, setInternalSelectedSort] = (0,
|
|
17141
|
+
const [internalSelectedSort, setInternalSelectedSort] = (0, import_react32.useState)(DEFAULT_EVENT_LIST_SORT);
|
|
16822
17142
|
const selectedSort = controlledSelectedSort != null ? controlledSelectedSort : internalSelectedSort;
|
|
16823
|
-
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0,
|
|
16824
|
-
const [internalCategoryPath, setInternalCategoryPath] = (0,
|
|
17143
|
+
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0, import_react32.useState)(false);
|
|
17144
|
+
const [internalCategoryPath, setInternalCategoryPath] = (0, import_react32.useState)([]);
|
|
16825
17145
|
const categoryPath = controlledCategoryPath != null ? controlledCategoryPath : internalCategoryPath;
|
|
16826
|
-
const [collapsedCategoryIds, setCollapsedCategoryIds] = (0,
|
|
16827
|
-
const handleActiveTabChange = (0,
|
|
17146
|
+
const [collapsedCategoryIds, setCollapsedCategoryIds] = (0, import_react32.useState)(() => /* @__PURE__ */ new Set());
|
|
17147
|
+
const handleActiveTabChange = (0, import_react32.useCallback)(
|
|
16828
17148
|
(value) => {
|
|
16829
17149
|
if (controlledActiveVenueTab == null) setInternalActiveTabValue(value);
|
|
16830
17150
|
onActiveVenueTabChange == null ? void 0 : onActiveVenueTabChange(value, { history: "push" });
|
|
16831
17151
|
},
|
|
16832
17152
|
[controlledActiveVenueTab, onActiveVenueTabChange]
|
|
16833
17153
|
);
|
|
16834
|
-
const handleSelectedSortChange = (0,
|
|
17154
|
+
const handleSelectedSortChange = (0, import_react32.useCallback)(
|
|
16835
17155
|
(value) => {
|
|
16836
17156
|
if (controlledSelectedSort == null) setInternalSelectedSort(value);
|
|
16837
17157
|
onSelectedSortChange == null ? void 0 : onSelectedSortChange(value, { history: "push" });
|
|
16838
17158
|
},
|
|
16839
17159
|
[controlledSelectedSort, onSelectedSortChange]
|
|
16840
17160
|
);
|
|
16841
|
-
const handleCategoryPathChange = (0,
|
|
17161
|
+
const handleCategoryPathChange = (0, import_react32.useCallback)(
|
|
16842
17162
|
(value, options) => {
|
|
16843
17163
|
if (controlledCategoryPath == null) setInternalCategoryPath(value);
|
|
16844
17164
|
onCategoryPathChange == null ? void 0 : onCategoryPathChange(value, options);
|
|
16845
17165
|
},
|
|
16846
17166
|
[controlledCategoryPath, onCategoryPathChange]
|
|
16847
17167
|
);
|
|
16848
|
-
const sortItems = (0,
|
|
17168
|
+
const sortItems = (0, import_react32.useMemo)(() => {
|
|
16849
17169
|
return [
|
|
16850
17170
|
{
|
|
16851
17171
|
value: "volume24hr",
|
|
16852
17172
|
label: labels.eventList.sortBy24hVolume,
|
|
16853
|
-
icon: /* @__PURE__ */ (0,
|
|
17173
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
16854
17174
|
},
|
|
16855
17175
|
{
|
|
16856
17176
|
value: "topArbitrage",
|
|
16857
17177
|
label: labels.eventList.sortByTopArbitrage,
|
|
16858
|
-
icon: /* @__PURE__ */ (0,
|
|
17178
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
16859
17179
|
},
|
|
16860
17180
|
{
|
|
16861
17181
|
value: "volume",
|
|
16862
17182
|
label: labels.eventList.sortByTotalVolume,
|
|
16863
|
-
icon: /* @__PURE__ */ (0,
|
|
17183
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
16864
17184
|
},
|
|
16865
17185
|
{
|
|
16866
17186
|
value: "endDate",
|
|
16867
17187
|
label: labels.eventList.sortByEndingSoon,
|
|
16868
|
-
icon: /* @__PURE__ */ (0,
|
|
17188
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
16869
17189
|
}
|
|
16870
17190
|
];
|
|
16871
17191
|
}, [
|
|
@@ -16875,8 +17195,8 @@ var EventList = ({
|
|
|
16875
17195
|
labels.eventList.sortByTotalVolume
|
|
16876
17196
|
]);
|
|
16877
17197
|
const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
|
|
16878
|
-
const previousBaseCategoryIdRef = (0,
|
|
16879
|
-
(0,
|
|
17198
|
+
const previousBaseCategoryIdRef = (0, import_react32.useRef)(baseCategoryId);
|
|
17199
|
+
(0, import_react32.useEffect)(() => {
|
|
16880
17200
|
var _a2, _b2;
|
|
16881
17201
|
if (previousBaseCategoryIdRef.current === baseCategoryId) return;
|
|
16882
17202
|
previousBaseCategoryIdRef.current = baseCategoryId;
|
|
@@ -16895,15 +17215,15 @@ var EventList = ({
|
|
|
16895
17215
|
isDiscoveryFiltersEnabled,
|
|
16896
17216
|
resolvedTabs
|
|
16897
17217
|
]);
|
|
16898
|
-
const { categories: topLevelCategories } = (0,
|
|
17218
|
+
const { categories: topLevelCategories } = (0, import_hooks59.useCategories)({
|
|
16899
17219
|
queryKeyScope: "event-list-top-categories",
|
|
16900
17220
|
enabled: isDiscoveryFiltersEnabled,
|
|
16901
17221
|
limit: 100
|
|
16902
17222
|
});
|
|
16903
|
-
const sortedTopLevelCategories = (0,
|
|
17223
|
+
const sortedTopLevelCategories = (0, import_react32.useMemo)(() => {
|
|
16904
17224
|
return sortCategoriesForNavigation(topLevelCategories);
|
|
16905
17225
|
}, [topLevelCategories]);
|
|
16906
|
-
const baseCategoryChildPrefetchIds = (0,
|
|
17226
|
+
const baseCategoryChildPrefetchIds = (0, import_react32.useMemo)(() => {
|
|
16907
17227
|
return Array.from(
|
|
16908
17228
|
/* @__PURE__ */ new Set([
|
|
16909
17229
|
...baseCategoryId ? [baseCategoryId] : [],
|
|
@@ -16912,13 +17232,13 @@ var EventList = ({
|
|
|
16912
17232
|
])
|
|
16913
17233
|
);
|
|
16914
17234
|
}, [baseCategoryId, categoryPath, sortedTopLevelCategories]);
|
|
16915
|
-
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0,
|
|
17235
|
+
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0, import_hooks59.useCategoryChildren)({
|
|
16916
17236
|
queryKeyScope: "event-list-category-children",
|
|
16917
17237
|
enabled: isDiscoveryFiltersEnabled,
|
|
16918
17238
|
parentIds: baseCategoryChildPrefetchIds,
|
|
16919
17239
|
limit: 100
|
|
16920
17240
|
});
|
|
16921
|
-
const visibleChildPrefetchIds = (0,
|
|
17241
|
+
const visibleChildPrefetchIds = (0, import_react32.useMemo)(() => {
|
|
16922
17242
|
var _a2, _b2;
|
|
16923
17243
|
const ids = /* @__PURE__ */ new Set();
|
|
16924
17244
|
if (baseCategoryId) {
|
|
@@ -16933,13 +17253,13 @@ var EventList = ({
|
|
|
16933
17253
|
}
|
|
16934
17254
|
return Array.from(ids);
|
|
16935
17255
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
16936
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
17256
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks59.useCategoryChildren)({
|
|
16937
17257
|
queryKeyScope: "event-list-category-children",
|
|
16938
17258
|
enabled: isDiscoveryFiltersEnabled,
|
|
16939
17259
|
parentIds: visibleChildPrefetchIds,
|
|
16940
17260
|
limit: 100
|
|
16941
17261
|
});
|
|
16942
|
-
const visibleGrandchildPrefetchIds = (0,
|
|
17262
|
+
const visibleGrandchildPrefetchIds = (0, import_react32.useMemo)(() => {
|
|
16943
17263
|
var _a2;
|
|
16944
17264
|
const ids = /* @__PURE__ */ new Set();
|
|
16945
17265
|
for (const expandedCategory of categoryPath) {
|
|
@@ -16949,13 +17269,13 @@ var EventList = ({
|
|
|
16949
17269
|
}
|
|
16950
17270
|
return Array.from(ids);
|
|
16951
17271
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
16952
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
17272
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks59.useCategoryChildren)({
|
|
16953
17273
|
queryKeyScope: "event-list-category-children",
|
|
16954
17274
|
enabled: isDiscoveryFiltersEnabled,
|
|
16955
17275
|
parentIds: visibleGrandchildPrefetchIds,
|
|
16956
17276
|
limit: 100
|
|
16957
17277
|
});
|
|
16958
|
-
const childrenByParentId = (0,
|
|
17278
|
+
const childrenByParentId = (0, import_react32.useMemo)(() => {
|
|
16959
17279
|
return new Map([
|
|
16960
17280
|
...baseChildrenByParentId,
|
|
16961
17281
|
...visibleChildrenByParentId,
|
|
@@ -16964,10 +17284,10 @@ var EventList = ({
|
|
|
16964
17284
|
}, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
|
|
16965
17285
|
const controlledCategoryPathKey = (_d = controlledCategoryPath == null ? void 0 : controlledCategoryPath.map((entry) => entry.id).join(",")) != null ? _d : "";
|
|
16966
17286
|
const controlledCategoryPathValidationKey = `${baseCategoryId != null ? baseCategoryId : ""}|${controlledCategoryPathKey}`;
|
|
16967
|
-
const [validatedCategoryPathKey, setValidatedCategoryPathKey] = (0,
|
|
17287
|
+
const [validatedCategoryPathKey, setValidatedCategoryPathKey] = (0, import_react32.useState)(
|
|
16968
17288
|
() => controlledCategoryPath == null || controlledCategoryPath.length === 0 ? controlledCategoryPathValidationKey : ""
|
|
16969
17289
|
);
|
|
16970
|
-
(0,
|
|
17290
|
+
(0, import_react32.useEffect)(() => {
|
|
16971
17291
|
if (controlledCategoryPath == null || controlledCategoryPath.length === 0) {
|
|
16972
17292
|
setValidatedCategoryPathKey(controlledCategoryPathValidationKey);
|
|
16973
17293
|
return;
|
|
@@ -16992,33 +17312,33 @@ var EventList = ({
|
|
|
16992
17312
|
isBaseCategoryChildrenLoading
|
|
16993
17313
|
]);
|
|
16994
17314
|
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_f = (_e = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _e.length) != null ? _f : 0) > 0 || categoryPath.length > 0);
|
|
16995
|
-
const baseCategoryEventCount = (0,
|
|
17315
|
+
const baseCategoryEventCount = (0, import_react32.useMemo)(() => {
|
|
16996
17316
|
var _a2, _b2;
|
|
16997
17317
|
return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
|
|
16998
17318
|
}, [baseCategoryId, sortedTopLevelCategories]);
|
|
16999
|
-
const resolvedCategoryIds = (0,
|
|
17319
|
+
const resolvedCategoryIds = (0, import_react32.useMemo)(() => {
|
|
17000
17320
|
if (!isDiscoveryFiltersEnabled) return categoryIds;
|
|
17001
17321
|
return resolveCategoryIdsFromPath(categoryPath, baseCategoryId ? [baseCategoryId] : void 0);
|
|
17002
17322
|
}, [baseCategoryId, categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
17003
|
-
const sortQueryParams = (0,
|
|
17323
|
+
const sortQueryParams = (0, import_react32.useMemo)(() => {
|
|
17004
17324
|
return resolveSortQueryParams(selectedSort);
|
|
17005
17325
|
}, [selectedSort]);
|
|
17006
|
-
const activeTab = (0,
|
|
17326
|
+
const activeTab = (0, import_react32.useMemo)(() => {
|
|
17007
17327
|
return resolvedTabs.find((tab) => tab.value === activeTabValue);
|
|
17008
17328
|
}, [activeTabValue, resolvedTabs]);
|
|
17009
|
-
const venues = (0,
|
|
17329
|
+
const venues = (0, import_react32.useMemo)(() => {
|
|
17010
17330
|
return resolveTabVenus(activeTab, visibleVenues);
|
|
17011
17331
|
}, [activeTab, visibleVenues]);
|
|
17012
|
-
const matchStatus = (0,
|
|
17332
|
+
const matchStatus = (0, import_react32.useMemo)(() => {
|
|
17013
17333
|
return activeTabValue === "matched" ? activeTab == null ? void 0 : activeTab.matchStatus : void 0;
|
|
17014
17334
|
}, [activeTabValue, activeTab]);
|
|
17015
|
-
const resolvedMaxVisibleItems = (0,
|
|
17335
|
+
const resolvedMaxVisibleItems = (0, import_react32.useMemo)(() => {
|
|
17016
17336
|
if (!Number.isFinite(maxVisibleItems)) return void 0;
|
|
17017
17337
|
return Math.max(1, Math.floor(maxVisibleItems));
|
|
17018
17338
|
}, [maxVisibleItems]);
|
|
17019
17339
|
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
17020
17340
|
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
17021
|
-
const endDateFrom = (0,
|
|
17341
|
+
const endDateFrom = (0, import_react32.useMemo)(() => {
|
|
17022
17342
|
if (search) return void 0;
|
|
17023
17343
|
const BUCKET_MINUTES = 5;
|
|
17024
17344
|
const bucket = /* @__PURE__ */ new Date();
|
|
@@ -17034,14 +17354,14 @@ var EventList = ({
|
|
|
17034
17354
|
isFetchingNextPage,
|
|
17035
17355
|
isPlaceholderData,
|
|
17036
17356
|
loadedPageCount
|
|
17037
|
-
} = (0,
|
|
17357
|
+
} = (0, import_hooks59.useVenueEvents)({
|
|
17038
17358
|
queryKeyScope: "event-list",
|
|
17039
17359
|
venues,
|
|
17040
17360
|
search,
|
|
17041
17361
|
categoryIds: resolvedCategoryIds,
|
|
17042
17362
|
matchStatus,
|
|
17043
17363
|
limit: requestLimit,
|
|
17044
|
-
status: [
|
|
17364
|
+
status: [import_hooks59.MarketStatus.open],
|
|
17045
17365
|
sortBy: sortQueryParams.sortBy,
|
|
17046
17366
|
sortDir: sortQueryParams.sortDir,
|
|
17047
17367
|
endDateFrom,
|
|
@@ -17052,32 +17372,32 @@ var EventList = ({
|
|
|
17052
17372
|
initialPages: initialLoadedPageCount,
|
|
17053
17373
|
enabled: controlledCategoryPath == null || validatedCategoryPathKey === controlledCategoryPathValidationKey
|
|
17054
17374
|
});
|
|
17055
|
-
(0,
|
|
17375
|
+
(0, import_react32.useEffect)(() => {
|
|
17056
17376
|
if (stateRef) {
|
|
17057
17377
|
stateRef.current = { venueTab: activeTabValue, loadedPageCount };
|
|
17058
17378
|
}
|
|
17059
17379
|
}, [stateRef, activeTabValue, loadedPageCount]);
|
|
17060
|
-
const filteredEvents = (0,
|
|
17380
|
+
const filteredEvents = (0, import_react32.useMemo)(() => {
|
|
17061
17381
|
return filterEventsByTabValue(events, activeTabValue);
|
|
17062
17382
|
}, [events, activeTabValue]);
|
|
17063
|
-
const groupedEvents = (0,
|
|
17383
|
+
const groupedEvents = (0, import_react32.useMemo)(() => {
|
|
17064
17384
|
return splitEventsByLifecycle(filteredEvents);
|
|
17065
17385
|
}, [filteredEvents]);
|
|
17066
|
-
const orderedEvents = (0,
|
|
17386
|
+
const orderedEvents = (0, import_react32.useMemo)(() => {
|
|
17067
17387
|
return groupedEvents.open;
|
|
17068
17388
|
}, [groupedEvents.open]);
|
|
17069
|
-
const tileEvents = (0,
|
|
17389
|
+
const tileEvents = (0, import_react32.useMemo)(() => {
|
|
17070
17390
|
const normalizedEvents = orderedEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
17071
17391
|
if (resolvedMaxVisibleItems == null) return normalizedEvents;
|
|
17072
17392
|
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
17073
17393
|
}, [orderedEvents, resolvedMaxVisibleItems]);
|
|
17074
|
-
const visibleVenueMarkets = (0,
|
|
17394
|
+
const visibleVenueMarkets = (0, import_react32.useMemo)(() => {
|
|
17075
17395
|
return collectEventListVenueMarkets(tileEvents);
|
|
17076
17396
|
}, [tileEvents]);
|
|
17077
|
-
const visibleMidpointVenueMarketIds = (0,
|
|
17397
|
+
const visibleMidpointVenueMarketIds = (0, import_react32.useMemo)(() => {
|
|
17078
17398
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
17079
17399
|
}, [visibleVenueMarkets]);
|
|
17080
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
17400
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks59.useVenueMarketMidpoints)({
|
|
17081
17401
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
17082
17402
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
17083
17403
|
});
|
|
@@ -17085,8 +17405,8 @@ var EventList = ({
|
|
|
17085
17405
|
const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
|
|
17086
17406
|
const placeholderSkeletonCount = isPlaceholderData ? Math.min(Math.max(tileEvents.length, PLACEHOLDER_SKELETON_MIN_ITEMS), requestLimit) : 0;
|
|
17087
17407
|
const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage && !isPlaceholderData;
|
|
17088
|
-
const loadMoreRef = (0,
|
|
17089
|
-
(0,
|
|
17408
|
+
const loadMoreRef = (0, import_react32.useRef)(null);
|
|
17409
|
+
(0, import_react32.useEffect)(() => {
|
|
17090
17410
|
if (!shouldPaginate) return;
|
|
17091
17411
|
if (!hasNextPage) return;
|
|
17092
17412
|
if (typeof IntersectionObserver === "undefined") return;
|
|
@@ -17137,7 +17457,7 @@ var EventList = ({
|
|
|
17137
17457
|
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
17138
17458
|
};
|
|
17139
17459
|
if (shouldRenderLoadingState) {
|
|
17140
|
-
return /* @__PURE__ */ (0,
|
|
17460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17141
17461
|
Skeleton,
|
|
17142
17462
|
{
|
|
17143
17463
|
view: "event-list",
|
|
@@ -17146,8 +17466,8 @@ var EventList = ({
|
|
|
17146
17466
|
}
|
|
17147
17467
|
);
|
|
17148
17468
|
}
|
|
17149
|
-
return /* @__PURE__ */ (0,
|
|
17150
|
-
/* @__PURE__ */ (0,
|
|
17469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
17470
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
17151
17471
|
"header",
|
|
17152
17472
|
{
|
|
17153
17473
|
className: cn(
|
|
@@ -17156,19 +17476,18 @@ var EventList = ({
|
|
|
17156
17476
|
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
17157
17477
|
),
|
|
17158
17478
|
children: [
|
|
17159
|
-
/* @__PURE__ */ (0,
|
|
17160
|
-
/* @__PURE__ */ (0,
|
|
17161
|
-
/* @__PURE__ */ (0,
|
|
17162
|
-
|
|
17479
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title2 }) }),
|
|
17480
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
17481
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17482
|
+
EventListVenueStrip,
|
|
17163
17483
|
{
|
|
17164
17484
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
17165
|
-
className: "agg-event-list-tabs
|
|
17485
|
+
className: "agg-event-list-tabs",
|
|
17166
17486
|
activeTab: activeTabValue,
|
|
17167
|
-
onTabChange: handleActiveTabChange
|
|
17168
|
-
overflowBehavior: "scroll"
|
|
17487
|
+
onTabChange: handleActiveTabChange
|
|
17169
17488
|
}
|
|
17170
17489
|
),
|
|
17171
|
-
/* @__PURE__ */ (0,
|
|
17490
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17172
17491
|
Select,
|
|
17173
17492
|
{
|
|
17174
17493
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -17184,18 +17503,18 @@ var EventList = ({
|
|
|
17184
17503
|
]
|
|
17185
17504
|
}
|
|
17186
17505
|
),
|
|
17187
|
-
/* @__PURE__ */ (0,
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
/* @__PURE__ */ (0,
|
|
17506
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17507
|
+
EventListVenueStrip,
|
|
17508
|
+
{
|
|
17509
|
+
ariaLabel: labels.eventList.tabsAria(title2),
|
|
17510
|
+
className: "agg-event-list-tabs md:hidden!",
|
|
17511
|
+
activeTab: activeTabValue,
|
|
17512
|
+
onTabChange: handleActiveTabChange,
|
|
17513
|
+
fullWidth: true
|
|
17514
|
+
}
|
|
17515
|
+
),
|
|
17516
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
17517
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17199
17518
|
Select,
|
|
17200
17519
|
{
|
|
17201
17520
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -17206,23 +17525,23 @@ var EventList = ({
|
|
|
17206
17525
|
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
17207
17526
|
}
|
|
17208
17527
|
),
|
|
17209
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
17528
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17210
17529
|
"button",
|
|
17211
17530
|
{
|
|
17212
17531
|
type: "button",
|
|
17213
17532
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[8px] border-2 border-agg-primary bg-agg-secondary text-agg-foreground cursor-pointer",
|
|
17214
17533
|
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
17215
17534
|
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
17216
|
-
children: /* @__PURE__ */ (0,
|
|
17535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
17217
17536
|
}
|
|
17218
17537
|
) : null
|
|
17219
17538
|
] }),
|
|
17220
|
-
/* @__PURE__ */ (0,
|
|
17539
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
17221
17540
|
"div",
|
|
17222
17541
|
{
|
|
17223
17542
|
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
17224
17543
|
children: [
|
|
17225
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
17544
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "agg-sidebar max-h-[calc(100vh-19rem)] overflow-y-auto rounded-[8px] border border-agg-separator bg-agg-secondary p-2", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17226
17545
|
CategorySidebar,
|
|
17227
17546
|
{
|
|
17228
17547
|
baseCategoryId,
|
|
@@ -17235,7 +17554,7 @@ var EventList = ({
|
|
|
17235
17554
|
onToggleCategory: handleToggleSubcategory
|
|
17236
17555
|
}
|
|
17237
17556
|
) }) }) : null,
|
|
17238
|
-
/* @__PURE__ */ (0,
|
|
17557
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
17239
17558
|
"div",
|
|
17240
17559
|
{
|
|
17241
17560
|
className: cn(
|
|
@@ -17245,7 +17564,7 @@ var EventList = ({
|
|
|
17245
17564
|
gridClassName
|
|
17246
17565
|
),
|
|
17247
17566
|
children: [
|
|
17248
|
-
isPlaceholderData ? Array.from({ length: placeholderSkeletonCount }).map((_, index) => /* @__PURE__ */ (0,
|
|
17567
|
+
isPlaceholderData ? Array.from({ length: placeholderSkeletonCount }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17249
17568
|
EventListItem,
|
|
17250
17569
|
{
|
|
17251
17570
|
isLoading: true,
|
|
@@ -17255,7 +17574,7 @@ var EventList = ({
|
|
|
17255
17574
|
},
|
|
17256
17575
|
`placeholder-${index}`
|
|
17257
17576
|
)) : null,
|
|
17258
|
-
(isPlaceholderData ? [] : tileEvents).map((event) => /* @__PURE__ */ (0,
|
|
17577
|
+
(isPlaceholderData ? [] : tileEvents).map((event) => /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17259
17578
|
EventListItem,
|
|
17260
17579
|
{
|
|
17261
17580
|
event,
|
|
@@ -17268,11 +17587,11 @@ var EventList = ({
|
|
|
17268
17587
|
onMarketClick,
|
|
17269
17588
|
getMarketHref,
|
|
17270
17589
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
17271
|
-
marketStatus:
|
|
17590
|
+
marketStatus: import_hooks59.MarketStatus.open
|
|
17272
17591
|
},
|
|
17273
17592
|
event.id
|
|
17274
17593
|
)),
|
|
17275
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0,
|
|
17594
|
+
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17276
17595
|
EventListItem,
|
|
17277
17596
|
{
|
|
17278
17597
|
isLoading: true,
|
|
@@ -17282,20 +17601,20 @@ var EventList = ({
|
|
|
17282
17601
|
},
|
|
17283
17602
|
`loading-${index}`
|
|
17284
17603
|
)) : null,
|
|
17285
|
-
shouldRenderEmptyState ? /* @__PURE__ */ (0,
|
|
17604
|
+
shouldRenderEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17286
17605
|
StateMessage,
|
|
17287
17606
|
{
|
|
17288
17607
|
title: labels.eventList.emptyTitle,
|
|
17289
17608
|
description: labels.eventList.emptyDescription,
|
|
17290
|
-
icon: /* @__PURE__ */ (0,
|
|
17609
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: "search-empty" })
|
|
17291
17610
|
}
|
|
17292
17611
|
) }) : null,
|
|
17293
|
-
isError ? /* @__PURE__ */ (0,
|
|
17612
|
+
isError ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17294
17613
|
StateMessage,
|
|
17295
17614
|
{
|
|
17296
17615
|
title: labels.eventList.errorTitle,
|
|
17297
17616
|
description: labels.eventList.errorDescription,
|
|
17298
|
-
icon: /* @__PURE__ */ (0,
|
|
17617
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Icon, { name: "warning" })
|
|
17299
17618
|
}
|
|
17300
17619
|
) }) : null
|
|
17301
17620
|
]
|
|
@@ -17304,7 +17623,7 @@ var EventList = ({
|
|
|
17304
17623
|
]
|
|
17305
17624
|
}
|
|
17306
17625
|
),
|
|
17307
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
17626
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17308
17627
|
Modal.Container,
|
|
17309
17628
|
{
|
|
17310
17629
|
classNames: {
|
|
@@ -17313,20 +17632,20 @@ var EventList = ({
|
|
|
17313
17632
|
content: "items-end p-0 pointer-events-none",
|
|
17314
17633
|
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
17315
17634
|
},
|
|
17316
|
-
children: /* @__PURE__ */ (0,
|
|
17317
|
-
/* @__PURE__ */ (0,
|
|
17318
|
-
/* @__PURE__ */ (0,
|
|
17319
|
-
/* @__PURE__ */ (0,
|
|
17320
|
-
/* @__PURE__ */ (0,
|
|
17635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
|
|
17636
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
|
|
17637
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
17638
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Dialog2.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
|
|
17639
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17321
17640
|
Dialog2.Close,
|
|
17322
17641
|
{
|
|
17323
17642
|
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
17324
17643
|
"aria-label": labels.common.close,
|
|
17325
|
-
children: /* @__PURE__ */ (0,
|
|
17644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(CloseIcon, { className: "h-5 w-5" })
|
|
17326
17645
|
}
|
|
17327
17646
|
)
|
|
17328
17647
|
] }),
|
|
17329
|
-
/* @__PURE__ */ (0,
|
|
17648
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17330
17649
|
CategorySidebar,
|
|
17331
17650
|
{
|
|
17332
17651
|
baseCategoryId,
|
|
@@ -17342,7 +17661,7 @@ var EventList = ({
|
|
|
17342
17661
|
] })
|
|
17343
17662
|
}
|
|
17344
17663
|
) }) : null,
|
|
17345
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0,
|
|
17664
|
+
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
|
|
17346
17665
|
] });
|
|
17347
17666
|
};
|
|
17348
17667
|
EventList.displayName = "EventList";
|
|
@@ -17352,6 +17671,7 @@ EventList.displayName = "EventList";
|
|
|
17352
17671
|
EventListItem,
|
|
17353
17672
|
EventListItemDetails,
|
|
17354
17673
|
EventListItemV2,
|
|
17674
|
+
EventListVenueStrip,
|
|
17355
17675
|
MarketDetails,
|
|
17356
17676
|
MarketDetailsList,
|
|
17357
17677
|
Orderbook,
|