@microcosmmoney/portal-react 2.3.2 → 2.3.4
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.
|
@@ -1,39 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// AI-generated · AI-managed · AI-maintained
|
|
3
3
|
'use client';
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
-
var ownKeys = function(o) {
|
|
22
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
-
var ar = [];
|
|
24
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
-
return ar;
|
|
26
|
-
};
|
|
27
|
-
return ownKeys(o);
|
|
28
|
-
};
|
|
29
|
-
return function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
})();
|
|
37
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
5
|
exports.MicrocosmDashboardOverview = MicrocosmDashboardOverview;
|
|
39
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -41,15 +8,14 @@ const react_1 = require("react");
|
|
|
41
8
|
const market_overview_bar_1 = require("./market-overview-bar");
|
|
42
9
|
const quick_actions_1 = require("./quick-actions");
|
|
43
10
|
const assets_summary_1 = require("./assets-summary");
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const MicrocosmLockPeriods = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./lock-periods'))).then(m => ({ default: m.MicrocosmLockPeriods })));
|
|
11
|
+
const price_chart_1 = require("./price-chart");
|
|
12
|
+
const my_mining_1 = require("./my-mining");
|
|
13
|
+
const mining_weight_1 = require("./mining-weight");
|
|
14
|
+
const minting_stats_1 = require("./minting-stats");
|
|
15
|
+
const ecosystem_stats_1 = require("./ecosystem-stats");
|
|
16
|
+
const mcc_token_stats_1 = require("./mcc-token-stats");
|
|
17
|
+
const mcd_stats_1 = require("./mcd-stats");
|
|
18
|
+
const lock_periods_1 = require("./lock-periods");
|
|
53
19
|
class SafeRender extends react_1.Component {
|
|
54
20
|
constructor() {
|
|
55
21
|
super(...arguments);
|
|
@@ -62,9 +28,6 @@ class SafeRender extends react_1.Component {
|
|
|
62
28
|
function CardSkeleton({ height = 'h-48' }) {
|
|
63
29
|
return ((0, jsx_runtime_1.jsx)("div", { className: `bg-neutral-900 border border-neutral-700 rounded-lg ${height} animate-pulse`, children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6 space-y-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 bg-neutral-800 rounded w-24" }), (0, jsx_runtime_1.jsx)("div", { className: "h-6 bg-neutral-800 rounded w-40" }), (0, jsx_runtime_1.jsx)("div", { className: "h-4 bg-neutral-800 rounded w-32" })] }) }));
|
|
64
30
|
}
|
|
65
|
-
function ChartSkeleton() {
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg h-[420px] animate-pulse", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-6 bg-neutral-800 rounded w-8" }), (0, jsx_runtime_1.jsx)("div", { className: "h-6 bg-neutral-800 rounded w-8" }), (0, jsx_runtime_1.jsx)("div", { className: "h-6 bg-neutral-800 rounded w-10" })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-[340px] bg-neutral-800 rounded" })] }) }));
|
|
67
|
-
}
|
|
68
31
|
/** Renders children only when the container enters the viewport */
|
|
69
32
|
function LazySection({ children, fallback }) {
|
|
70
33
|
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
@@ -73,23 +36,19 @@ function LazySection({ children, fallback }) {
|
|
|
73
36
|
const el = ref.current;
|
|
74
37
|
if (!el)
|
|
75
38
|
return;
|
|
76
|
-
// If IntersectionObserver not supported, render immediately
|
|
77
39
|
if (typeof IntersectionObserver === 'undefined') {
|
|
78
40
|
setVisible(true);
|
|
79
41
|
return;
|
|
80
42
|
}
|
|
81
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
}, { rootMargin: '200px' } // Start loading 200px before entering viewport
|
|
87
|
-
);
|
|
43
|
+
const observer = new IntersectionObserver(([entry]) => { if (entry.isIntersecting) {
|
|
44
|
+
setVisible(true);
|
|
45
|
+
observer.disconnect();
|
|
46
|
+
} }, { rootMargin: '200px' });
|
|
88
47
|
observer.observe(el);
|
|
89
48
|
return () => observer.disconnect();
|
|
90
49
|
}, []);
|
|
91
|
-
return (
|
|
50
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: ref, children: visible ? children : fallback });
|
|
92
51
|
}
|
|
93
52
|
function MicrocosmDashboardOverview({ basePath = '', onNavigate, showHeader = true, headerText = 'SHARED NETWORK · SHARED FUTURE', }) {
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto font-mono p-6 space-y-6", children: [showHeader && ((0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h1", { className: "text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-cyan-200", children: headerText }) })), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(market_overview_bar_1.MicrocosmMarketBar, {}) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(quick_actions_1.MicrocosmQuickActions, { basePath: basePath, onNavigate: onNavigate }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(assets_summary_1.MicrocosmAssetsSummary, { basePath: basePath, onNavigate: onNavigate }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto font-mono p-6 space-y-6", children: [showHeader && ((0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h1", { className: "text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-cyan-200", children: headerText }) })), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(market_overview_bar_1.MicrocosmMarketBar, {}) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(quick_actions_1.MicrocosmQuickActions, { basePath: basePath, onNavigate: onNavigate }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(assets_summary_1.MicrocosmAssetsSummary, { basePath: basePath, onNavigate: onNavigate }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(price_chart_1.MicrocosmPriceChart, {}) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" }), (0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" })] }), children: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(my_mining_1.MicrocosmMyMining, { detailsPath: `${basePath}/mcc/mining`, onNavigate: onNavigate }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(mining_weight_1.MicrocosmMiningWeight, {}) })] }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" }), (0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" })] }), children: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(minting_stats_1.MicrocosmMintingStats, {}) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(ecosystem_stats_1.MicrocosmEcosystemStats, {}) })] }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(CardSkeleton, {}), (0, jsx_runtime_1.jsx)(CardSkeleton, {})] }), children: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(mcc_token_stats_1.MicrocosmMCCTokenStats, {}) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(mcd_stats_1.MicrocosmMCDStats, {}) })] }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsx)(CardSkeleton, {}), children: (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(lock_periods_1.MicrocosmLockPeriods, {}) }) })] }));
|
|
95
54
|
}
|
|
@@ -36,5 +36,5 @@ function MicrocosmMarketBar() {
|
|
|
36
36
|
{ label: '24H_TRADES', value: `${trades}`, color: 'text-cyan-400' },
|
|
37
37
|
{ label: 'BUY/SELL', value: `${buys}/${sells}`, color: 'text-white' },
|
|
38
38
|
];
|
|
39
|
-
return ((0, jsx_runtime_1.
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 mb-6", children: [stats.map((stat) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-4 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-[10px] font-mono mb-1 tracking-wider", children: stat.label }), (0, jsx_runtime_1.jsx)("div", { className: `text-xl font-bold font-mono ${stat.color}`, children: stat.value }), stat.sub && ((0, jsx_runtime_1.jsx)("div", { className: `text-xs font-mono mt-0.5 ${stat.subColor || 'text-neutral-500'}`, children: stat.sub }))] }, stat.label))), (0, jsx_runtime_1.jsx)("div", { className: "col-span-full text-[10px] text-neutral-600 font-mono text-right mt-1", children: "Data refreshes every 4h \u00B7 For real-time data, check on-chain directly" })] }));
|
|
40
40
|
}
|