@agg-market/ui 12.0.0 → 14.0.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-AKR2ZSBQ.mjs → chunk-4AK5XMOS.mjs} +341 -243
- package/dist/{chunk-XUML4ZJQ.mjs → chunk-B56YA2YQ.mjs} +246 -215
- package/dist/{chunk-TA74OXPL.mjs → chunk-CHVTY3OB.mjs} +1310 -1115
- package/dist/{chunk-VOYSFL6U.mjs → chunk-GQ4P3AHJ.mjs} +1 -1
- package/dist/{chunk-VMJGQKKU.mjs → chunk-T4WFRR6D.mjs} +1 -1
- package/dist/events.js +556 -526
- package/dist/events.mjs +2 -2
- package/dist/index.js +2310 -1984
- package/dist/index.mjs +7 -5
- package/dist/modals.js +2551 -2319
- package/dist/modals.mjs +2 -2
- package/dist/pages.js +1173 -1042
- package/dist/pages.mjs +4 -4
- package/dist/primitives.js +247 -215
- package/dist/primitives.mjs +3 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +427 -397
- package/dist/trading.mjs +2 -2
- package/dist/types/deposit/deposit-modal.constants.d.mts +0 -4
- package/dist/types/deposit/deposit-modal.constants.d.ts +0 -4
- package/dist/types/deposit/deposit-modal.types.d.mts +110 -14
- package/dist/types/deposit/deposit-modal.types.d.ts +110 -14
- package/dist/types/deposit/index.d.mts +1 -1
- package/dist/types/deposit/index.d.ts +1 -1
- package/dist/types/deposit/steps/card-deposit.d.mts +13 -3
- package/dist/types/deposit/steps/card-deposit.d.ts +13 -3
- package/dist/types/deposit/steps/card-provider.d.mts +10 -0
- package/dist/types/deposit/steps/card-provider.d.ts +10 -0
- package/dist/types/deposit/steps/card-purchase-success.d.mts +7 -0
- package/dist/types/deposit/steps/card-purchase-success.d.ts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.mts +13 -3
- package/dist/types/deposit/steps/crypto-transfer.d.ts +13 -3
- package/dist/types/deposit/steps/deposit-method.d.mts +6 -4
- package/dist/types/deposit/steps/deposit-method.d.ts +6 -4
- package/dist/types/deposit/steps/wallet-form.d.mts +20 -0
- package/dist/types/deposit/steps/wallet-form.d.ts +20 -0
- package/dist/types/deposit/steps/wallet-processing.d.mts +6 -0
- package/dist/types/deposit/steps/wallet-processing.d.ts +6 -0
- package/dist/types/deposit/steps/wallet-success.d.mts +7 -0
- package/dist/types/deposit/steps/wallet-success.d.ts +7 -0
- package/dist/types/pages/user-profile/index.d.mts +2 -2
- package/dist/types/pages/user-profile/index.d.ts +2 -2
- package/dist/types/pages/user-profile/user-profile.types.d.mts +16 -5
- package/dist/types/pages/user-profile/user-profile.types.d.ts +16 -5
- package/dist/types/primitives/icon/index.d.mts +2 -1
- package/dist/types/primitives/icon/index.d.ts +2 -1
- package/dist/types/primitives/icon/registry.d.mts +4 -0
- package/dist/types/primitives/icon/registry.d.ts +4 -0
- package/dist/types/primitives/icon/svg/success-check.d.mts +5 -0
- package/dist/types/primitives/icon/svg/success-check.d.ts +5 -0
- package/dist/types/withdraw/index.d.mts +2 -2
- package/dist/types/withdraw/index.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +14 -5
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +14 -5
- package/dist/types/withdraw/steps/withdraw-method.d.mts +3 -4
- package/dist/types/withdraw/steps/withdraw-method.d.ts +3 -4
- package/dist/types/withdraw/steps/withdraw-provider.d.mts +10 -0
- package/dist/types/withdraw/steps/withdraw-provider.d.ts +10 -0
- package/dist/types/withdraw/steps/withdraw-success.d.mts +7 -0
- package/dist/types/withdraw/steps/withdraw-success.d.ts +7 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.mts +0 -4
- package/dist/types/withdraw/withdraw-modal.constants.d.ts +0 -4
- package/dist/types/withdraw/withdraw-modal.types.d.mts +47 -23
- package/dist/types/withdraw/withdraw-modal.types.d.ts +47 -23
- package/package.json +2 -2
- package/dist/types/deposit/steps/kalshi-deposit.d.mts +0 -5
- package/dist/types/deposit/steps/kalshi-deposit.d.ts +0 -5
- package/dist/types/withdraw/steps/kalshi-withdraw.d.mts +0 -5
- package/dist/types/withdraw/steps/kalshi-withdraw.d.ts +0 -5
- package/dist/types/withdraw/steps/venue-selection.d.mts +0 -6
- package/dist/types/withdraw/steps/venue-selection.d.ts +0 -6
|
@@ -7,11 +7,12 @@ import {
|
|
|
7
7
|
getDefaultEventListTabs,
|
|
8
8
|
isErrorWithStatus,
|
|
9
9
|
resolveTabVenus
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GQ4P3AHJ.mjs";
|
|
11
11
|
import {
|
|
12
12
|
PlaceOrder,
|
|
13
|
-
Settlement
|
|
14
|
-
|
|
13
|
+
Settlement,
|
|
14
|
+
getTradingSharesLabel
|
|
15
|
+
} from "./chunk-T4WFRR6D.mjs";
|
|
15
16
|
import {
|
|
16
17
|
Button,
|
|
17
18
|
Card,
|
|
@@ -29,10 +30,9 @@ import {
|
|
|
29
30
|
__spreadProps,
|
|
30
31
|
__spreadValues,
|
|
31
32
|
cn,
|
|
32
|
-
skeletonViews,
|
|
33
33
|
venueLogoLabels,
|
|
34
34
|
venueLogoUrlRegistry
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-B56YA2YQ.mjs";
|
|
36
36
|
|
|
37
37
|
// src/pages/home/index.tsx
|
|
38
38
|
import { useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
@@ -797,11 +797,11 @@ var AvailableBalanceCard = ({
|
|
|
797
797
|
{
|
|
798
798
|
"aria-label": "Balances by chain",
|
|
799
799
|
size: "small",
|
|
800
|
-
side: "
|
|
800
|
+
side: "bottom",
|
|
801
801
|
classNames: { content: "border-0" },
|
|
802
802
|
content: /* @__PURE__ */ jsxs4("div", { className: "flex min-w-[280px] max-w-[360px] flex-col gap-2 p-3 sm:p-4", children: [
|
|
803
803
|
/* @__PURE__ */ jsx4("div", { className: "font-agg-sans text-agg-sm leading-5 font-agg-bold text-agg-foreground", children: "Balance by network" }),
|
|
804
|
-
/* @__PURE__ */ jsx4("div", { role: "list",
|
|
804
|
+
/* @__PURE__ */ jsx4("div", { role: "list", children: chains.map((row) => {
|
|
805
805
|
const icon = chainIconName(row.label);
|
|
806
806
|
return /* @__PURE__ */ jsxs4(
|
|
807
807
|
"div",
|
|
@@ -868,7 +868,7 @@ var AvailableBalanceCard = ({
|
|
|
868
868
|
AvailableBalanceCard.displayName = "AvailableBalanceCard";
|
|
869
869
|
|
|
870
870
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
871
|
-
import { useMemo as useMemo3, useState as useState3 } from "react";
|
|
871
|
+
import { useEffect as useEffect3, useMemo as useMemo3, useRef as useRef2, useState as useState3 } from "react";
|
|
872
872
|
|
|
873
873
|
// src/pages/user-profile/user-profile.constants.ts
|
|
874
874
|
var USER_PROFILE_TAB_POSITIONS = "positions";
|
|
@@ -895,28 +895,29 @@ var ActivityRow = ({ activity, onClick }) => {
|
|
|
895
895
|
),
|
|
896
896
|
onClick: handleClick,
|
|
897
897
|
children: [
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 w-full flex-1 items-center gap-3 sm:gap-4", children: [
|
|
898
|
+
/* @__PURE__ */ jsxs5("div", { className: "hidden w-[60px] shrink-0 items-center gap-1 sm:flex", children: [
|
|
900
899
|
/* @__PURE__ */ jsx5(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
900
|
+
/* @__PURE__ */ jsx5("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-normal text-agg-foreground", children: activity.type })
|
|
901
|
+
] }),
|
|
902
|
+
/* @__PURE__ */ jsx5("div", { className: "flex min-w-0 w-full flex-1 items-center gap-3 sm:gap-4", children: /* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
903
|
+
/* @__PURE__ */ jsx5(
|
|
904
|
+
RemoteImage,
|
|
905
|
+
{
|
|
906
|
+
src: activity.thumbnailSrc,
|
|
907
|
+
alt: "",
|
|
908
|
+
className: "h-[52px] w-[52px] shrink-0 rounded-agg-sm object-cover sm:h-[60px] sm:w-[60px]"
|
|
909
|
+
}
|
|
910
|
+
),
|
|
911
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
|
|
912
|
+
/* @__PURE__ */ jsx5("p", { className: "min-w-full overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: activity.title }),
|
|
913
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-2 sm:gap-3", children: [
|
|
914
|
+
/* @__PURE__ */ jsx5("span", { className: "inline-flex items-center justify-center gap-1.5 rounded-full bg-agg-secondary-hover px-3 py-1.5 sm:px-4", children: /* @__PURE__ */ jsx5("span", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground whitespace-nowrap", children: activity.outcomeLabel }) }),
|
|
915
|
+
/* @__PURE__ */ jsx5("span", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-black whitespace-nowrap", children: activity.sharesLabel })
|
|
916
916
|
] })
|
|
917
917
|
] })
|
|
918
|
-
] }),
|
|
919
|
-
/* @__PURE__ */
|
|
918
|
+
] }) }),
|
|
919
|
+
/* @__PURE__ */ jsx5("div", { className: "hidden w-[175px] shrink-0 sm:block", "aria-hidden": true }),
|
|
920
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex w-full flex-row items-center justify-between gap-1 text-agg-base leading-agg-6 whitespace-nowrap sm:w-[184px] sm:shrink-0 sm:flex-col sm:items-end sm:justify-center", children: [
|
|
920
921
|
/* @__PURE__ */ jsx5("p", { className: "font-agg-sans font-agg-bold text-black", children: activity.amountLabel }),
|
|
921
922
|
/* @__PURE__ */ jsx5("p", { className: "font-agg-sans font-agg-normal text-agg-muted-foreground", children: activity.timeLabel })
|
|
922
923
|
] })
|
|
@@ -965,22 +966,29 @@ var PositionRow = ({ position, onClick }) => {
|
|
|
965
966
|
onClick: handleClick,
|
|
966
967
|
children: [
|
|
967
968
|
/* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 w-full flex-1 items-center gap-3 sm:gap-4", children: [
|
|
968
|
-
/* @__PURE__ */ jsx7(
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
),
|
|
978
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex
|
|
979
|
-
/* @__PURE__ */ jsx7("
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
969
|
+
/* @__PURE__ */ jsx7(
|
|
970
|
+
RemoteImage,
|
|
971
|
+
{
|
|
972
|
+
src: position.thumbnailSrc,
|
|
973
|
+
alt: "",
|
|
974
|
+
className: "h-[52px] w-[52px] shrink-0 rounded-agg-sm object-cover sm:h-[60px] sm:w-[60px]"
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
|
|
978
|
+
/* @__PURE__ */ jsx7("p", { className: "min-w-full overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: position.title }),
|
|
979
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
980
|
+
/* @__PURE__ */ jsx7("span", { className: "inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-1.5 sm:px-[16px] sm:py-[6px]", children: /* @__PURE__ */ jsx7("span", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground whitespace-nowrap", children: position.outcomeLabel }) }),
|
|
981
|
+
/* @__PURE__ */ jsx7("div", { className: "flex min-w-0 flex-1 flex-wrap content-center items-center gap-x-3 gap-y-2", children: position.venueShareBreakdown.map((row, index) => /* @__PURE__ */ jsxs7(
|
|
982
|
+
"div",
|
|
983
|
+
{
|
|
984
|
+
className: "flex items-center gap-1",
|
|
985
|
+
children: [
|
|
986
|
+
/* @__PURE__ */ jsx7(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" }),
|
|
987
|
+
/* @__PURE__ */ jsx7("span", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-black whitespace-nowrap", children: row.sharesLabel })
|
|
988
|
+
]
|
|
989
|
+
},
|
|
990
|
+
`${row.venue}-${row.sharesLabel}-${String(index)}`
|
|
991
|
+
)) })
|
|
984
992
|
] })
|
|
985
993
|
] })
|
|
986
994
|
] }),
|
|
@@ -1000,7 +1008,14 @@ var PositionRow = ({ position, onClick }) => {
|
|
|
1000
1008
|
}
|
|
1001
1009
|
)
|
|
1002
1010
|
] }),
|
|
1003
|
-
/* @__PURE__ */ jsx7(
|
|
1011
|
+
/* @__PURE__ */ jsx7(
|
|
1012
|
+
Icon,
|
|
1013
|
+
{
|
|
1014
|
+
name: "chevron-right",
|
|
1015
|
+
size: "small",
|
|
1016
|
+
className: "size-5 shrink-0 text-agg-muted-foreground"
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1004
1019
|
] })
|
|
1005
1020
|
]
|
|
1006
1021
|
}
|
|
@@ -1014,6 +1029,7 @@ var tabItems = [
|
|
|
1014
1029
|
{ value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
|
|
1015
1030
|
{ value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
|
|
1016
1031
|
];
|
|
1032
|
+
var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ jsx8("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsx8("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index)) });
|
|
1017
1033
|
var PositionsActivity = ({
|
|
1018
1034
|
activePositions = [],
|
|
1019
1035
|
closedPositions = [],
|
|
@@ -1035,21 +1051,91 @@ var PositionsActivity = ({
|
|
|
1035
1051
|
const [activeTab, setActiveTab] = useState3(USER_PROFILE_TAB_POSITIONS);
|
|
1036
1052
|
const [positionFilter, setPositionFilter] = useState3("active");
|
|
1037
1053
|
const [searchValue, setSearchValue] = useState3("");
|
|
1054
|
+
const [isSearchFocused, setIsSearchFocused] = useState3(false);
|
|
1055
|
+
const positionsLoadMoreRef = useRef2(null);
|
|
1056
|
+
const activitiesLoadMoreRef = useRef2(null);
|
|
1038
1057
|
const isPositionsTab = activeTab === USER_PROFILE_TAB_POSITIONS;
|
|
1039
1058
|
const filteredPositions = useMemo3(() => {
|
|
1040
|
-
const
|
|
1041
|
-
if (!searchValue.trim()) return
|
|
1042
|
-
const
|
|
1043
|
-
return
|
|
1059
|
+
const base = positionFilter === "active" ? activePositions : closedPositions;
|
|
1060
|
+
if (!searchValue.trim()) return base;
|
|
1061
|
+
const q = searchValue.toLowerCase();
|
|
1062
|
+
return base.filter((p) => p.title.toLowerCase().includes(q));
|
|
1044
1063
|
}, [activePositions, closedPositions, positionFilter, searchValue]);
|
|
1045
1064
|
const filteredActivities = useMemo3(() => {
|
|
1046
1065
|
if (!searchValue.trim()) return activities;
|
|
1047
|
-
const
|
|
1048
|
-
return activities.filter((a) => a.title.toLowerCase().includes(
|
|
1066
|
+
const q = searchValue.toLowerCase();
|
|
1067
|
+
return activities.filter((a) => a.title.toLowerCase().includes(q));
|
|
1049
1068
|
}, [activities, searchValue]);
|
|
1069
|
+
const searchResults = useMemo3(() => {
|
|
1070
|
+
if (!searchValue.trim()) return [];
|
|
1071
|
+
if (isPositionsTab) {
|
|
1072
|
+
return filteredPositions.slice(0, 5).map((p) => ({
|
|
1073
|
+
id: p.id,
|
|
1074
|
+
title: p.title,
|
|
1075
|
+
thumbnailSrc: p.thumbnailSrc,
|
|
1076
|
+
metaPrimary: p.outcomeLabel,
|
|
1077
|
+
metaSecondary: p.valueLabel,
|
|
1078
|
+
kind: "position",
|
|
1079
|
+
raw: p
|
|
1080
|
+
}));
|
|
1081
|
+
}
|
|
1082
|
+
return filteredActivities.slice(0, 5).map((a) => ({
|
|
1083
|
+
id: a.id,
|
|
1084
|
+
title: a.title,
|
|
1085
|
+
thumbnailSrc: a.thumbnailSrc,
|
|
1086
|
+
metaPrimary: a.outcomeLabel,
|
|
1087
|
+
metaSecondary: a.amountLabel,
|
|
1088
|
+
kind: "activity",
|
|
1089
|
+
raw: a
|
|
1090
|
+
}));
|
|
1091
|
+
}, [filteredActivities, filteredPositions, isPositionsTab, searchValue]);
|
|
1050
1092
|
const handleSearchChange = (event) => {
|
|
1051
1093
|
setSearchValue(event.target.value);
|
|
1052
1094
|
};
|
|
1095
|
+
useEffect3(() => {
|
|
1096
|
+
if (!isPositionsTab || !hasMorePositions) return;
|
|
1097
|
+
const target = positionsLoadMoreRef.current;
|
|
1098
|
+
if (!target || !onLoadMorePositions) return;
|
|
1099
|
+
const observer = new IntersectionObserver(
|
|
1100
|
+
(entries) => {
|
|
1101
|
+
const entry = entries[0];
|
|
1102
|
+
if (!(entry == null ? void 0 : entry.isIntersecting)) return;
|
|
1103
|
+
if (isLoadingPositions || isLoadingMorePositions || !hasMorePositions) return;
|
|
1104
|
+
onLoadMorePositions();
|
|
1105
|
+
},
|
|
1106
|
+
{ rootMargin: "240px 0px" }
|
|
1107
|
+
);
|
|
1108
|
+
observer.observe(target);
|
|
1109
|
+
return () => observer.disconnect();
|
|
1110
|
+
}, [
|
|
1111
|
+
hasMorePositions,
|
|
1112
|
+
isLoadingMorePositions,
|
|
1113
|
+
isLoadingPositions,
|
|
1114
|
+
isPositionsTab,
|
|
1115
|
+
onLoadMorePositions
|
|
1116
|
+
]);
|
|
1117
|
+
useEffect3(() => {
|
|
1118
|
+
if (isPositionsTab || !hasMoreActivities) return;
|
|
1119
|
+
const target = activitiesLoadMoreRef.current;
|
|
1120
|
+
if (!target || !onLoadMoreActivities) return;
|
|
1121
|
+
const observer = new IntersectionObserver(
|
|
1122
|
+
(entries) => {
|
|
1123
|
+
const entry = entries[0];
|
|
1124
|
+
if (!(entry == null ? void 0 : entry.isIntersecting)) return;
|
|
1125
|
+
if (isLoadingActivities || isLoadingMoreActivities || !hasMoreActivities) return;
|
|
1126
|
+
onLoadMoreActivities();
|
|
1127
|
+
},
|
|
1128
|
+
{ rootMargin: "240px 0px" }
|
|
1129
|
+
);
|
|
1130
|
+
observer.observe(target);
|
|
1131
|
+
return () => observer.disconnect();
|
|
1132
|
+
}, [
|
|
1133
|
+
hasMoreActivities,
|
|
1134
|
+
isLoadingActivities,
|
|
1135
|
+
isLoadingMoreActivities,
|
|
1136
|
+
isPositionsTab,
|
|
1137
|
+
onLoadMoreActivities
|
|
1138
|
+
]);
|
|
1053
1139
|
return /* @__PURE__ */ jsxs8(
|
|
1054
1140
|
"div",
|
|
1055
1141
|
{
|
|
@@ -1091,23 +1177,95 @@ var PositionsActivity = ({
|
|
|
1091
1177
|
)
|
|
1092
1178
|
] }, filter.value);
|
|
1093
1179
|
}) }) : null,
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
"
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
"
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1180
|
+
/* @__PURE__ */ jsxs8(
|
|
1181
|
+
"div",
|
|
1182
|
+
{
|
|
1183
|
+
className: "relative flex w-full min-w-0 flex-1",
|
|
1184
|
+
onFocusCapture: () => setIsSearchFocused(true),
|
|
1185
|
+
onBlurCapture: (event) => {
|
|
1186
|
+
const next = event.relatedTarget;
|
|
1187
|
+
if (next && event.currentTarget.contains(next)) return;
|
|
1188
|
+
setIsSearchFocused(false);
|
|
1189
|
+
},
|
|
1190
|
+
children: [
|
|
1191
|
+
/* @__PURE__ */ jsx8("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ jsxs8("div", { className: "flex h-11 w-full items-center gap-3 rounded-agg-sm border border-agg-separator bg-agg-secondary px-3 py-2.5 focus-within:border-2 focus-within:border-agg-primary sm:h-10", children: [
|
|
1192
|
+
/* @__PURE__ */ jsx8(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
|
|
1193
|
+
/* @__PURE__ */ jsx8(
|
|
1194
|
+
"input",
|
|
1195
|
+
{
|
|
1196
|
+
value: searchValue,
|
|
1197
|
+
onChange: handleSearchChange,
|
|
1198
|
+
placeholder: "Search...",
|
|
1199
|
+
className: cn(
|
|
1200
|
+
"h-6 w-full min-w-0 border-0 bg-transparent p-0",
|
|
1201
|
+
"font-agg-sans text-agg-base leading-agg-6 font-agg-normal text-agg-foreground",
|
|
1202
|
+
"placeholder:text-agg-muted-foreground",
|
|
1203
|
+
"outline-none focus:outline-none"
|
|
1204
|
+
)
|
|
1205
|
+
}
|
|
1206
|
+
)
|
|
1207
|
+
] }) }),
|
|
1208
|
+
isSearchFocused && searchValue.trim() ? /* @__PURE__ */ jsx8("div", { className: "absolute left-0 right-0 top-full z-50 mt-1 w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary pt-2 shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]", children: searchResults.length > 0 ? /* @__PURE__ */ jsx8(
|
|
1209
|
+
"ul",
|
|
1210
|
+
{
|
|
1211
|
+
className: "m-0 flex list-none flex-col p-0",
|
|
1212
|
+
role: "listbox",
|
|
1213
|
+
"aria-label": "Search results",
|
|
1214
|
+
children: searchResults.map((item, index) => /* @__PURE__ */ jsx8(
|
|
1215
|
+
"li",
|
|
1216
|
+
{
|
|
1217
|
+
role: "presentation",
|
|
1218
|
+
className: cn(index > 0 && "border-t border-agg-separator"),
|
|
1219
|
+
children: /* @__PURE__ */ jsxs8(
|
|
1220
|
+
"button",
|
|
1221
|
+
{
|
|
1222
|
+
type: "button",
|
|
1223
|
+
className: "group flex w-full items-center gap-6 px-5 py-4 text-left hover:bg-agg-secondary-hover focus-visible:outline-none focus-visible:bg-agg-secondary-hover",
|
|
1224
|
+
onClick: () => {
|
|
1225
|
+
if (item.kind === "position") {
|
|
1226
|
+
onPositionClick == null ? void 0 : onPositionClick(item.raw);
|
|
1227
|
+
} else {
|
|
1228
|
+
onActivityClick == null ? void 0 : onActivityClick(item.raw);
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
children: [
|
|
1232
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
1233
|
+
/* @__PURE__ */ jsx8(
|
|
1234
|
+
"img",
|
|
1235
|
+
{
|
|
1236
|
+
src: item.thumbnailSrc,
|
|
1237
|
+
alt: "",
|
|
1238
|
+
className: "size-12 shrink-0 rounded-[8px] object-cover"
|
|
1239
|
+
}
|
|
1240
|
+
),
|
|
1241
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
1242
|
+
/* @__PURE__ */ jsx8("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-base leading-agg-6 font-agg-normal text-agg-foreground", children: item.title }),
|
|
1243
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
|
|
1244
|
+
/* @__PURE__ */ jsx8("p", { className: "shrink-0 whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaPrimary }),
|
|
1245
|
+
/* @__PURE__ */ jsx8("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
|
|
1246
|
+
/* @__PURE__ */ jsx8("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaSecondary })
|
|
1247
|
+
] })
|
|
1248
|
+
] })
|
|
1249
|
+
] }),
|
|
1250
|
+
/* @__PURE__ */ jsx8(
|
|
1251
|
+
Icon,
|
|
1252
|
+
{
|
|
1253
|
+
name: "chevron-right",
|
|
1254
|
+
size: "medium",
|
|
1255
|
+
className: "h-5 w-5 shrink-0 text-agg-muted-foreground"
|
|
1256
|
+
}
|
|
1257
|
+
)
|
|
1258
|
+
]
|
|
1259
|
+
}
|
|
1260
|
+
)
|
|
1261
|
+
},
|
|
1262
|
+
item.id
|
|
1263
|
+
))
|
|
1264
|
+
}
|
|
1265
|
+
) : /* @__PURE__ */ jsx8("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: "No results" }) }) : null
|
|
1266
|
+
]
|
|
1267
|
+
}
|
|
1268
|
+
)
|
|
1111
1269
|
] }),
|
|
1112
1270
|
isPositionsTab && filteredPositions.length > 0 ? /* @__PURE__ */ jsxs8("div", { className: "hidden items-center gap-6 px-0 sm:flex", children: [
|
|
1113
1271
|
/* @__PURE__ */ jsx8("p", { className: "min-w-0 flex-1 font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: "Market" }),
|
|
@@ -1118,15 +1276,9 @@ var PositionsActivity = ({
|
|
|
1118
1276
|
!isPositionsTab && filteredActivities.length > 0 ? /* @__PURE__ */ jsxs8("div", { className: "hidden items-center gap-6 px-0 sm:flex", children: [
|
|
1119
1277
|
/* @__PURE__ */ jsx8("p", { className: "w-[60px] shrink-0 font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: "Type" }),
|
|
1120
1278
|
/* @__PURE__ */ jsx8("p", { className: "min-w-0 flex-1 font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: "Market" }),
|
|
1121
|
-
/* @__PURE__ */ jsx8("p", { className: "w-[
|
|
1279
|
+
/* @__PURE__ */ jsx8("p", { className: "w-[184px] shrink-0 font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground text-right", children: "Amount" })
|
|
1122
1280
|
] }) : null,
|
|
1123
|
-
isPositionsTab ? isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ jsx8(
|
|
1124
|
-
Skeleton,
|
|
1125
|
-
{
|
|
1126
|
-
view: skeletonViews.userProfilePositionsActivity,
|
|
1127
|
-
ariaLabel: "Loading positions"
|
|
1128
|
-
}
|
|
1129
|
-
) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ jsx8(
|
|
1281
|
+
isPositionsTab ? isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ jsx8(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ jsx8(
|
|
1130
1282
|
EmptyState,
|
|
1131
1283
|
{
|
|
1132
1284
|
title: "Unable to load positions",
|
|
@@ -1138,38 +1290,15 @@ var PositionsActivity = ({
|
|
|
1138
1290
|
title: "No positions yet",
|
|
1139
1291
|
description: "Your open trades will appear here once you place an order."
|
|
1140
1292
|
}
|
|
1141
|
-
) : isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ jsx8(
|
|
1142
|
-
Skeleton,
|
|
1143
|
-
{
|
|
1144
|
-
view: skeletonViews.userProfilePositionsActivity,
|
|
1145
|
-
ariaLabel: "Loading activity"
|
|
1146
|
-
}
|
|
1147
|
-
) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ jsx8(EmptyState, { title: "Unable to load activity", description: "Please try again in a moment." }) : filteredActivities.length > 0 ? /* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-3 sm:gap-4", children: filteredActivities.map((activity) => /* @__PURE__ */ jsx8(ActivityRow, { activity, onClick: onActivityClick }, activity.id)) }) : /* @__PURE__ */ jsx8(
|
|
1293
|
+
) : isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ jsx8(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ jsx8(EmptyState, { title: "Unable to load activity", description: "Please try again in a moment." }) : filteredActivities.length > 0 ? /* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-3 sm:gap-4", children: filteredActivities.map((activity) => /* @__PURE__ */ jsx8(ActivityRow, { activity, onClick: onActivityClick }, activity.id)) }) : /* @__PURE__ */ jsx8(
|
|
1148
1294
|
EmptyState,
|
|
1149
1295
|
{
|
|
1150
1296
|
title: "No activity yet",
|
|
1151
1297
|
description: "Your trading activity will appear here."
|
|
1152
1298
|
}
|
|
1153
1299
|
),
|
|
1154
|
-
isPositionsTab
|
|
1155
|
-
|
|
1156
|
-
{
|
|
1157
|
-
variant: "secondary",
|
|
1158
|
-
size: "medium",
|
|
1159
|
-
isLoading: isLoadingMorePositions,
|
|
1160
|
-
onClick: onLoadMorePositions,
|
|
1161
|
-
children: "Load more"
|
|
1162
|
-
}
|
|
1163
|
-
) }) : null : hasMoreActivities ? /* @__PURE__ */ jsx8("div", { className: "flex w-full justify-center pt-1", children: /* @__PURE__ */ jsx8(
|
|
1164
|
-
Button,
|
|
1165
|
-
{
|
|
1166
|
-
variant: "secondary",
|
|
1167
|
-
size: "medium",
|
|
1168
|
-
isLoading: isLoadingMoreActivities,
|
|
1169
|
-
onClick: onLoadMoreActivities,
|
|
1170
|
-
children: "Load more"
|
|
1171
|
-
}
|
|
1172
|
-
) }) : null
|
|
1300
|
+
isPositionsTab && hasMorePositions ? /* @__PURE__ */ jsx8("div", { ref: positionsLoadMoreRef, className: "h-px w-full", "aria-hidden": true }) : null,
|
|
1301
|
+
!isPositionsTab && hasMoreActivities ? /* @__PURE__ */ jsx8("div", { ref: activitiesLoadMoreRef, className: "h-px w-full", "aria-hidden": true }) : null
|
|
1173
1302
|
] })
|
|
1174
1303
|
]
|
|
1175
1304
|
}
|
|
@@ -1177,54 +1306,9 @@ var PositionsActivity = ({
|
|
|
1177
1306
|
};
|
|
1178
1307
|
PositionsActivity.displayName = "PositionsActivity";
|
|
1179
1308
|
|
|
1180
|
-
// src/pages/user-profile/components/default-avatar.tsx
|
|
1181
|
-
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1182
|
-
var DefaultAvatar = ({ className }) => {
|
|
1183
|
-
return /* @__PURE__ */ jsxs9(
|
|
1184
|
-
"svg",
|
|
1185
|
-
{
|
|
1186
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1187
|
-
width: "120",
|
|
1188
|
-
height: "120",
|
|
1189
|
-
viewBox: "0 0 120 120",
|
|
1190
|
-
fill: "none",
|
|
1191
|
-
className: cn("shrink-0", className),
|
|
1192
|
-
"aria-hidden": true,
|
|
1193
|
-
children: [
|
|
1194
|
-
/* @__PURE__ */ jsxs9("g", { clipPath: "url(#clip0_default_avatar)", children: [
|
|
1195
|
-
/* @__PURE__ */ jsx9(
|
|
1196
|
-
"path",
|
|
1197
|
-
{
|
|
1198
|
-
d: "M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z",
|
|
1199
|
-
fill: "white"
|
|
1200
|
-
}
|
|
1201
|
-
),
|
|
1202
|
-
/* @__PURE__ */ jsx9(
|
|
1203
|
-
"path",
|
|
1204
|
-
{
|
|
1205
|
-
d: "M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z",
|
|
1206
|
-
fill: "black",
|
|
1207
|
-
fillOpacity: "0.1"
|
|
1208
|
-
}
|
|
1209
|
-
),
|
|
1210
|
-
/* @__PURE__ */ jsx9(
|
|
1211
|
-
"path",
|
|
1212
|
-
{
|
|
1213
|
-
d: "M73.7338 64.1259C80.4187 59.6756 84.8276 52.0804 84.8276 43.4487C84.8276 29.7376 73.7111 18.6211 60 18.6211C46.2890 18.6211 35.1724 29.7376 35.1724 43.4487C35.1724 52.0804 39.5814 59.6756 46.2662 64.1259C46.2662 64.1259 46.2683 64.1280 46.2704 64.1280C46.2683 64.1280 46.2683 64.1259 46.2683 64.1259C30.2669 68.9487 17.8076 81.9356 13.7959 98.2742L13.7980 98.2763C14.4518 99.0645 15.1304 99.8342 15.8235 100.589C15.9911 100.774 16.1669 100.949 16.3387 101.129C16.8724 101.696 17.4124 102.255 17.9669 102.801C18.1966 103.027 18.4304 103.244 18.6642 103.465C19.1773 103.954 19.6966 104.436 20.2262 104.905C20.4890 105.137 20.7559 105.367 21.0207 105.594C21.5400 106.039 22.0656 106.476 22.6014 106.902C22.8828 107.127 23.1662 107.349 23.4497 107.570C23.9918 107.988 24.5421 108.394 25.0987 108.791C25.3862 108.996 25.6697 109.205 25.9614 109.405C26.5490 109.811 27.1469 110.200 27.7490 110.585C28.0200 110.756 28.2849 110.934 28.5580 111.104C29.2531 111.532 29.9607 111.942 30.6745 112.343C30.8628 112.449 31.0469 112.562 31.2373 112.666C32.1600 113.171 33.0973 113.655 34.0490 114.112C34.0718 114.122 34.0966 114.133 34.1193 114.143C35.0276 114.578 35.9504 114.989 36.8835 115.378C37.1731 115.500 37.4690 115.608 37.7607 115.724C38.4352 115.993 39.1097 116.258 39.7966 116.502C40.1607 116.632 40.5290 116.750 40.8952 116.874C41.5200 117.085 42.1490 117.290 42.7821 117.478C43.1835 117.598 43.5869 117.710 43.9924 117.822C44.6049 117.991 45.2214 118.153 45.8442 118.304C46.2642 118.405 46.6862 118.502 47.1104 118.596C47.7331 118.732 48.3580 118.856 48.9869 118.972C49.4131 119.051 49.8373 119.131 50.2676 119.200C50.9173 119.305 51.5711 119.394 52.2269 119.479C52.6407 119.533 53.0524 119.593 53.4683 119.636C54.1924 119.715 54.9228 119.771 55.6531 119.822C56.0069 119.847 56.3566 119.885 56.7104 119.903C57.8007 119.965 58.8952 120 60 120C61.1049 120 62.1993 119.965 63.2897 119.907C63.6435 119.889 63.9952 119.851 64.3469 119.827C65.0793 119.775 65.8097 119.719 66.5318 119.640C66.9476 119.595 67.3593 119.537 67.7731 119.483C68.4290 119.398 69.0828 119.309 69.7324 119.204C70.1607 119.134 70.5869 119.055 71.0131 118.976C71.6421 118.860 72.2690 118.736 72.8897 118.600C73.3138 118.507 73.7359 118.409 74.1559 118.308C74.7766 118.157 75.3931 117.996 76.0076 117.826C76.4111 117.714 76.8166 117.602 77.2180 117.482C77.8531 117.292 78.4800 117.087 79.1049 116.878C79.4711 116.754 79.8414 116.636 80.2035 116.506C80.8883 116.260 81.5649 115.997 82.2393 115.728C82.5311 115.612 82.8269 115.502 83.1166 115.382C84.0456 114.994 84.9642 114.586 85.8683 114.151C85.8952 114.139 85.9242 114.127 85.9511 114.114C86.9028 113.657 87.8400 113.173 88.7628 112.668C88.9531 112.565 89.1373 112.451 89.3256 112.345C90.0393 111.944 90.7469 111.534 91.4421 111.106C91.7152 110.938 91.9821 110.760 92.2511 110.587C92.8531 110.202 93.4511 109.811 94.0387 109.407C94.3283 109.207 94.6138 109.000 94.9014 108.793C95.4580 108.394 96.0083 107.988 96.5504 107.572C96.8359 107.353 97.1173 107.129 97.3987 106.904C97.9324 106.478 98.4600 106.041 98.9793 105.596C99.2462 105.369 99.5131 105.139 99.7738 104.907C100.303 104.438 100.823 103.956 101.336 103.467C101.568 103.246 101.803 103.027 102.033 102.803C102.588 102.257 103.130 101.698 103.661 101.131C103.831 100.949 104.007 100.774 104.177 100.591C104.870 99.8363 105.548 99.0666 106.202 98.2783L106.204 98.2763C102.195 81.9356 89.7352 68.9487 73.7338 64.1259Z",
|
|
1214
|
-
fill: "black",
|
|
1215
|
-
fillOpacity: "0.1"
|
|
1216
|
-
}
|
|
1217
|
-
)
|
|
1218
|
-
] }),
|
|
1219
|
-
/* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsx9("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ jsx9("rect", { width: "120", height: "120", fill: "white" }) }) })
|
|
1220
|
-
]
|
|
1221
|
-
}
|
|
1222
|
-
);
|
|
1223
|
-
};
|
|
1224
|
-
DefaultAvatar.displayName = "DefaultAvatar";
|
|
1225
|
-
|
|
1226
1309
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
1227
|
-
import { jsx as
|
|
1310
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1311
|
+
var fallbackAvatarSrc = "https://picsum.photos/seed/user-profile-avatar/120/120";
|
|
1228
1312
|
var UserInfoCard = ({
|
|
1229
1313
|
user,
|
|
1230
1314
|
onEditProfile,
|
|
@@ -1232,11 +1316,11 @@ var UserInfoCard = ({
|
|
|
1232
1316
|
onWithdraw,
|
|
1233
1317
|
className
|
|
1234
1318
|
}) => {
|
|
1235
|
-
var _a, _b, _c;
|
|
1319
|
+
var _a, _b, _c, _d;
|
|
1236
1320
|
const evmExchanges = ((_a = user.connectedExchanges) != null ? _a : []).filter((ex) => ex.venue !== "kalshi");
|
|
1237
1321
|
const totalExchangeCount = (_c = (_b = user.connectedExchanges) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
1238
1322
|
const hasEvmExchanges = evmExchanges.length > 0;
|
|
1239
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ jsxs9(
|
|
1240
1324
|
"div",
|
|
1241
1325
|
{
|
|
1242
1326
|
className: cn(
|
|
@@ -1244,26 +1328,26 @@ var UserInfoCard = ({
|
|
|
1244
1328
|
className
|
|
1245
1329
|
),
|
|
1246
1330
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex w-full flex-col items-start gap-4 sm:flex-row sm:gap-5", children: [
|
|
1332
|
+
/* @__PURE__ */ jsx9("div", { className: "shrink-0", children: /* @__PURE__ */ jsx9(
|
|
1249
1333
|
RemoteImage,
|
|
1250
1334
|
{
|
|
1251
|
-
src: user.avatarUrl,
|
|
1335
|
+
src: (_d = user.avatarUrl) != null ? _d : fallbackAvatarSrc,
|
|
1252
1336
|
alt: user.username,
|
|
1253
1337
|
className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
|
|
1254
1338
|
}
|
|
1255
|
-
)
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
1260
|
-
user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */
|
|
1339
|
+
) }),
|
|
1340
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
|
|
1341
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
|
|
1342
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1343
|
+
/* @__PURE__ */ jsx9("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
|
|
1344
|
+
user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-2", children: user.socialLinks.map((social) => {
|
|
1261
1345
|
const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
|
|
1262
|
-
const iconNode = /* @__PURE__ */
|
|
1346
|
+
const iconNode = /* @__PURE__ */ jsx9("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-agg-separator bg-agg-secondary sm:size-8", children: /* @__PURE__ */ jsx9(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
|
|
1263
1347
|
if (!social.handle) {
|
|
1264
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ jsx9("span", { children: iconNode }, `${social.platform}-icon`);
|
|
1265
1349
|
}
|
|
1266
|
-
return /* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ jsx9(
|
|
1267
1351
|
"a",
|
|
1268
1352
|
{
|
|
1269
1353
|
href: social.handle,
|
|
@@ -1276,22 +1360,22 @@ var UserInfoCard = ({
|
|
|
1276
1360
|
);
|
|
1277
1361
|
}) }) : null
|
|
1278
1362
|
] }),
|
|
1279
|
-
onEditProfile ? /* @__PURE__ */
|
|
1363
|
+
onEditProfile ? /* @__PURE__ */ jsxs9(
|
|
1280
1364
|
"button",
|
|
1281
1365
|
{
|
|
1282
1366
|
type: "button",
|
|
1283
1367
|
onClick: onEditProfile,
|
|
1284
1368
|
className: "hidden shrink-0 cursor-pointer items-center gap-2 bg-transparent text-agg-primary hover:opacity-80 sm:flex",
|
|
1285
1369
|
children: [
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx9(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
|
|
1371
|
+
/* @__PURE__ */ jsx9("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
|
|
1288
1372
|
]
|
|
1289
1373
|
}
|
|
1290
1374
|
) : null
|
|
1291
1375
|
] }),
|
|
1292
|
-
totalExchangeCount > 0 || user.socialHandle ? /* @__PURE__ */
|
|
1293
|
-
hasEvmExchanges ? /* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1376
|
+
totalExchangeCount > 0 || user.socialHandle ? /* @__PURE__ */ jsxs9("div", { className: "flex w-full flex-col gap-2.5 sm:gap-3", children: [
|
|
1377
|
+
hasEvmExchanges ? /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-2 sm:gap-3", children: [
|
|
1378
|
+
/* @__PURE__ */ jsx9("div", { className: "flex items-center", children: evmExchanges.map((exchange, idx) => /* @__PURE__ */ jsx9(
|
|
1295
1379
|
"div",
|
|
1296
1380
|
{
|
|
1297
1381
|
className: cn(
|
|
@@ -1299,7 +1383,7 @@ var UserInfoCard = ({
|
|
|
1299
1383
|
idx > 0 && "-ml-2"
|
|
1300
1384
|
),
|
|
1301
1385
|
style: { zIndex: evmExchanges.length - idx },
|
|
1302
|
-
children: /* @__PURE__ */
|
|
1386
|
+
children: /* @__PURE__ */ jsx9(
|
|
1303
1387
|
RemoteImage,
|
|
1304
1388
|
{
|
|
1305
1389
|
src: venueLogoUrlRegistry[exchange.venue],
|
|
@@ -1310,18 +1394,18 @@ var UserInfoCard = ({
|
|
|
1310
1394
|
},
|
|
1311
1395
|
`${exchange.venue}-${idx}`
|
|
1312
1396
|
)) }),
|
|
1313
|
-
user.displayAddress ? /* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1397
|
+
user.displayAddress ? /* @__PURE__ */ jsx9("span", { className: "text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: user.displayAddress }) : null,
|
|
1398
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1", children: [
|
|
1399
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-agg-sm font-agg-normal leading-5 text-agg-muted-foreground", children: [
|
|
1316
1400
|
totalExchangeCount,
|
|
1317
1401
|
" exchange",
|
|
1318
1402
|
totalExchangeCount !== 1 ? "s" : ""
|
|
1319
1403
|
] }),
|
|
1320
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "text-agg-muted-foreground" })
|
|
1321
1405
|
] })
|
|
1322
1406
|
] }) : null,
|
|
1323
|
-
user.socialHandle ? /* @__PURE__ */
|
|
1324
|
-
user.socialHandleVenue ? /* @__PURE__ */
|
|
1407
|
+
user.socialHandle ? /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 sm:gap-3", children: [
|
|
1408
|
+
user.socialHandleVenue ? /* @__PURE__ */ jsx9("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden rounded-[4px]", children: /* @__PURE__ */ jsx9(
|
|
1325
1409
|
RemoteImage,
|
|
1326
1410
|
{
|
|
1327
1411
|
src: venueLogoUrlRegistry[user.socialHandleVenue],
|
|
@@ -1329,14 +1413,14 @@ var UserInfoCard = ({
|
|
|
1329
1413
|
className: "h-5 w-5"
|
|
1330
1414
|
}
|
|
1331
1415
|
) }) : null,
|
|
1332
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ jsx9("span", { className: "text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: user.socialHandle })
|
|
1333
1417
|
] }) : null
|
|
1334
1418
|
] }) : null
|
|
1335
1419
|
] })
|
|
1336
1420
|
] }),
|
|
1337
|
-
(onDeposit || onWithdraw) && /* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
onDeposit ? /* @__PURE__ */
|
|
1421
|
+
(onDeposit || onWithdraw) && /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center gap-5", children: [
|
|
1422
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
1423
|
+
onDeposit ? /* @__PURE__ */ jsx9(
|
|
1340
1424
|
"button",
|
|
1341
1425
|
{
|
|
1342
1426
|
type: "button",
|
|
@@ -1345,7 +1429,7 @@ var UserInfoCard = ({
|
|
|
1345
1429
|
children: "Deposit"
|
|
1346
1430
|
}
|
|
1347
1431
|
) : null,
|
|
1348
|
-
onWithdraw ? /* @__PURE__ */
|
|
1432
|
+
onWithdraw ? /* @__PURE__ */ jsx9(
|
|
1349
1433
|
"button",
|
|
1350
1434
|
{
|
|
1351
1435
|
type: "button",
|
|
@@ -1355,15 +1439,15 @@ var UserInfoCard = ({
|
|
|
1355
1439
|
}
|
|
1356
1440
|
) : null
|
|
1357
1441
|
] }),
|
|
1358
|
-
onEditProfile ? /* @__PURE__ */
|
|
1442
|
+
onEditProfile ? /* @__PURE__ */ jsxs9(
|
|
1359
1443
|
"button",
|
|
1360
1444
|
{
|
|
1361
1445
|
type: "button",
|
|
1362
1446
|
onClick: onEditProfile,
|
|
1363
1447
|
className: "flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80 sm:hidden",
|
|
1364
1448
|
children: [
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx9(Icon, { name: "pencil", size: "small", className: "h-3.5 w-3.5 text-agg-primary" }),
|
|
1450
|
+
/* @__PURE__ */ jsx9("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
|
|
1367
1451
|
]
|
|
1368
1452
|
}
|
|
1369
1453
|
) : null
|
|
@@ -1375,7 +1459,7 @@ var UserInfoCard = ({
|
|
|
1375
1459
|
UserInfoCard.displayName = "UserInfoCard";
|
|
1376
1460
|
|
|
1377
1461
|
// src/pages/user-profile/index.tsx
|
|
1378
|
-
import { jsx as
|
|
1462
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1379
1463
|
var currencyFormatter = new Intl.NumberFormat("en-US", {
|
|
1380
1464
|
style: "currency",
|
|
1381
1465
|
currency: "USD",
|
|
@@ -1422,8 +1506,35 @@ var toAmountLabel = (amountRaw, executionPrice, filledAmountRaw) => {
|
|
|
1422
1506
|
if (Number.isFinite(parsedAmount)) return formatUsd(parsedAmount);
|
|
1423
1507
|
return "$0.00";
|
|
1424
1508
|
};
|
|
1509
|
+
var POSITION_ROW_VENUE_ORDER = ["polymarket", "kalshi", "opinion", "limitless"];
|
|
1510
|
+
function venueBreakdownSortKey(venue) {
|
|
1511
|
+
const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
|
|
1512
|
+
return idx === -1 ? POSITION_ROW_VENUE_ORDER.length : idx;
|
|
1513
|
+
}
|
|
1514
|
+
function toVenueLogoName(venue) {
|
|
1515
|
+
return venue;
|
|
1516
|
+
}
|
|
1517
|
+
function buildVenueShareBreakdown(outcome) {
|
|
1518
|
+
const breakdown = outcome.venueBreakdown;
|
|
1519
|
+
if (breakdown.length === 0) {
|
|
1520
|
+
return [
|
|
1521
|
+
{
|
|
1522
|
+
venue: "polymarket",
|
|
1523
|
+
sharesLabel: getTradingSharesLabel(outcome.totalSize)
|
|
1524
|
+
}
|
|
1525
|
+
];
|
|
1526
|
+
}
|
|
1527
|
+
const sorted = [...breakdown].sort(
|
|
1528
|
+
(a, b) => venueBreakdownSortKey(a.venue) - venueBreakdownSortKey(b.venue)
|
|
1529
|
+
);
|
|
1530
|
+
return sorted.map((row) => ({
|
|
1531
|
+
venue: toVenueLogoName(row.venue),
|
|
1532
|
+
sharesLabel: getTradingSharesLabel(row.size)
|
|
1533
|
+
}));
|
|
1534
|
+
}
|
|
1425
1535
|
var UserProfilePage = ({
|
|
1426
1536
|
user,
|
|
1537
|
+
balanceChainsOverride,
|
|
1427
1538
|
venueBalances: _venueBalances,
|
|
1428
1539
|
balance,
|
|
1429
1540
|
activePositions,
|
|
@@ -1526,20 +1637,17 @@ var UserProfilePage = ({
|
|
|
1526
1637
|
if (activePositions) return activePositions;
|
|
1527
1638
|
return positionsQuery.positions.flatMap(
|
|
1528
1639
|
(group) => group.venueMarket.venueMarketOutcomes.map((outcome) => {
|
|
1529
|
-
var _a, _b
|
|
1530
|
-
const outcomeVenue = (_a = outcome.venueBreakdown[0]) == null ? void 0 : _a.venue;
|
|
1531
|
-
const venue = connectedVenues.includes(outcomeVenue != null ? outcomeVenue : "polymarket") ? outcomeVenue != null ? outcomeVenue : "polymarket" : "polymarket";
|
|
1640
|
+
var _a, _b;
|
|
1532
1641
|
const currentPriceCents = Math.round(outcome.currentPrice * 100);
|
|
1533
1642
|
const averagePriceCents = Math.round(outcome.avgEntryPrice * 100);
|
|
1534
1643
|
const pnlPrefix = outcome.unrealizedPnl >= 0 ? "+" : "";
|
|
1535
1644
|
const pnlPercent = (outcome.unrealizedPnlPercent * 100).toFixed(2);
|
|
1536
1645
|
return {
|
|
1537
|
-
id: `${group.targetMarketId}-${outcome.label}-${(
|
|
1538
|
-
thumbnailSrc: (
|
|
1646
|
+
id: `${group.targetMarketId}-${outcome.label}-${(_a = outcome.title) != null ? _a : ""}`,
|
|
1647
|
+
thumbnailSrc: (_b = group.venueMarket.image) != null ? _b : fallbackThumbnailSrc,
|
|
1539
1648
|
title: group.venueMarket.question,
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
sharesLabel: `${outcome.totalSize.toFixed(2)} shares`,
|
|
1649
|
+
outcomeLabel: outcome.label,
|
|
1650
|
+
venueShareBreakdown: buildVenueShareBreakdown(outcome),
|
|
1543
1651
|
averageLabel: `${averagePriceCents}\xA2`,
|
|
1544
1652
|
currentLabel: `${currentPriceCents}\xA2`,
|
|
1545
1653
|
valueLabel: formatUsd(outcome.totalValue),
|
|
@@ -1548,66 +1656,56 @@ var UserProfilePage = ({
|
|
|
1548
1656
|
};
|
|
1549
1657
|
})
|
|
1550
1658
|
);
|
|
1551
|
-
}, [activePositions,
|
|
1659
|
+
}, [activePositions, positionsQuery.positions]);
|
|
1552
1660
|
const resolvedClosedPositions = useMemo4(() => {
|
|
1553
1661
|
return closedPositions != null ? closedPositions : [];
|
|
1554
1662
|
}, [closedPositions]);
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
"
|
|
1663
|
+
return /* @__PURE__ */ jsx10("section", { className: cn("w-full pb-24 lg:pb-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsxs10(
|
|
1664
|
+
"div",
|
|
1557
1665
|
{
|
|
1558
1666
|
className: cn(
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
classNames == null ? void 0 : classNames.root
|
|
1667
|
+
"mx-auto flex w-full max-w-[1200px] flex-col gap-6 px-3 py-3 md:px-6 md:py-6",
|
|
1668
|
+
classNames == null ? void 0 : classNames.topRow
|
|
1562
1669
|
),
|
|
1563
1670
|
children: [
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
|
|
1671
|
+
/* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-1 gap-6 sm:grid-cols-[1fr_minmax(300px,420px)] sm:items-stretch sm:gap-8", children: [
|
|
1672
|
+
/* @__PURE__ */ jsx10(
|
|
1673
|
+
"div",
|
|
1674
|
+
{
|
|
1675
|
+
className: cn(
|
|
1676
|
+
"flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
|
|
1677
|
+
classNames == null ? void 0 : classNames.leftColumn
|
|
1678
|
+
),
|
|
1679
|
+
children: /* @__PURE__ */ jsx10(
|
|
1680
|
+
UserInfoCard,
|
|
1574
1681
|
{
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
UserInfoCard,
|
|
1581
|
-
{
|
|
1582
|
-
user: resolvedUser,
|
|
1583
|
-
onEditProfile,
|
|
1584
|
-
onDeposit,
|
|
1585
|
-
onWithdraw,
|
|
1586
|
-
className: cn("h-full", classNames == null ? void 0 : classNames.userInfoCard)
|
|
1587
|
-
}
|
|
1588
|
-
)
|
|
1682
|
+
user: resolvedUser,
|
|
1683
|
+
onEditProfile,
|
|
1684
|
+
onDeposit,
|
|
1685
|
+
onWithdraw,
|
|
1686
|
+
className: cn("h-full", classNames == null ? void 0 : classNames.userInfoCard)
|
|
1589
1687
|
}
|
|
1590
|
-
)
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
}
|
|
1609
|
-
),
|
|
1610
|
-
/* @__PURE__ */
|
|
1688
|
+
)
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
/* @__PURE__ */ jsxs10("div", { className: cn("grid grid-cols-1 grid-rows-2 gap-4 h-full", classNames == null ? void 0 : classNames.rightColumn), children: [
|
|
1692
|
+
/* @__PURE__ */ jsx10(PositionsValueCard, { valueLabel: positionsValueLabel, className: "h-full" }),
|
|
1693
|
+
/* @__PURE__ */ jsx10(
|
|
1694
|
+
AvailableBalanceCard,
|
|
1695
|
+
{
|
|
1696
|
+
valueLabel: availableBalanceLabel,
|
|
1697
|
+
chains: (balanceChainsOverride != null ? balanceChainsOverride : balanceState.balanceBreakdown).map((b) => ({
|
|
1698
|
+
key: b.key,
|
|
1699
|
+
label: b.label,
|
|
1700
|
+
balance: b.balance,
|
|
1701
|
+
accountCount: b.accountCount
|
|
1702
|
+
})),
|
|
1703
|
+
className: "h-full"
|
|
1704
|
+
}
|
|
1705
|
+
)
|
|
1706
|
+
] })
|
|
1707
|
+
] }),
|
|
1708
|
+
/* @__PURE__ */ jsx10(
|
|
1611
1709
|
PositionsActivity,
|
|
1612
1710
|
{
|
|
1613
1711
|
activePositions: resolvedActivePositions,
|