@microcosmmoney/portal-react 3.13.2 → 3.13.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.
package/dist/index.d.ts
CHANGED
|
@@ -120,3 +120,9 @@ export { default as MainPortalMCCTokenStatsCard } from './main-portal/components
|
|
|
120
120
|
export { default as MainPortalMCDStatsCard } from './main-portal/components/dashboard/MCDStatsCard';
|
|
121
121
|
export { default as MainPortalLockPeriodsCard } from './main-portal/components/dashboard/LockPeriodsCard';
|
|
122
122
|
export { WaveText } from './main-portal/components/mainnet/wave-text';
|
|
123
|
+
export { WalletProvider, useWallet } from './main-portal/contexts/WalletContext';
|
|
124
|
+
export { MCCPriceProvider, useMCCPrice } from './main-portal/contexts/MCCPriceContext';
|
|
125
|
+
export { useAuth as useMainPortalAuth } from './main-portal/hooks/useAuth';
|
|
126
|
+
export { useMCC as useMainPortalMCC } from './main-portal/hooks/useMCC';
|
|
127
|
+
export { useMCD as useMainPortalMCD } from './main-portal/hooks/useMCD';
|
|
128
|
+
export { useUserRank as useMainPortalUserRank } from './main-portal/hooks/useUserRank';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MicrocosmMiningPage = exports.MicrocosmWalletPage = exports.MicrocosmLendingPage = exports.MicrocosmFragmentPage = exports.MicrocosmLockPeriods = exports.MicrocosmMCDStats = exports.MicrocosmMCCTokenStats = exports.MicrocosmEcosystemStats = exports.MicrocosmMyMining = exports.MicrocosmMiningWeight = exports.MicrocosmMintingStats = exports.MicrocosmPriceChart = exports.MicrocosmAssetsSummary = exports.MicrocosmQuickActions = exports.MicrocosmMarketBar = exports.MicrocosmDashboardOverview = exports.KPIRadialChart = exports.VoteResultBar = exports.MiningProgressBar = exports.TerritoryCard = exports.TerminalTooltip = exports.TerminalInput = exports.TerminalCountdown = exports.TerminalDialog = exports.TerminalTabs = exports.TerminalTable = exports.TerminalProgress = exports.TerminalDataRow = exports.TerminalBadge = exports.TerminalEmpty = exports.TerminalError = exports.TerminalLoading = exports.TerminalPageHeader = exports.TerminalCommand = exports.StatBox = exports.TerminalCard = exports.getMenuDescription = exports.getMenuTitle = exports.resolveMenuPath = exports.getAllMenuItems = exports.microcosmMenuGroups = exports.dashboardMenu = exports.web3OsMenu = exports.blockchainMenu = exports.useT = exports.useTranslations = exports.MicrocosmI18nProvider = exports.useLinkComponent = exports.LinkProvider = exports.MicrocosmMenuSection = void 0;
|
|
7
|
-
exports.WaveText = exports.MainPortalLockPeriodsCard = exports.MainPortalMCDStatsCard = exports.MainPortalMCCTokenStatsCard = exports.MainPortalEcosystemStatsCard = exports.MainPortalMintingStatsCard = exports.MainPortalMiningWeightCard = exports.MainPortalMyMiningCard = exports.MainPortalMCCPriceChart = exports.MainPortalMyAssetsSummary = exports.MainPortalQuickActions = exports.MainPortalMarketOverviewBar = exports.MainPortalUserDashboardPage = exports.MainPortalMessagesPage = exports.MainPortalNotificationsPage = exports.MainPortalRewardsPage = exports.MainPortalQueueStatusPage = exports.MainPortalManagerIncomePage = exports.MainPortalProfilePage = exports.MainPortalStationsPage = exports.MainPortalStationDetailPage = exports.MainPortalStationListPage = exports.MainPortalTerritoryNFTBrowser = exports.MainPortalOrganizationPage = exports.MainPortalReincarnationPage = exports.MainPortalVotingPage = exports.MainPortalLendingPage = exports.MainPortalFragmentPage = exports.MainPortalAuctionsPage = exports.MainPortalMCDPage = exports.MainPortalMCCHistory = exports.MainPortalWalletManagement = exports.MainPortalWalletPage = exports.MainPortalMiningModal = exports.MainPortalMiningPage = exports.MicrocosmTwoFactorSettings = exports.MicrocosmEmailChangeCard = exports.MicrocosmProfilePage = exports.MicrocosmRewardsPage = exports.MicrocosmStationListPage = exports.MicrocosmQueueStatusPage = exports.MicrocosmManagerIncomePage = exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = void 0;
|
|
7
|
+
exports.useWallet = exports.WalletProvider = exports.WaveText = exports.MainPortalLockPeriodsCard = exports.MainPortalMCDStatsCard = exports.MainPortalMCCTokenStatsCard = exports.MainPortalEcosystemStatsCard = exports.MainPortalMintingStatsCard = exports.MainPortalMiningWeightCard = exports.MainPortalMyMiningCard = exports.MainPortalMCCPriceChart = exports.MainPortalMyAssetsSummary = exports.MainPortalQuickActions = exports.MainPortalMarketOverviewBar = exports.MainPortalUserDashboardPage = exports.MainPortalMessagesPage = exports.MainPortalNotificationsPage = exports.MainPortalRewardsPage = exports.MainPortalQueueStatusPage = exports.MainPortalManagerIncomePage = exports.MainPortalProfilePage = exports.MainPortalStationsPage = exports.MainPortalStationDetailPage = exports.MainPortalStationListPage = exports.MainPortalTerritoryNFTBrowser = exports.MainPortalOrganizationPage = exports.MainPortalReincarnationPage = exports.MainPortalVotingPage = exports.MainPortalLendingPage = exports.MainPortalFragmentPage = exports.MainPortalAuctionsPage = exports.MainPortalMCDPage = exports.MainPortalMCCHistory = exports.MainPortalWalletManagement = exports.MainPortalWalletPage = exports.MainPortalMiningModal = exports.MainPortalMiningPage = exports.MicrocosmTwoFactorSettings = exports.MicrocosmEmailChangeCard = exports.MicrocosmProfilePage = exports.MicrocosmRewardsPage = exports.MicrocosmStationListPage = exports.MicrocosmQueueStatusPage = exports.MicrocosmManagerIncomePage = exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = void 0;
|
|
8
|
+
exports.useMainPortalUserRank = exports.useMainPortalMCD = exports.useMainPortalMCC = exports.useMainPortalAuth = exports.useMCCPrice = exports.MCCPriceProvider = void 0;
|
|
8
9
|
var menu_section_1 = require("./components/menu-section");
|
|
9
10
|
Object.defineProperty(exports, "MicrocosmMenuSection", { enumerable: true, get: function () { return menu_section_1.MicrocosmMenuSection; } });
|
|
10
11
|
var link_context_1 = require("./link-context");
|
|
@@ -182,3 +183,17 @@ var LockPeriodsCard_1 = require("./main-portal/components/dashboard/LockPeriodsC
|
|
|
182
183
|
Object.defineProperty(exports, "MainPortalLockPeriodsCard", { enumerable: true, get: function () { return __importDefault(LockPeriodsCard_1).default; } });
|
|
183
184
|
var wave_text_1 = require("./main-portal/components/mainnet/wave-text");
|
|
184
185
|
Object.defineProperty(exports, "WaveText", { enumerable: true, get: function () { return wave_text_1.WaveText; } });
|
|
186
|
+
var WalletContext_1 = require("./main-portal/contexts/WalletContext");
|
|
187
|
+
Object.defineProperty(exports, "WalletProvider", { enumerable: true, get: function () { return WalletContext_1.WalletProvider; } });
|
|
188
|
+
Object.defineProperty(exports, "useWallet", { enumerable: true, get: function () { return WalletContext_1.useWallet; } });
|
|
189
|
+
var MCCPriceContext_1 = require("./main-portal/contexts/MCCPriceContext");
|
|
190
|
+
Object.defineProperty(exports, "MCCPriceProvider", { enumerable: true, get: function () { return MCCPriceContext_1.MCCPriceProvider; } });
|
|
191
|
+
Object.defineProperty(exports, "useMCCPrice", { enumerable: true, get: function () { return MCCPriceContext_1.useMCCPrice; } });
|
|
192
|
+
var useAuth_1 = require("./main-portal/hooks/useAuth");
|
|
193
|
+
Object.defineProperty(exports, "useMainPortalAuth", { enumerable: true, get: function () { return useAuth_1.useAuth; } });
|
|
194
|
+
var useMCC_1 = require("./main-portal/hooks/useMCC");
|
|
195
|
+
Object.defineProperty(exports, "useMainPortalMCC", { enumerable: true, get: function () { return useMCC_1.useMCC; } });
|
|
196
|
+
var useMCD_1 = require("./main-portal/hooks/useMCD");
|
|
197
|
+
Object.defineProperty(exports, "useMainPortalMCD", { enumerable: true, get: function () { return useMCD_1.useMCD; } });
|
|
198
|
+
var useUserRank_1 = require("./main-portal/hooks/useUserRank");
|
|
199
|
+
Object.defineProperty(exports, "useMainPortalUserRank", { enumerable: true, get: function () { return useUserRank_1.useUserRank; } });
|
|
@@ -59,6 +59,9 @@ const time_remaining_1 = require("../ui/time-remaining");
|
|
|
59
59
|
const next_intl_1 = require("next-intl");
|
|
60
60
|
const MCCPriceContext_1 = require("../../contexts/MCCPriceContext");
|
|
61
61
|
const PriceChart_1 = require("../data/charts/PriceChart");
|
|
62
|
+
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
63
|
+
const tooltip_1 = require("../ui/tooltip");
|
|
64
|
+
const lucide_react_2 = require("lucide-react");
|
|
62
65
|
const formatNumber = (num, decimals = 2) => {
|
|
63
66
|
const parsedNum = parseFloat(String(num));
|
|
64
67
|
return isNaN(parsedNum) ? "0.00" : parsedNum.toFixed(decimals);
|
|
@@ -72,6 +75,8 @@ function MCCMiningPage() {
|
|
|
72
75
|
const t = (0, next_intl_1.useTranslations)('miningDash');
|
|
73
76
|
const router = (0, navigation_1.useRouter)();
|
|
74
77
|
const ticker = (0, MCCPriceContext_1.useMCCPrice)();
|
|
78
|
+
const techBonusDetail = (0, auth_react_1.useTechBonusDetail)();
|
|
79
|
+
const totalBonus = Number(techBonusDetail.data?.total_bonus ?? 0);
|
|
75
80
|
const [userDetails, setUserDetails] = (0, react_1.useState)(null);
|
|
76
81
|
const [showMiningModal, setShowMiningModal] = (0, react_1.useState)(false);
|
|
77
82
|
const [ratioInfo, setRatioInfo] = (0, react_1.useState)(null);
|
|
@@ -216,7 +221,7 @@ function MCCMiningPage() {
|
|
|
216
221
|
if (isLoading) {
|
|
217
222
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-12", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-6 h-6 animate-spin text-neutral-400 mr-3" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingMintData') })] })] }));
|
|
218
223
|
}
|
|
219
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: refreshAll, disabled: ratioLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", ratioLoading && "animate-spin") }), t('refresh')] })] }), !connected && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col xs:flex-row items-start xs:items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-5 h-5 text-neutral-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-medium text-white", children: t('connectWalletFirst') }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500", children: t('connectWalletDesc') })] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: '#0e7490' }, className: "!h-9 !rounded-md !text-sm !text-white" })] }) }) })), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2 bg-neutral-800 rounded-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-400", children: [t('connected'), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono", children: [publicKey?.toBase58().slice(0, 8), "...", publicKey?.toBase58().slice(-6)] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: 'transparent' }, className: "!h-7 !rounded !text-xs !text-neutral-400 !px-2 !py-0 !border !border-neutral-700 ml-auto" })] })), ratioError && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-red-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: ratioError })] }) }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col md:flex-row md:items-center md:justify-between gap-3 sm:gap-6 mb-4 sm:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 sm:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 flex-wrap", children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent text-[10px] sm:text-xs", children: t('x402Protocol') }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-xs", children: "Solana Mainnet" })] }), (ticker.basePrice || ratioInfo) && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1", children: t('mintPrice') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-xl sm:text-3xl font-bold text-white font-mono", children: ["1 MCC \u2248 ", formatNumber((ticker.basePrice ?? ratioInfo?.usdc_per_mcc ?? 0) * 4, 4), " USD"] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-sm", children: t('techBonus') })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 sm:gap-4 text-[10px] sm:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('stablecoinDirectDesc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('instantMintDesc') })] })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowMiningModal(true), size: "lg", className: "px-6 py-3 sm:px-8 sm:py-4 text-sm sm:text-base font-medium bg-cyan-700 hover:bg-cyan-600 text-white whitespace-nowrap flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4 sm:w-5 sm:h-5 mr-2" }), t('startMinting')] })] }), ratioInfo && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700 pt-3 sm:pt-4 mb-3 sm:mb-4", children: (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider uppercase mb-2 sm:mb-3", children: t('mintStats') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('basePrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", formatNumber(ticker.basePrice ?? ratioInfo.usdc_per_mcc, 4)] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('basePriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('marketPrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", ticker.price ? formatNumber(ticker.price, 4) : '...'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('marketPriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('totalMinted') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono truncate", children: formatLargeNumber(ratioInfo.total_minted) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('totalMintedNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('currentPhase') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["Phase ", ratioInfo.current_stage] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('phaseNote') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('halvingRemaining', { amount: formatLargeNumber(100000000 - (ratioInfo.total_minted % 100000000), 0) }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-2 rounded-full bg-cyan-400 transition-all", style: { width: `${((ratioInfo.total_minted % 100000000) / 100000000) * 100}%` } }) })] })] }))] }) }), (0, jsx_runtime_1.jsx)(PriceChart_1.PriceChart, {}), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3 gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs sm:text-sm text-neutral-300 tracking-wider font-medium", children: t('onChainBalance') }), walletBalances.length > 0 && walletBalances.every(w => !w.loading) && ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-3 h-3 mr-1 inline" }), walletBalances.length, " ", t('walletsCount')] }))] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: loadWalletBalances, disabled: walletsLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", walletsLoading && "animate-spin") }), t('refresh')] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mb-4", children: t('onChainBalanceDesc') }), walletsLoading && walletBalances.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-neutral-400 mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingOnChainBalance') })] })) : walletBalances.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500 text-sm", children: t('noWalletBound') })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 xs:grid-cols-2 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1 font-mono", children: t('totalOnChainBalance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: walletBalances.some(w => w.loading)
|
|
224
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: refreshAll, disabled: ratioLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", ratioLoading && "animate-spin") }), t('refresh')] })] }), !connected && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col xs:flex-row items-start xs:items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-5 h-5 text-neutral-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-medium text-white", children: t('connectWalletFirst') }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500", children: t('connectWalletDesc') })] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: '#0e7490' }, className: "!h-9 !rounded-md !text-sm !text-white" })] }) }) })), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2 bg-neutral-800 rounded-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-400", children: [t('connected'), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono", children: [publicKey?.toBase58().slice(0, 8), "...", publicKey?.toBase58().slice(-6)] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: 'transparent' }, className: "!h-7 !rounded !text-xs !text-neutral-400 !px-2 !py-0 !border !border-neutral-700 ml-auto" })] })), ratioError && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-red-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: ratioError })] }) }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col md:flex-row md:items-center md:justify-between gap-3 sm:gap-6 mb-4 sm:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 sm:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 flex-wrap", children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent text-[10px] sm:text-xs", children: t('x402Protocol') }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-xs", children: "Solana Mainnet" })] }), (ticker.basePrice || ratioInfo) && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1", children: t('mintPrice') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-xl sm:text-3xl font-bold text-white font-mono", children: ["1 MCC \u2248 ", formatNumber((ticker.basePrice ?? ratioInfo?.usdc_per_mcc ?? 0) * 4, 4), " USD"] }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { delayDuration: 100, children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-sm cursor-help inline-flex items-center gap-1", children: ["+", totalBonus, "% ", t('techBonus'), (0, jsx_runtime_1.jsx)(lucide_react_2.HelpCircle, { className: "w-3 h-3" })] }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { className: "max-w-xs text-xs leading-relaxed", children: t('techBonusTooltip') })] }) })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 sm:gap-4 text-[10px] sm:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('stablecoinDirectDesc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('instantMintDesc') })] })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowMiningModal(true), size: "lg", className: "px-6 py-3 sm:px-8 sm:py-4 text-sm sm:text-base font-medium bg-cyan-700 hover:bg-cyan-600 text-white whitespace-nowrap flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4 sm:w-5 sm:h-5 mr-2" }), t('startMinting')] })] }), ratioInfo && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700 pt-3 sm:pt-4 mb-3 sm:mb-4", children: (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider uppercase mb-2 sm:mb-3", children: t('mintStats') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('basePrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", formatNumber(ticker.basePrice ?? ratioInfo.usdc_per_mcc, 4)] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('basePriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('marketPrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", ticker.price ? formatNumber(ticker.price, 4) : '...'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('marketPriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('totalMinted') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono truncate", children: formatLargeNumber(ratioInfo.total_minted) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('totalMintedNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('currentPhase') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["Phase ", ratioInfo.current_stage] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('phaseNote') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('halvingRemaining', { amount: formatLargeNumber(100000000 - (ratioInfo.total_minted % 100000000), 0) }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-2 rounded-full bg-cyan-400 transition-all", style: { width: `${((ratioInfo.total_minted % 100000000) / 100000000) * 100}%` } }) })] })] }))] }) }), (0, jsx_runtime_1.jsx)(PriceChart_1.PriceChart, {}), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3 gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs sm:text-sm text-neutral-300 tracking-wider font-medium", children: t('onChainBalance') }), walletBalances.length > 0 && walletBalances.every(w => !w.loading) && ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-3 h-3 mr-1 inline" }), walletBalances.length, " ", t('walletsCount')] }))] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: loadWalletBalances, disabled: walletsLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", walletsLoading && "animate-spin") }), t('refresh')] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mb-4", children: t('onChainBalanceDesc') }), walletsLoading && walletBalances.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-neutral-400 mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingOnChainBalance') })] })) : walletBalances.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500 text-sm", children: t('noWalletBound') })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 xs:grid-cols-2 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1 font-mono", children: t('totalOnChainBalance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: walletBalances.some(w => w.loading)
|
|
220
225
|
? (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin" })
|
|
221
226
|
: formatLargeNumber(walletBalances.reduce((sum, w) => sum + w.mcc_balance, 0)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 text-xs mt-1", children: ["MCC \u00B7 ", walletBalances.length, " ", t('walletsTotal')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1 font-mono", children: t('primaryWalletBalance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: (() => {
|
|
222
227
|
const primary = walletBalances.find(w => w.is_primary);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microcosmmoney/portal-react",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.4",
|
|
4
4
|
"description": "Microcosm Portal UI components for React/Next.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"next-intl": ">=3.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@microcosmmoney/auth-core": "^2.3.
|
|
22
|
-
"@microcosmmoney/auth-react": "^2.6.
|
|
21
|
+
"@microcosmmoney/auth-core": "^2.3.4",
|
|
22
|
+
"@microcosmmoney/auth-react": "^2.6.2",
|
|
23
23
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
24
24
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
25
25
|
"@radix-ui/react-aspect-ratio": "^1.1.7",
|