@retinalabsllc/zairusjs 15.0.5 → 15.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +48 -19
- package/dist/index.mjs +50 -20
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -338,6 +338,7 @@ interface UniversalProfilePageProps {
|
|
|
338
338
|
avatarSrc?: string;
|
|
339
339
|
roleName: string;
|
|
340
340
|
memberSince: string;
|
|
341
|
+
onAvatarTap?: () => void;
|
|
341
342
|
onAccountTap?: () => void;
|
|
342
343
|
onSecurityTap?: () => void;
|
|
343
344
|
onDefiTap?: () => void;
|
|
@@ -345,7 +346,7 @@ interface UniversalProfilePageProps {
|
|
|
345
346
|
onVerificationsTap?: () => void;
|
|
346
347
|
onExportTap?: () => void;
|
|
347
348
|
onLogoutTap?: () => void | Promise<void>;
|
|
348
|
-
onDeleteTap?: () => void
|
|
349
|
+
onDeleteTap?: () => void | Promise<void>;
|
|
349
350
|
}
|
|
350
351
|
declare const UniversalProfilePage: React.FC<UniversalProfilePageProps>;
|
|
351
352
|
|
package/dist/index.d.ts
CHANGED
|
@@ -338,6 +338,7 @@ interface UniversalProfilePageProps {
|
|
|
338
338
|
avatarSrc?: string;
|
|
339
339
|
roleName: string;
|
|
340
340
|
memberSince: string;
|
|
341
|
+
onAvatarTap?: () => void;
|
|
341
342
|
onAccountTap?: () => void;
|
|
342
343
|
onSecurityTap?: () => void;
|
|
343
344
|
onDefiTap?: () => void;
|
|
@@ -345,7 +346,7 @@ interface UniversalProfilePageProps {
|
|
|
345
346
|
onVerificationsTap?: () => void;
|
|
346
347
|
onExportTap?: () => void;
|
|
347
348
|
onLogoutTap?: () => void | Promise<void>;
|
|
348
|
-
onDeleteTap?: () => void
|
|
349
|
+
onDeleteTap?: () => void | Promise<void>;
|
|
349
350
|
}
|
|
350
351
|
declare const UniversalProfilePage: React.FC<UniversalProfilePageProps>;
|
|
351
352
|
|
package/dist/index.js
CHANGED
|
@@ -1561,7 +1561,7 @@ var UniversalHomeView = ({
|
|
|
1561
1561
|
const [isAvatarLoaded, setIsAvatarLoaded] = (0, import_react25.useState)(false);
|
|
1562
1562
|
const [showNotifDialog, setShowNotifDialog] = (0, import_react25.useState)(false);
|
|
1563
1563
|
const [selectedNotif, setSelectedNotif] = (0, import_react25.useState)(null);
|
|
1564
|
-
const fallbackAvatarUrl = `/api/avatar/?name=${encodeURIComponent(fullName || " ")}&background=
|
|
1564
|
+
const fallbackAvatarUrl = `/api/avatar/?name=${encodeURIComponent(fullName || " ")}&background=ffffff&color=000000&size=200&font-size=0.33`;
|
|
1565
1565
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
1566
1566
|
const hasUnreadNotifs = notifications.some((n) => !n.isRead);
|
|
1567
1567
|
(0, import_react25.useEffect)(() => {
|
|
@@ -2094,14 +2094,10 @@ var UniversalCardPage = ({
|
|
|
2094
2094
|
), isFrozen && /* @__PURE__ */ import_react31.default.createElement(
|
|
2095
2095
|
"button",
|
|
2096
2096
|
{
|
|
2097
|
-
onClick: (e) => {
|
|
2098
|
-
e.stopPropagation();
|
|
2099
|
-
handleOverlayUnfreeze();
|
|
2100
|
-
},
|
|
2101
2097
|
disabled: isOverlayActionLoading,
|
|
2102
2098
|
className: `px-6 py-2.5 text-[12px] rounded-full transition-all outline-none active:scale-95 flex items-center gap-2 disabled:opacity-80 ${buttonClasses}`
|
|
2103
2099
|
},
|
|
2104
|
-
isOverlayActionLoading ? /* @__PURE__ */ import_react31.default.createElement(import_react32.HugeiconsIcon, { icon: import_core_free_icons11.Loading03Icon, size: 16, className: `animate-spin ${activeCard.contentDark ? "text-black" : "text-white"}` }) : "
|
|
2100
|
+
isOverlayActionLoading ? /* @__PURE__ */ import_react31.default.createElement(import_react32.HugeiconsIcon, { icon: import_core_free_icons11.Loading03Icon, size: 16, className: `animate-spin ${activeCard.contentDark ? "text-black" : "text-white"}` }) : "Card Frozen"
|
|
2105
2101
|
)),
|
|
2106
2102
|
/* @__PURE__ */ import_react31.default.createElement("div", { className: `absolute inset-0 w-full h-full rounded-2xl overflow-hidden transition-all duration-700 ${isBgLoaded ? "opacity-100 scale-100" : "opacity-0 scale-105"}` }, /* @__PURE__ */ import_react31.default.createElement(
|
|
2107
2103
|
"div",
|
|
@@ -2189,7 +2185,7 @@ var UniversalCardPage = ({
|
|
|
2189
2185
|
{
|
|
2190
2186
|
isOpen: showDeleteDialog,
|
|
2191
2187
|
title: "Delete Card",
|
|
2192
|
-
message: "
|
|
2188
|
+
message: "Please ensure you spend all funds on this card before deleting. Once deleted, any remaining funds will be permanently lost and cannot be recovered.",
|
|
2193
2189
|
confirmText: "Delete",
|
|
2194
2190
|
isDestructive: true,
|
|
2195
2191
|
isProcessing: isDeleting,
|
|
@@ -2229,6 +2225,7 @@ var UniversalProfilePage = ({
|
|
|
2229
2225
|
avatarSrc,
|
|
2230
2226
|
roleName,
|
|
2231
2227
|
memberSince,
|
|
2228
|
+
onAvatarTap,
|
|
2232
2229
|
onAccountTap,
|
|
2233
2230
|
onSecurityTap,
|
|
2234
2231
|
onDefiTap,
|
|
@@ -2241,6 +2238,8 @@ var UniversalProfilePage = ({
|
|
|
2241
2238
|
const [isAvatarLoaded, setIsAvatarLoaded] = (0, import_react33.useState)(false);
|
|
2242
2239
|
const [showLogoutDialog, setShowLogoutDialog] = (0, import_react33.useState)(false);
|
|
2243
2240
|
const [isLoggingOut, setIsLoggingOut] = (0, import_react33.useState)(false);
|
|
2241
|
+
const [showDeleteDialog, setShowDeleteDialog] = (0, import_react33.useState)(false);
|
|
2242
|
+
const [isDeleting, setIsDeleting] = (0, import_react33.useState)(false);
|
|
2244
2243
|
const handleConfirmLogout = async () => {
|
|
2245
2244
|
setIsLoggingOut(true);
|
|
2246
2245
|
try {
|
|
@@ -2252,6 +2251,17 @@ var UniversalProfilePage = ({
|
|
|
2252
2251
|
setShowLogoutDialog(false);
|
|
2253
2252
|
}
|
|
2254
2253
|
};
|
|
2254
|
+
const handleConfirmDelete = async () => {
|
|
2255
|
+
setIsDeleting(true);
|
|
2256
|
+
try {
|
|
2257
|
+
if (onDeleteTap) {
|
|
2258
|
+
await onDeleteTap();
|
|
2259
|
+
}
|
|
2260
|
+
} finally {
|
|
2261
|
+
setIsDeleting(false);
|
|
2262
|
+
setShowDeleteDialog(false);
|
|
2263
|
+
}
|
|
2264
|
+
};
|
|
2255
2265
|
const getBadgeColorClass = (role) => {
|
|
2256
2266
|
if (!role) return "text-neutral-400";
|
|
2257
2267
|
const r = role.toLowerCase();
|
|
@@ -2260,15 +2270,22 @@ var UniversalProfilePage = ({
|
|
|
2260
2270
|
if (r.includes("platinum")) return "text-yellow-400";
|
|
2261
2271
|
return "text-neutral-400";
|
|
2262
2272
|
};
|
|
2263
|
-
return /* @__PURE__ */ import_react33.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ import_react33.default.createElement("div", { className: "pt-8 pb-4 flex flex-col items-center" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2264
|
-
"
|
|
2273
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ import_react33.default.createElement("div", { className: "pt-8 pb-4 flex flex-col items-center" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2274
|
+
"div",
|
|
2265
2275
|
{
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2276
|
+
onClick: onAvatarTap,
|
|
2277
|
+
className: `w-22 h-22 rounded-full bg-white p-1 mb-4 flex items-center justify-center ${onAvatarTap ? "cursor-pointer group" : ""}`
|
|
2278
|
+
},
|
|
2279
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { className: "relative w-full h-full rounded-full overflow-hidden bg-neutral-100 flex items-center justify-center" }, avatarSrc ? /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, !isAvatarLoaded && /* @__PURE__ */ import_react33.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-neutral-100" }, /* @__PURE__ */ import_react33.default.createElement(import_react34.HugeiconsIcon, { icon: import_core_free_icons12.Loading03Icon, size: 24, className: "animate-spin text-black" })), /* @__PURE__ */ import_react33.default.createElement(
|
|
2280
|
+
"img",
|
|
2281
|
+
{
|
|
2282
|
+
src: avatarSrc,
|
|
2283
|
+
alt: "User Avatar",
|
|
2284
|
+
onLoad: () => setIsAvatarLoaded(true),
|
|
2285
|
+
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
2286
|
+
}
|
|
2287
|
+
)) : /* @__PURE__ */ import_react33.default.createElement(import_react34.HugeiconsIcon, { icon: import_core_free_icons12.UserIcon, size: 40, className: "text-neutral-300" }), onAvatarTap && /* @__PURE__ */ import_react33.default.createElement("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-[1px] flex items-center justify-center opacity-80 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity duration-200 z-20" }, /* @__PURE__ */ import_react33.default.createElement(import_react34.HugeiconsIcon, { icon: import_core_free_icons12.Camera01Icon, size: 24, className: "text-white" })))
|
|
2288
|
+
), /* @__PURE__ */ import_react33.default.createElement("div", { className: "bg-white rounded-full px-4 py-2 flex items-center justify-center gap-2 mb-3" }, /* @__PURE__ */ import_react33.default.createElement("span", { className: "text-[12px] text-black" }, roleName), /* @__PURE__ */ import_react33.default.createElement("span", { className: getBadgeColorClass(roleName), "aria-hidden": true }, /* @__PURE__ */ import_react33.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react33.default.createElement("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), /* @__PURE__ */ import_react33.default.createElement("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react33.default.createElement("g", { id: "SVGRepo_iconCarrier" }, " ", /* @__PURE__ */ import_react33.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5924 3.20027C9.34888 3.4078 9.22711 3.51158 9.09706 3.59874C8.79896 3.79854 8.46417 3.93721 8.1121 4.00672C7.95851 4.03705 7.79903 4.04977 7.48008 4.07522C6.6787 4.13918 6.278 4.17115 5.94371 4.28923C5.17051 4.56233 4.56233 5.17051 4.28923 5.94371C4.17115 6.278 4.13918 6.6787 4.07522 7.48008C4.04977 7.79903 4.03705 7.95851 4.00672 8.1121C3.93721 8.46417 3.79854 8.79896 3.59874 9.09706C3.51158 9.22711 3.40781 9.34887 3.20027 9.5924C2.67883 10.2043 2.4181 10.5102 2.26522 10.8301C1.91159 11.57 1.91159 12.43 2.26522 13.1699C2.41811 13.4898 2.67883 13.7957 3.20027 14.4076C3.40778 14.6511 3.51158 14.7729 3.59874 14.9029C3.79854 15.201 3.93721 15.5358 4.00672 15.8879C4.03705 16.0415 4.04977 16.201 4.07522 16.5199C4.13918 17.3213 4.17115 17.722 4.28923 18.0563C4.56233 18.8295 5.17051 19.4377 5.94371 19.7108C6.278 19.8288 6.6787 19.8608 7.48008 19.9248C7.79903 19.9502 7.95851 19.963 8.1121 19.9933C8.46417 20.0628 8.79896 20.2015 9.09706 20.4013C9.22711 20.4884 9.34887 20.5922 9.5924 20.7997C10.2043 21.3212 10.5102 21.5819 10.8301 21.7348C11.57 22.0884 12.43 22.0884 13.1699 21.7348C13.4898 21.5819 13.7957 21.3212 14.4076 20.7997C14.6511 20.5922 14.7729 20.4884 14.9029 20.4013C15.201 20.2015 15.5358 20.0628 15.8879 19.9933C16.0415 19.963 16.201 19.9502 16.5199 19.9248C17.3213 19.8608 17.722 19.8288 18.0563 19.7108C18.8295 19.4377 19.4377 18.8295 19.7108 18.0563C19.8288 17.722 19.8608 17.3213 19.9248 16.5199C19.9502 16.201 19.963 16.0415 19.9933 15.8879C20.0628 15.5358 20.2015 15.201 20.4013 14.9029C20.4884 14.7729 20.5922 14.6511 20.7997 14.4076C21.3212 13.7957 21.5819 13.4898 21.7348 13.1699C22.0884 12.43 22.0884 11.57 21.7348 10.8301C21.5819 10.5102 21.3212 10.2043 20.7997 9.5924C20.5922 9.34887 20.4884 9.22711 20.4013 9.09706C20.2015 8.79896 20.0628 8.46417 19.9933 8.1121C19.963 7.95851 19.9502 7.79903 19.9248 7.48008C19.8608 6.6787 19.8288 6.278 19.7108 5.94371C19.4377 5.17051 18.8295 4.56233 18.0563 4.28923C17.722 4.17115 17.3213 4.13918 16.5199 4.07522C16.201 4.04977 16.0415 4.03705 15.8879 4.00672C15.5358 3.93721 15.201 3.79854 14.9029 3.59874C14.7729 3.51158 14.6511 3.40781 14.4076 3.20027C13.7957 2.67883 13.4898 2.41811 13.1699 2.26522C12.43 1.91159 11.57 1.91159 10.8301 2.26522C10.5102 2.4181 10.2043 2.67883 9.5924 3.20027ZM16.3735 9.86314C16.6913 9.5453 16.6913 9.03 16.3735 8.71216C16.0557 8.39433 15.5403 8.39433 15.2225 8.71216L10.3723 13.5624L8.77746 11.9676C8.45963 11.6498 7.94432 11.6498 7.62649 11.9676C7.30866 12.2854 7.30866 12.8007 7.62649 13.1186L9.79678 15.2889C10.1146 15.6067 10.6299 15.6067 10.9478 15.2889L16.3735 9.86314Z", fill: "currentColor" }), " ")))), /* @__PURE__ */ import_react33.default.createElement("span", { className: "text-[12px] text-neutral-500" }, memberSince)), /* @__PURE__ */ import_react33.default.createElement("div", { className: "w-full flex flex-col gap-4 mt-2" }, /* @__PURE__ */ import_react33.default.createElement("div", { className: "w-full bg-white rounded-2xl overflow-hidden" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2272
2289
|
MenuRow2,
|
|
2273
2290
|
{
|
|
2274
2291
|
icon: import_core_free_icons12.UserIcon,
|
|
@@ -2332,7 +2349,7 @@ var UniversalProfilePage = ({
|
|
|
2332
2349
|
icon: import_core_free_icons12.UserRemove01Icon,
|
|
2333
2350
|
title: "Delete Account",
|
|
2334
2351
|
subtitle: "Remove account",
|
|
2335
|
-
onClick:
|
|
2352
|
+
onClick: () => setShowDeleteDialog(true),
|
|
2336
2353
|
isLast: true
|
|
2337
2354
|
}
|
|
2338
2355
|
))), /* @__PURE__ */ import_react33.default.createElement(
|
|
@@ -2347,6 +2364,18 @@ var UniversalProfilePage = ({
|
|
|
2347
2364
|
onClose: () => setShowLogoutDialog(false),
|
|
2348
2365
|
onConfirm: handleConfirmLogout
|
|
2349
2366
|
}
|
|
2367
|
+
), /* @__PURE__ */ import_react33.default.createElement(
|
|
2368
|
+
ConfirmationDialog,
|
|
2369
|
+
{
|
|
2370
|
+
isOpen: showDeleteDialog,
|
|
2371
|
+
title: "Delete Account",
|
|
2372
|
+
message: "Are you sure you want to delete your account? This action is permanent and cannot be undone.",
|
|
2373
|
+
confirmText: "Delete Account",
|
|
2374
|
+
isDestructive: true,
|
|
2375
|
+
isProcessing: isDeleting,
|
|
2376
|
+
onClose: () => setShowDeleteDialog(false),
|
|
2377
|
+
onConfirm: handleConfirmDelete
|
|
2378
|
+
}
|
|
2350
2379
|
));
|
|
2351
2380
|
};
|
|
2352
2381
|
var MenuRow2 = ({ icon, title, subtitle, onClick, iconColor = "text-black", titleColor = "text-black", isLast = false }) => /* @__PURE__ */ import_react33.default.createElement(
|
|
@@ -2356,7 +2385,7 @@ var MenuRow2 = ({ icon, title, subtitle, onClick, iconColor = "text-black", titl
|
|
|
2356
2385
|
className: `flex items-center p-4 cursor-pointer hover:bg-neutral-50 transition-colors ${!isLast ? "" : ""}`
|
|
2357
2386
|
},
|
|
2358
2387
|
/* @__PURE__ */ import_react33.default.createElement("div", { className: "w-9 h-9 rounded-full border border-neutral-200 flex items-center justify-center shrink-0 mr-4" }, /* @__PURE__ */ import_react33.default.createElement(import_react34.HugeiconsIcon, { icon, size: 16, className: iconColor })),
|
|
2359
|
-
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react33.default.createElement("p", { className: `text-[13px]
|
|
2388
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react33.default.createElement("p", { className: `text-[13px] truncate ${titleColor}` }, title), /* @__PURE__ */ import_react33.default.createElement("p", { className: "text-[11px] text-neutral-500 truncate" }, subtitle)),
|
|
2360
2389
|
/* @__PURE__ */ import_react33.default.createElement(import_react34.HugeiconsIcon, { icon: import_core_free_icons12.ArrowRight01Icon, size: 18, className: "text-neutral-400 shrink-0 ml-2" })
|
|
2361
2390
|
);
|
|
2362
2391
|
|
|
@@ -3957,7 +3986,7 @@ var formatWeb3Name = (name) => {
|
|
|
3957
3986
|
var PageSpinner4 = () => /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex justify-center items-center py-12 w-full" }, /* @__PURE__ */ import_react67.default.createElement(import_react68.HugeiconsIcon, { icon: import_core_free_icons22.Loading03Icon, size: 32, className: "animate-spin mb-4 text-black" }));
|
|
3958
3987
|
var AvatarLogo = ({ src, alt, name, sizeClass = "w-12 h-12" }) => {
|
|
3959
3988
|
const [isLoaded, setIsLoaded] = (0, import_react67.useState)(false);
|
|
3960
|
-
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=
|
|
3989
|
+
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=ffffff&color=000000&size=200&font-size=0.33`;
|
|
3961
3990
|
const finalSrc = src || fallbackUrl;
|
|
3962
3991
|
return /* @__PURE__ */ import_react67.default.createElement("div", { className: `relative shrink-0 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden border-[3px] border-white ${sizeClass}` }, !isLoaded && /* @__PURE__ */ import_react67.default.createElement(import_react68.HugeiconsIcon, { icon: import_core_free_icons22.Loading03Icon, size: 16, className: "animate-spin text-neutral-400 absolute" }), /* @__PURE__ */ import_react67.default.createElement("img", { src: finalSrc, alt, onLoad: () => setIsLoaded(true), className: `w-full h-full object-cover transition-opacity duration-300 ${isLoaded ? "opacity-100" : "opacity-0"}` }));
|
|
3963
3992
|
};
|
|
@@ -4089,7 +4118,7 @@ var UniversalReferralPage = ({
|
|
|
4089
4118
|
};
|
|
4090
4119
|
const AvatarLogo2 = ({ src, alt, name, sizeClass = "w-10 h-10" }) => {
|
|
4091
4120
|
const [isLoaded, setIsLoaded] = (0, import_react69.useState)(false);
|
|
4092
|
-
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=
|
|
4121
|
+
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=e0e0e0&color=000000&size=200&font-size=0.33`;
|
|
4093
4122
|
const finalSrc = src || fallbackUrl;
|
|
4094
4123
|
return /* @__PURE__ */ import_react69.default.createElement("div", { className: `relative shrink-0 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden border-2 border-white ${sizeClass}` }, !isLoaded && /* @__PURE__ */ import_react69.default.createElement(import_react70.HugeiconsIcon, { icon: import_core_free_icons23.Loading03Icon, size: 16, className: "animate-spin text-neutral-400 absolute" }), /* @__PURE__ */ import_react69.default.createElement("img", { src: finalSrc, alt, onLoad: () => setIsLoaded(true), className: `w-full h-full object-cover transition-opacity duration-300 ${isLoaded ? "opacity-100" : "opacity-0"}` }));
|
|
4095
4124
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1516,7 +1516,7 @@ var UniversalHomeView = ({
|
|
|
1516
1516
|
const [isAvatarLoaded, setIsAvatarLoaded] = useState9(false);
|
|
1517
1517
|
const [showNotifDialog, setShowNotifDialog] = useState9(false);
|
|
1518
1518
|
const [selectedNotif, setSelectedNotif] = useState9(null);
|
|
1519
|
-
const fallbackAvatarUrl = `/api/avatar/?name=${encodeURIComponent(fullName || " ")}&background=
|
|
1519
|
+
const fallbackAvatarUrl = `/api/avatar/?name=${encodeURIComponent(fullName || " ")}&background=ffffff&color=000000&size=200&font-size=0.33`;
|
|
1520
1520
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
1521
1521
|
const hasUnreadNotifs = notifications.some((n) => !n.isRead);
|
|
1522
1522
|
useEffect7(() => {
|
|
@@ -2067,14 +2067,10 @@ var UniversalCardPage = ({
|
|
|
2067
2067
|
), isFrozen && /* @__PURE__ */ React19.createElement(
|
|
2068
2068
|
"button",
|
|
2069
2069
|
{
|
|
2070
|
-
onClick: (e) => {
|
|
2071
|
-
e.stopPropagation();
|
|
2072
|
-
handleOverlayUnfreeze();
|
|
2073
|
-
},
|
|
2074
2070
|
disabled: isOverlayActionLoading,
|
|
2075
2071
|
className: `px-6 py-2.5 text-[12px] rounded-full transition-all outline-none active:scale-95 flex items-center gap-2 disabled:opacity-80 ${buttonClasses}`
|
|
2076
2072
|
},
|
|
2077
|
-
isOverlayActionLoading ? /* @__PURE__ */ React19.createElement(HugeiconsIcon13, { icon: Loading03Icon8, size: 16, className: `animate-spin ${activeCard.contentDark ? "text-black" : "text-white"}` }) : "
|
|
2073
|
+
isOverlayActionLoading ? /* @__PURE__ */ React19.createElement(HugeiconsIcon13, { icon: Loading03Icon8, size: 16, className: `animate-spin ${activeCard.contentDark ? "text-black" : "text-white"}` }) : "Card Frozen"
|
|
2078
2074
|
)),
|
|
2079
2075
|
/* @__PURE__ */ React19.createElement("div", { className: `absolute inset-0 w-full h-full rounded-2xl overflow-hidden transition-all duration-700 ${isBgLoaded ? "opacity-100 scale-100" : "opacity-0 scale-105"}` }, /* @__PURE__ */ React19.createElement(
|
|
2080
2076
|
"div",
|
|
@@ -2162,7 +2158,7 @@ var UniversalCardPage = ({
|
|
|
2162
2158
|
{
|
|
2163
2159
|
isOpen: showDeleteDialog,
|
|
2164
2160
|
title: "Delete Card",
|
|
2165
|
-
message: "
|
|
2161
|
+
message: "Please ensure you spend all funds on this card before deleting. Once deleted, any remaining funds will be permanently lost and cannot be recovered.",
|
|
2166
2162
|
confirmText: "Delete",
|
|
2167
2163
|
isDestructive: true,
|
|
2168
2164
|
isProcessing: isDeleting,
|
|
@@ -2207,12 +2203,14 @@ import {
|
|
|
2207
2203
|
LogoutCircle02Icon,
|
|
2208
2204
|
UserRemove01Icon,
|
|
2209
2205
|
ArrowRight01Icon as ArrowRight01Icon4,
|
|
2210
|
-
Loading03Icon as Loading03Icon9
|
|
2206
|
+
Loading03Icon as Loading03Icon9,
|
|
2207
|
+
Camera01Icon
|
|
2211
2208
|
} from "@hugeicons/core-free-icons";
|
|
2212
2209
|
var UniversalProfilePage = ({
|
|
2213
2210
|
avatarSrc,
|
|
2214
2211
|
roleName,
|
|
2215
2212
|
memberSince,
|
|
2213
|
+
onAvatarTap,
|
|
2216
2214
|
onAccountTap,
|
|
2217
2215
|
onSecurityTap,
|
|
2218
2216
|
onDefiTap,
|
|
@@ -2225,6 +2223,8 @@ var UniversalProfilePage = ({
|
|
|
2225
2223
|
const [isAvatarLoaded, setIsAvatarLoaded] = useState12(false);
|
|
2226
2224
|
const [showLogoutDialog, setShowLogoutDialog] = useState12(false);
|
|
2227
2225
|
const [isLoggingOut, setIsLoggingOut] = useState12(false);
|
|
2226
|
+
const [showDeleteDialog, setShowDeleteDialog] = useState12(false);
|
|
2227
|
+
const [isDeleting, setIsDeleting] = useState12(false);
|
|
2228
2228
|
const handleConfirmLogout = async () => {
|
|
2229
2229
|
setIsLoggingOut(true);
|
|
2230
2230
|
try {
|
|
@@ -2236,6 +2236,17 @@ var UniversalProfilePage = ({
|
|
|
2236
2236
|
setShowLogoutDialog(false);
|
|
2237
2237
|
}
|
|
2238
2238
|
};
|
|
2239
|
+
const handleConfirmDelete = async () => {
|
|
2240
|
+
setIsDeleting(true);
|
|
2241
|
+
try {
|
|
2242
|
+
if (onDeleteTap) {
|
|
2243
|
+
await onDeleteTap();
|
|
2244
|
+
}
|
|
2245
|
+
} finally {
|
|
2246
|
+
setIsDeleting(false);
|
|
2247
|
+
setShowDeleteDialog(false);
|
|
2248
|
+
}
|
|
2249
|
+
};
|
|
2239
2250
|
const getBadgeColorClass = (role) => {
|
|
2240
2251
|
if (!role) return "text-neutral-400";
|
|
2241
2252
|
const r = role.toLowerCase();
|
|
@@ -2244,15 +2255,22 @@ var UniversalProfilePage = ({
|
|
|
2244
2255
|
if (r.includes("platinum")) return "text-yellow-400";
|
|
2245
2256
|
return "text-neutral-400";
|
|
2246
2257
|
};
|
|
2247
|
-
return /* @__PURE__ */ React20.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React20.createElement("div", { className: "pt-8 pb-4 flex flex-col items-center" }, /* @__PURE__ */ React20.createElement(
|
|
2248
|
-
"
|
|
2258
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React20.createElement("div", { className: "pt-8 pb-4 flex flex-col items-center" }, /* @__PURE__ */ React20.createElement(
|
|
2259
|
+
"div",
|
|
2249
2260
|
{
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2261
|
+
onClick: onAvatarTap,
|
|
2262
|
+
className: `w-22 h-22 rounded-full bg-white p-1 mb-4 flex items-center justify-center ${onAvatarTap ? "cursor-pointer group" : ""}`
|
|
2263
|
+
},
|
|
2264
|
+
/* @__PURE__ */ React20.createElement("div", { className: "relative w-full h-full rounded-full overflow-hidden bg-neutral-100 flex items-center justify-center" }, avatarSrc ? /* @__PURE__ */ React20.createElement(React20.Fragment, null, !isAvatarLoaded && /* @__PURE__ */ React20.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-neutral-100" }, /* @__PURE__ */ React20.createElement(HugeiconsIcon14, { icon: Loading03Icon9, size: 24, className: "animate-spin text-black" })), /* @__PURE__ */ React20.createElement(
|
|
2265
|
+
"img",
|
|
2266
|
+
{
|
|
2267
|
+
src: avatarSrc,
|
|
2268
|
+
alt: "User Avatar",
|
|
2269
|
+
onLoad: () => setIsAvatarLoaded(true),
|
|
2270
|
+
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
2271
|
+
}
|
|
2272
|
+
)) : /* @__PURE__ */ React20.createElement(HugeiconsIcon14, { icon: UserIcon, size: 40, className: "text-neutral-300" }), onAvatarTap && /* @__PURE__ */ React20.createElement("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-[1px] flex items-center justify-center opacity-80 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity duration-200 z-20" }, /* @__PURE__ */ React20.createElement(HugeiconsIcon14, { icon: Camera01Icon, size: 24, className: "text-white" })))
|
|
2273
|
+
), /* @__PURE__ */ React20.createElement("div", { className: "bg-white rounded-full px-4 py-2 flex items-center justify-center gap-2 mb-3" }, /* @__PURE__ */ React20.createElement("span", { className: "text-[12px] text-black" }, roleName), /* @__PURE__ */ React20.createElement("span", { className: getBadgeColorClass(roleName), "aria-hidden": true }, /* @__PURE__ */ React20.createElement("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React20.createElement("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), /* @__PURE__ */ React20.createElement("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React20.createElement("g", { id: "SVGRepo_iconCarrier" }, " ", /* @__PURE__ */ React20.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5924 3.20027C9.34888 3.4078 9.22711 3.51158 9.09706 3.59874C8.79896 3.79854 8.46417 3.93721 8.1121 4.00672C7.95851 4.03705 7.79903 4.04977 7.48008 4.07522C6.6787 4.13918 6.278 4.17115 5.94371 4.28923C5.17051 4.56233 4.56233 5.17051 4.28923 5.94371C4.17115 6.278 4.13918 6.6787 4.07522 7.48008C4.04977 7.79903 4.03705 7.95851 4.00672 8.1121C3.93721 8.46417 3.79854 8.79896 3.59874 9.09706C3.51158 9.22711 3.40781 9.34887 3.20027 9.5924C2.67883 10.2043 2.4181 10.5102 2.26522 10.8301C1.91159 11.57 1.91159 12.43 2.26522 13.1699C2.41811 13.4898 2.67883 13.7957 3.20027 14.4076C3.40778 14.6511 3.51158 14.7729 3.59874 14.9029C3.79854 15.201 3.93721 15.5358 4.00672 15.8879C4.03705 16.0415 4.04977 16.201 4.07522 16.5199C4.13918 17.3213 4.17115 17.722 4.28923 18.0563C4.56233 18.8295 5.17051 19.4377 5.94371 19.7108C6.278 19.8288 6.6787 19.8608 7.48008 19.9248C7.79903 19.9502 7.95851 19.963 8.1121 19.9933C8.46417 20.0628 8.79896 20.2015 9.09706 20.4013C9.22711 20.4884 9.34887 20.5922 9.5924 20.7997C10.2043 21.3212 10.5102 21.5819 10.8301 21.7348C11.57 22.0884 12.43 22.0884 13.1699 21.7348C13.4898 21.5819 13.7957 21.3212 14.4076 20.7997C14.6511 20.5922 14.7729 20.4884 14.9029 20.4013C15.201 20.2015 15.5358 20.0628 15.8879 19.9933C16.0415 19.963 16.201 19.9502 16.5199 19.9248C17.3213 19.8608 17.722 19.8288 18.0563 19.7108C18.8295 19.4377 19.4377 18.8295 19.7108 18.0563C19.8288 17.722 19.8608 17.3213 19.9248 16.5199C19.9502 16.201 19.963 16.0415 19.9933 15.8879C20.0628 15.5358 20.2015 15.201 20.4013 14.9029C20.4884 14.7729 20.5922 14.6511 20.7997 14.4076C21.3212 13.7957 21.5819 13.4898 21.7348 13.1699C22.0884 12.43 22.0884 11.57 21.7348 10.8301C21.5819 10.5102 21.3212 10.2043 20.7997 9.5924C20.5922 9.34887 20.4884 9.22711 20.4013 9.09706C20.2015 8.79896 20.0628 8.46417 19.9933 8.1121C19.963 7.95851 19.9502 7.79903 19.9248 7.48008C19.8608 6.6787 19.8288 6.278 19.7108 5.94371C19.4377 5.17051 18.8295 4.56233 18.0563 4.28923C17.722 4.17115 17.3213 4.13918 16.5199 4.07522C16.201 4.04977 16.0415 4.03705 15.8879 4.00672C15.5358 3.93721 15.201 3.79854 14.9029 3.59874C14.7729 3.51158 14.6511 3.40781 14.4076 3.20027C13.7957 2.67883 13.4898 2.41811 13.1699 2.26522C12.43 1.91159 11.57 1.91159 10.8301 2.26522C10.5102 2.4181 10.2043 2.67883 9.5924 3.20027ZM16.3735 9.86314C16.6913 9.5453 16.6913 9.03 16.3735 8.71216C16.0557 8.39433 15.5403 8.39433 15.2225 8.71216L10.3723 13.5624L8.77746 11.9676C8.45963 11.6498 7.94432 11.6498 7.62649 11.9676C7.30866 12.2854 7.30866 12.8007 7.62649 13.1186L9.79678 15.2889C10.1146 15.6067 10.6299 15.6067 10.9478 15.2889L16.3735 9.86314Z", fill: "currentColor" }), " ")))), /* @__PURE__ */ React20.createElement("span", { className: "text-[12px] text-neutral-500" }, memberSince)), /* @__PURE__ */ React20.createElement("div", { className: "w-full flex flex-col gap-4 mt-2" }, /* @__PURE__ */ React20.createElement("div", { className: "w-full bg-white rounded-2xl overflow-hidden" }, /* @__PURE__ */ React20.createElement(
|
|
2256
2274
|
MenuRow2,
|
|
2257
2275
|
{
|
|
2258
2276
|
icon: UserIcon,
|
|
@@ -2316,7 +2334,7 @@ var UniversalProfilePage = ({
|
|
|
2316
2334
|
icon: UserRemove01Icon,
|
|
2317
2335
|
title: "Delete Account",
|
|
2318
2336
|
subtitle: "Remove account",
|
|
2319
|
-
onClick:
|
|
2337
|
+
onClick: () => setShowDeleteDialog(true),
|
|
2320
2338
|
isLast: true
|
|
2321
2339
|
}
|
|
2322
2340
|
))), /* @__PURE__ */ React20.createElement(
|
|
@@ -2331,6 +2349,18 @@ var UniversalProfilePage = ({
|
|
|
2331
2349
|
onClose: () => setShowLogoutDialog(false),
|
|
2332
2350
|
onConfirm: handleConfirmLogout
|
|
2333
2351
|
}
|
|
2352
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2353
|
+
ConfirmationDialog,
|
|
2354
|
+
{
|
|
2355
|
+
isOpen: showDeleteDialog,
|
|
2356
|
+
title: "Delete Account",
|
|
2357
|
+
message: "Are you sure you want to delete your account? This action is permanent and cannot be undone.",
|
|
2358
|
+
confirmText: "Delete Account",
|
|
2359
|
+
isDestructive: true,
|
|
2360
|
+
isProcessing: isDeleting,
|
|
2361
|
+
onClose: () => setShowDeleteDialog(false),
|
|
2362
|
+
onConfirm: handleConfirmDelete
|
|
2363
|
+
}
|
|
2334
2364
|
));
|
|
2335
2365
|
};
|
|
2336
2366
|
var MenuRow2 = ({ icon, title, subtitle, onClick, iconColor = "text-black", titleColor = "text-black", isLast = false }) => /* @__PURE__ */ React20.createElement(
|
|
@@ -2340,7 +2370,7 @@ var MenuRow2 = ({ icon, title, subtitle, onClick, iconColor = "text-black", titl
|
|
|
2340
2370
|
className: `flex items-center p-4 cursor-pointer hover:bg-neutral-50 transition-colors ${!isLast ? "" : ""}`
|
|
2341
2371
|
},
|
|
2342
2372
|
/* @__PURE__ */ React20.createElement("div", { className: "w-9 h-9 rounded-full border border-neutral-200 flex items-center justify-center shrink-0 mr-4" }, /* @__PURE__ */ React20.createElement(HugeiconsIcon14, { icon, size: 16, className: iconColor })),
|
|
2343
|
-
/* @__PURE__ */ React20.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React20.createElement("p", { className: `text-[13px]
|
|
2373
|
+
/* @__PURE__ */ React20.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React20.createElement("p", { className: `text-[13px] truncate ${titleColor}` }, title), /* @__PURE__ */ React20.createElement("p", { className: "text-[11px] text-neutral-500 truncate" }, subtitle)),
|
|
2344
2374
|
/* @__PURE__ */ React20.createElement(HugeiconsIcon14, { icon: ArrowRight01Icon4, size: 18, className: "text-neutral-400 shrink-0 ml-2" })
|
|
2345
2375
|
);
|
|
2346
2376
|
|
|
@@ -3964,7 +3994,7 @@ var formatWeb3Name = (name) => {
|
|
|
3964
3994
|
var PageSpinner4 = () => /* @__PURE__ */ React41.createElement("div", { className: "flex justify-center items-center py-12 w-full" }, /* @__PURE__ */ React41.createElement(HugeiconsIcon27, { icon: Loading03Icon16, size: 32, className: "animate-spin mb-4 text-black" }));
|
|
3965
3995
|
var AvatarLogo = ({ src, alt, name, sizeClass = "w-12 h-12" }) => {
|
|
3966
3996
|
const [isLoaded, setIsLoaded] = useState26(false);
|
|
3967
|
-
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=
|
|
3997
|
+
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=ffffff&color=000000&size=200&font-size=0.33`;
|
|
3968
3998
|
const finalSrc = src || fallbackUrl;
|
|
3969
3999
|
return /* @__PURE__ */ React41.createElement("div", { className: `relative shrink-0 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden border-[3px] border-white ${sizeClass}` }, !isLoaded && /* @__PURE__ */ React41.createElement(HugeiconsIcon27, { icon: Loading03Icon16, size: 16, className: "animate-spin text-neutral-400 absolute" }), /* @__PURE__ */ React41.createElement("img", { src: finalSrc, alt, onLoad: () => setIsLoaded(true), className: `w-full h-full object-cover transition-opacity duration-300 ${isLoaded ? "opacity-100" : "opacity-0"}` }));
|
|
3970
4000
|
};
|
|
@@ -4101,7 +4131,7 @@ var UniversalReferralPage = ({
|
|
|
4101
4131
|
};
|
|
4102
4132
|
const AvatarLogo2 = ({ src, alt, name, sizeClass = "w-10 h-10" }) => {
|
|
4103
4133
|
const [isLoaded, setIsLoaded] = useState27(false);
|
|
4104
|
-
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=
|
|
4134
|
+
const fallbackUrl = `/api/avatar/?name=${encodeURIComponent(name || " ")}&background=e0e0e0&color=000000&size=200&font-size=0.33`;
|
|
4105
4135
|
const finalSrc = src || fallbackUrl;
|
|
4106
4136
|
return /* @__PURE__ */ React42.createElement("div", { className: `relative shrink-0 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden border-2 border-white ${sizeClass}` }, !isLoaded && /* @__PURE__ */ React42.createElement(HugeiconsIcon28, { icon: Loading03Icon17, size: 16, className: "animate-spin text-neutral-400 absolute" }), /* @__PURE__ */ React42.createElement("img", { src: finalSrc, alt, onLoad: () => setIsLoaded(true), className: `w-full h-full object-cover transition-opacity duration-300 ${isLoaded ? "opacity-100" : "opacity-0"}` }));
|
|
4107
4137
|
};
|