@medialane/ui 0.202.0 → 0.204.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/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/activity-row.cjs +2 -1
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.js +2 -1
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/collection-name-claim.cjs +100 -0
- package/dist/components/collection-name-claim.cjs.map +1 -0
- package/dist/components/collection-name-claim.d.cts +5 -0
- package/dist/components/collection-name-claim.d.ts +5 -0
- package/dist/components/collection-name-claim.js +66 -0
- package/dist/components/collection-name-claim.js.map +1 -0
- package/dist/components/creators-page.cjs +218 -0
- package/dist/components/creators-page.cjs.map +1 -0
- package/dist/components/creators-page.d.cts +5 -0
- package/dist/components/creators-page.d.ts +5 -0
- package/dist/components/creators-page.js +184 -0
- package/dist/components/creators-page.js.map +1 -0
- package/dist/components/discover-community-section.cjs +171 -0
- package/dist/components/discover-community-section.cjs.map +1 -0
- package/dist/components/discover-community-section.d.cts +5 -0
- package/dist/components/discover-community-section.d.ts +5 -0
- package/dist/components/discover-community-section.js +137 -0
- package/dist/components/discover-community-section.js.map +1 -0
- package/dist/components/discover-page.cjs +96 -0
- package/dist/components/discover-page.cjs.map +1 -0
- package/dist/components/discover-page.d.cts +14 -0
- package/dist/components/discover-page.d.ts +14 -0
- package/dist/components/discover-page.js +72 -0
- package/dist/components/discover-page.js.map +1 -0
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/home-page.cjs +124 -0
- package/dist/components/home-page.cjs.map +1 -0
- package/dist/components/home-page.d.cts +13 -0
- package/dist/components/home-page.d.ts +13 -0
- package/dist/components/home-page.js +90 -0
- package/dist/components/home-page.js.map +1 -0
- package/dist/components/ip-type-nav.cjs +74 -0
- package/dist/components/ip-type-nav.cjs.map +1 -0
- package/dist/components/ip-type-nav.d.cts +5 -0
- package/dist/components/ip-type-nav.d.ts +5 -0
- package/dist/components/ip-type-nav.js +40 -0
- package/dist/components/ip-type-nav.js.map +1 -0
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +1 -0
- package/dist/components/medialane-app.d.ts +1 -0
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +114 -0
- package/dist/components/portfolio-assets.cjs.map +1 -0
- package/dist/components/portfolio-assets.d.cts +19 -0
- package/dist/components/portfolio-assets.d.ts +19 -0
- package/dist/components/portfolio-assets.js +90 -0
- package/dist/components/portfolio-assets.js.map +1 -0
- package/dist/components/portfolio-orders.cjs +205 -0
- package/dist/components/portfolio-orders.cjs.map +1 -0
- package/dist/components/portfolio-orders.d.cts +23 -0
- package/dist/components/portfolio-orders.d.ts +23 -0
- package/dist/components/portfolio-orders.js +171 -0
- package/dist/components/portfolio-orders.js.map +1 -0
- package/dist/components/portfolio-shell.cjs +106 -0
- package/dist/components/portfolio-shell.cjs.map +1 -0
- package/dist/components/portfolio-shell.d.cts +18 -0
- package/dist/components/portfolio-shell.d.ts +18 -0
- package/dist/components/portfolio-shell.js +81 -0
- package/dist/components/portfolio-shell.js.map +1 -0
- package/dist/components/rewards/leaderboard-panel.cjs +107 -0
- package/dist/components/rewards/leaderboard-panel.cjs.map +1 -0
- package/dist/components/rewards/leaderboard-panel.d.cts +12 -0
- package/dist/components/rewards/leaderboard-panel.d.ts +12 -0
- package/dist/components/rewards/leaderboard-panel.js +73 -0
- package/dist/components/rewards/leaderboard-panel.js.map +1 -0
- package/dist/components/rewards/rewards-dashboard.cjs +341 -0
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -0
- package/dist/components/rewards/rewards-dashboard.d.cts +6 -0
- package/dist/components/rewards/rewards-dashboard.d.ts +6 -0
- package/dist/components/rewards/rewards-dashboard.js +331 -0
- package/dist/components/rewards/rewards-dashboard.js.map +1 -0
- package/dist/components/router.cjs +2 -0
- package/dist/components/router.cjs.map +1 -1
- package/dist/components/router.d.cts +1 -1
- package/dist/components/router.d.ts +1 -1
- package/dist/components/router.js +2 -1
- package/dist/components/router.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +45 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/order-usd.cjs +35 -0
- package/dist/utils/order-usd.cjs.map +1 -0
- package/dist/utils/order-usd.d.cts +8 -0
- package/dist/utils/order-usd.d.ts +8 -0
- package/dist/utils/order-usd.js +11 -0
- package/dist/utils/order-usd.js.map +1 -0
- package/dist/utils/portfolio-counts.cjs +8 -2
- package/dist/utils/portfolio-counts.cjs.map +1 -1
- package/dist/utils/portfolio-counts.d.cts +9 -3
- package/dist/utils/portfolio-counts.d.ts +9 -3
- package/dist/utils/portfolio-counts.js +8 -2
- package/dist/utils/portfolio-counts.js.map +1 -1
- package/dist/utils/seen-offers.cjs +52 -0
- package/dist/utils/seen-offers.cjs.map +1 -0
- package/dist/utils/seen-offers.d.cts +4 -0
- package/dist/utils/seen-offers.d.ts +4 -0
- package/dist/utils/seen-offers.js +27 -0
- package/dist/utils/seen-offers.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var home_page_exports = {};
|
|
31
|
+
__export(home_page_exports, {
|
|
32
|
+
HomePage: () => HomePage
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(home_page_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_sdk = require("@medialane/sdk");
|
|
37
|
+
var import_lucide_react = require("lucide-react");
|
|
38
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
39
|
+
var import_page_container = require("./page-container.js");
|
|
40
|
+
var import_hero_slider = require("./hero-slider.js");
|
|
41
|
+
var import_activity_ticker = require("./activity-ticker.js");
|
|
42
|
+
var import_scroll_section = require("./scroll-section.js");
|
|
43
|
+
var import_listing_card = require("./listing-card.js");
|
|
44
|
+
var import_listing_card_menu = require("./listing-card-menu.js");
|
|
45
|
+
var import_collection_card = require("./collection-card.js");
|
|
46
|
+
var import_rewards_section = require("./rewards-section.js");
|
|
47
|
+
var import_launchpad_strip = require("./launchpad-strip.js");
|
|
48
|
+
var import_medialane_app = require("./medialane-app.js");
|
|
49
|
+
var import_use_orders = require("../utils/use-orders.js");
|
|
50
|
+
var import_use_collections = require("../utils/use-collections.js");
|
|
51
|
+
var import_use_usd_prices = require("../utils/use-usd-prices.js");
|
|
52
|
+
var import_order_usd = require("../utils/order-usd.js");
|
|
53
|
+
var import_same_address = require("../utils/same-address.js");
|
|
54
|
+
const LAUNCHPAD_HREFS = {
|
|
55
|
+
nfts: "/launchpad/single-editions",
|
|
56
|
+
"limited-editions": "/launchpad/nfteditions",
|
|
57
|
+
"collection-drop": "/launchpad/drop",
|
|
58
|
+
"pop-protocol": "/launchpad/pop",
|
|
59
|
+
"ip-tickets": "/launchpad/tickets",
|
|
60
|
+
"creator-coins": "/launchpad/coin/create"
|
|
61
|
+
};
|
|
62
|
+
function NewListings({ market }) {
|
|
63
|
+
const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
|
|
64
|
+
const { orders, isLoading } = (0, import_use_orders.useOrders)({ status: "ACTIVE", limit: 10, page: 1 });
|
|
65
|
+
const prices = (0, import_use_usd_prices.useUsdPrices)();
|
|
66
|
+
const listings = orders.filter((o) => o.offer.itemType === "ERC721" || o.offer.itemType === "ERC1155").slice(0, 10);
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_scroll_section.ScrollSection,
|
|
69
|
+
{
|
|
70
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-3.5 w-3.5 text-white" }),
|
|
71
|
+
iconBg: "bg-gradient-to-br from-brand-rose to-brand-rose shadow-md shadow-brand-rose/20",
|
|
72
|
+
title: "New listings",
|
|
73
|
+
href: "/marketplace",
|
|
74
|
+
linkLabel: "Marketplace",
|
|
75
|
+
children: isLoading ? Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-72 shrink-0 snap-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_listing_card.ListingCardSkeleton, {}) }, i)) : listings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "py-4 text-sm text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/launchpad/single-editions", className: "text-primary hover:underline", children: "List the first asset" }) }) : listings.map((order) => {
|
|
76
|
+
const own = !!walletAddress && (0, import_same_address.isSameAddress)(order.offerer, walletAddress);
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-72 shrink-0 snap-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
+
import_listing_card.ListingCard,
|
|
79
|
+
{
|
|
80
|
+
order,
|
|
81
|
+
onBuy: own ? void 0 : () => market.buy(order),
|
|
82
|
+
overflowMenu: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_listing_card_menu.ListingCardMenu, { order }),
|
|
83
|
+
usdValue: (0, import_order_usd.orderUsd)(order.price, prices)
|
|
84
|
+
}
|
|
85
|
+
) }, order.orderHash);
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function CollectionsStrip() {
|
|
91
|
+
const { collections, isLoading } = (0, import_use_collections.useCollections)(1, 10, void 0, "recent");
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
import_scroll_section.ScrollSection,
|
|
94
|
+
{
|
|
95
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TrendingUp, { className: "h-3.5 w-3.5 text-white" }),
|
|
96
|
+
iconBg: "bg-gradient-to-br from-brand-purple to-brand-maeve shadow-md shadow-brand-purple/20",
|
|
97
|
+
title: "Collections",
|
|
98
|
+
href: "/collections",
|
|
99
|
+
linkLabel: "See all",
|
|
100
|
+
children: isLoading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collection_card.CollectionCardSkeleton, {}) }, i)) : collections.map((col) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-64 shrink-0 snap-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collection_card.CollectionCard, { collection: col }) }, col.contractAddress))
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function HomePage({ useMarketActions, initialFeatured }) {
|
|
105
|
+
const market = useMarketActions();
|
|
106
|
+
const { collections: featured, isLoading: featuredLoading } = (0, import_use_collections.useCollections)(1, 3, true, "recent", true, void 0, void 0, initialFeatured);
|
|
107
|
+
const { orders: tickerOrders } = (0, import_use_orders.useOrders)({ status: "ACTIVE", sort: "recent", limit: 14 });
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pb-20", children: [
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_hero_slider.HeroSlider, { collections: featured, isLoading: featuredLoading, getHref: (c) => (0, import_sdk.collectionHref)("STARKNET", c.contractAddress) }),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_page_container.PageContainer, { className: "box-border max-w-full pt-6 pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_ticker.ActivityTicker, { orders: tickerOrders, minItems: 3, getHref: (o) => (0, import_sdk.assetHref)("STARKNET", o.nftContract, o.nftTokenId) }) }),
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { className: "mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20", children: [
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NewListings, { market }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollectionsStrip, {}),
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_rewards_section.RewardsSection, { rewardsHref: "/rewards" }),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_launchpad_strip.LaunchpadStrip, { hrefs: LAUNCHPAD_HREFS, marketplaceHref: "/marketplace", launchpadHref: "/launchpad" })
|
|
116
|
+
] }),
|
|
117
|
+
market.dialogs
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
HomePage
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=home-page.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection } from \"@medialane/sdk\";\nimport { Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { HeroSlider } from \"./hero-slider.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders({ status: \"ACTIVE\", limit: 10, page: 1 });\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n return (\n <ScrollSection\n icon={<Tag className=\"h-3.5 w-3.5 text-white\" />}\n iconBg=\"bg-gradient-to-br from-brand-rose to-brand-rose shadow-md shadow-brand-rose/20\"\n title=\"New listings\"\n href=\"/marketplace\"\n linkLabel=\"Marketplace\"\n >\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-72 shrink-0 snap-start\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? (\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">List the first asset</Link>\n </p>\n )\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-72 shrink-0 snap-start\">\n <ListingCard\n order={order}\n onBuy={own ? undefined : () => market.buy(order)}\n overflowMenu={<ListingCardMenu order={order} />}\n usdValue={orderUsd(order.price, prices)}\n />\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-3.5 w-3.5 text-white\" />}\n iconBg=\"bg-gradient-to-br from-brand-purple to-brand-maeve shadow-md shadow-brand-purple/20\"\n title=\"Collections\"\n href=\"/collections\"\n linkLabel=\"See all\"\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><CollectionCardSkeleton /></div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-64 shrink-0 snap-start\"><CollectionCard collection={col} /></div>\n ))}\n </ScrollSection>\n );\n}\n\nexport interface HomePageProps {\n useMarketActions: () => CollectionMarketActions;\n initialFeatured?: ApiCollection[];\n}\n\nexport function HomePage({ useMarketActions, initialFeatured }: HomePageProps) {\n const market = useMarketActions();\n const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, \"recent\", true, undefined, undefined, initialFeatured);\n const { orders: tickerOrders } = useOrders({ status: \"ACTIVE\", sort: \"recent\", limit: 14 });\n return (\n <div className=\"pb-20\">\n <HeroSlider collections={featured} isLoading={featuredLoading} getHref={(c) => collectionHref(\"STARKNET\", c.contractAddress)} />\n <PageContainer className=\"box-border max-w-full pt-6 pb-0\">\n <ActivityTicker orders={tickerOrders} minItems={3} getHref={(o) => assetHref(\"STARKNET\", o.nftContract, o.nftTokenId)} />\n </PageContainer>\n <PageContainer className=\"mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20\">\n <NewListings market={market} />\n <CollectionsStrip />\n <RewardsSection rewardsHref=\"/rewards\" />\n <LaunchpadStrip hrefs={LAUNCHPAD_HREFS} marketplaceHref=\"/marketplace\" launchpadHref=\"/launchpad\" />\n </PageContainer>\n {market.dialogs}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCY;AApCZ,iBAA8D;AAC9D,0BAAgC;AAChC,kBAAiB;AACjB,4BAA8B;AAC9B,yBAA2B;AAC3B,6BAA+B;AAC/B,4BAA8B;AAC9B,0BAAiD;AACjD,+BAAgC;AAChC,6BAAu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CAAc,WAAU,gFACvB;AAAA,kDAAC,eAAY,QAAgB;AAAA,MAC7B,4CAAC,oBAAiB;AAAA,MAClB,4CAAC,yCAAe,aAAY,YAAW;AAAA,MACvC,4CAAC,yCAAe,OAAO,iBAAiB,iBAAgB,gBAAe,eAAc,cAAa;AAAA,OACpG;AAAA,IACC,OAAO;AAAA,KACV;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
3
|
+
import { CollectionMarketActions } from './collection-page.cjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
import './gated-content.cjs';
|
|
6
|
+
|
|
7
|
+
interface HomePageProps {
|
|
8
|
+
useMarketActions: () => CollectionMarketActions;
|
|
9
|
+
initialFeatured?: ApiCollection[];
|
|
10
|
+
}
|
|
11
|
+
declare function HomePage({ useMarketActions, initialFeatured }: HomePageProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { HomePage, type HomePageProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
3
|
+
import { CollectionMarketActions } from './collection-page.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import './gated-content.js';
|
|
6
|
+
|
|
7
|
+
interface HomePageProps {
|
|
8
|
+
useMarketActions: () => CollectionMarketActions;
|
|
9
|
+
initialFeatured?: ApiCollection[];
|
|
10
|
+
}
|
|
11
|
+
declare function HomePage({ useMarketActions, initialFeatured }: HomePageProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { HomePage, type HomePageProps };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { assetHref, collectionHref } from "@medialane/sdk";
|
|
4
|
+
import { Tag, TrendingUp } from "lucide-react";
|
|
5
|
+
import Link from "./link.js";
|
|
6
|
+
import { PageContainer } from "./page-container.js";
|
|
7
|
+
import { HeroSlider } from "./hero-slider.js";
|
|
8
|
+
import { ActivityTicker } from "./activity-ticker.js";
|
|
9
|
+
import { ScrollSection } from "./scroll-section.js";
|
|
10
|
+
import { ListingCard, ListingCardSkeleton } from "./listing-card.js";
|
|
11
|
+
import { ListingCardMenu } from "./listing-card-menu.js";
|
|
12
|
+
import { CollectionCard, CollectionCardSkeleton } from "./collection-card.js";
|
|
13
|
+
import { RewardsSection } from "./rewards-section.js";
|
|
14
|
+
import { LaunchpadStrip } from "./launchpad-strip.js";
|
|
15
|
+
import { useMedialaneApp } from "./medialane-app.js";
|
|
16
|
+
import { useOrders } from "../utils/use-orders.js";
|
|
17
|
+
import { useCollections } from "../utils/use-collections.js";
|
|
18
|
+
import { useUsdPrices } from "../utils/use-usd-prices.js";
|
|
19
|
+
import { orderUsd } from "../utils/order-usd.js";
|
|
20
|
+
import { isSameAddress } from "../utils/same-address.js";
|
|
21
|
+
const LAUNCHPAD_HREFS = {
|
|
22
|
+
nfts: "/launchpad/single-editions",
|
|
23
|
+
"limited-editions": "/launchpad/nfteditions",
|
|
24
|
+
"collection-drop": "/launchpad/drop",
|
|
25
|
+
"pop-protocol": "/launchpad/pop",
|
|
26
|
+
"ip-tickets": "/launchpad/tickets",
|
|
27
|
+
"creator-coins": "/launchpad/coin/create"
|
|
28
|
+
};
|
|
29
|
+
function NewListings({ market }) {
|
|
30
|
+
const { walletAddress } = useMedialaneApp();
|
|
31
|
+
const { orders, isLoading } = useOrders({ status: "ACTIVE", limit: 10, page: 1 });
|
|
32
|
+
const prices = useUsdPrices();
|
|
33
|
+
const listings = orders.filter((o) => o.offer.itemType === "ERC721" || o.offer.itemType === "ERC1155").slice(0, 10);
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
ScrollSection,
|
|
36
|
+
{
|
|
37
|
+
icon: /* @__PURE__ */ jsx(Tag, { className: "h-3.5 w-3.5 text-white" }),
|
|
38
|
+
iconBg: "bg-gradient-to-br from-brand-rose to-brand-rose shadow-md shadow-brand-rose/20",
|
|
39
|
+
title: "New listings",
|
|
40
|
+
href: "/marketplace",
|
|
41
|
+
linkLabel: "Marketplace",
|
|
42
|
+
children: isLoading ? Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx("div", { className: "w-72 shrink-0 snap-start", children: /* @__PURE__ */ jsx(ListingCardSkeleton, {}) }, i)) : listings.length === 0 ? /* @__PURE__ */ jsx("p", { className: "py-4 text-sm text-muted-foreground", children: /* @__PURE__ */ jsx(Link, { href: "/launchpad/single-editions", className: "text-primary hover:underline", children: "List the first asset" }) }) : listings.map((order) => {
|
|
43
|
+
const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);
|
|
44
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72 shrink-0 snap-start", children: /* @__PURE__ */ jsx(
|
|
45
|
+
ListingCard,
|
|
46
|
+
{
|
|
47
|
+
order,
|
|
48
|
+
onBuy: own ? void 0 : () => market.buy(order),
|
|
49
|
+
overflowMenu: /* @__PURE__ */ jsx(ListingCardMenu, { order }),
|
|
50
|
+
usdValue: orderUsd(order.price, prices)
|
|
51
|
+
}
|
|
52
|
+
) }, order.orderHash);
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
function CollectionsStrip() {
|
|
58
|
+
const { collections, isLoading } = useCollections(1, 10, void 0, "recent");
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
ScrollSection,
|
|
61
|
+
{
|
|
62
|
+
icon: /* @__PURE__ */ jsx(TrendingUp, { className: "h-3.5 w-3.5 text-white" }),
|
|
63
|
+
iconBg: "bg-gradient-to-br from-brand-purple to-brand-maeve shadow-md shadow-brand-purple/20",
|
|
64
|
+
title: "Collections",
|
|
65
|
+
href: "/collections",
|
|
66
|
+
linkLabel: "See all",
|
|
67
|
+
children: isLoading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx("div", { className: "w-56 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ jsx(CollectionCardSkeleton, {}) }, i)) : collections.map((col) => /* @__PURE__ */ jsx("div", { className: "w-64 shrink-0 snap-start", children: /* @__PURE__ */ jsx(CollectionCard, { collection: col }) }, col.contractAddress))
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function HomePage({ useMarketActions, initialFeatured }) {
|
|
72
|
+
const market = useMarketActions();
|
|
73
|
+
const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, "recent", true, void 0, void 0, initialFeatured);
|
|
74
|
+
const { orders: tickerOrders } = useOrders({ status: "ACTIVE", sort: "recent", limit: 14 });
|
|
75
|
+
return /* @__PURE__ */ jsxs("div", { className: "pb-20", children: [
|
|
76
|
+
/* @__PURE__ */ jsx(HeroSlider, { collections: featured, isLoading: featuredLoading, getHref: (c) => collectionHref("STARKNET", c.contractAddress) }),
|
|
77
|
+
/* @__PURE__ */ jsx(PageContainer, { className: "box-border max-w-full pt-6 pb-0", children: /* @__PURE__ */ jsx(ActivityTicker, { orders: tickerOrders, minItems: 3, getHref: (o) => assetHref("STARKNET", o.nftContract, o.nftTokenId) }) }),
|
|
78
|
+
/* @__PURE__ */ jsxs(PageContainer, { className: "mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20", children: [
|
|
79
|
+
/* @__PURE__ */ jsx(NewListings, { market }),
|
|
80
|
+
/* @__PURE__ */ jsx(CollectionsStrip, {}),
|
|
81
|
+
/* @__PURE__ */ jsx(RewardsSection, { rewardsHref: "/rewards" }),
|
|
82
|
+
/* @__PURE__ */ jsx(LaunchpadStrip, { hrefs: LAUNCHPAD_HREFS, marketplaceHref: "/marketplace", launchpadHref: "/launchpad" })
|
|
83
|
+
] }),
|
|
84
|
+
market.dialogs
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
HomePage
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=home-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection } from \"@medialane/sdk\";\nimport { Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { HeroSlider } from \"./hero-slider.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders({ status: \"ACTIVE\", limit: 10, page: 1 });\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n return (\n <ScrollSection\n icon={<Tag className=\"h-3.5 w-3.5 text-white\" />}\n iconBg=\"bg-gradient-to-br from-brand-rose to-brand-rose shadow-md shadow-brand-rose/20\"\n title=\"New listings\"\n href=\"/marketplace\"\n linkLabel=\"Marketplace\"\n >\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-72 shrink-0 snap-start\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? (\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">List the first asset</Link>\n </p>\n )\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-72 shrink-0 snap-start\">\n <ListingCard\n order={order}\n onBuy={own ? undefined : () => market.buy(order)}\n overflowMenu={<ListingCardMenu order={order} />}\n usdValue={orderUsd(order.price, prices)}\n />\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-3.5 w-3.5 text-white\" />}\n iconBg=\"bg-gradient-to-br from-brand-purple to-brand-maeve shadow-md shadow-brand-purple/20\"\n title=\"Collections\"\n href=\"/collections\"\n linkLabel=\"See all\"\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><CollectionCardSkeleton /></div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-64 shrink-0 snap-start\"><CollectionCard collection={col} /></div>\n ))}\n </ScrollSection>\n );\n}\n\nexport interface HomePageProps {\n useMarketActions: () => CollectionMarketActions;\n initialFeatured?: ApiCollection[];\n}\n\nexport function HomePage({ useMarketActions, initialFeatured }: HomePageProps) {\n const market = useMarketActions();\n const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, \"recent\", true, undefined, undefined, initialFeatured);\n const { orders: tickerOrders } = useOrders({ status: \"ACTIVE\", sort: \"recent\", limit: 14 });\n return (\n <div className=\"pb-20\">\n <HeroSlider collections={featured} isLoading={featuredLoading} getHref={(c) => collectionHref(\"STARKNET\", c.contractAddress)} />\n <PageContainer className=\"box-border max-w-full pt-6 pb-0\">\n <ActivityTicker orders={tickerOrders} minItems={3} getHref={(o) => assetHref(\"STARKNET\", o.nftContract, o.nftTokenId)} />\n </PageContainer>\n <PageContainer className=\"mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20\">\n <NewListings market={market} />\n <CollectionsStrip />\n <RewardsSection rewardsHref=\"/rewards\" />\n <LaunchpadStrip hrefs={LAUNCHPAD_HREFS} marketplaceHref=\"/marketplace\" launchpadHref=\"/launchpad\" />\n </PageContainer>\n {market.dialogs}\n </div>\n );\n}\n"],"mappings":";AAsCY,cAqEN,YArEM;AApCZ,SAAS,WAAW,sBAA0C;AAC9D,SAAS,KAAK,kBAAkB;AAChC,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,aAAa,2BAA2B;AACjD,SAAS,uBAAuB;AAChC,SAAS,gBAAgB,8BAA8B;AACvD,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAEhC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAE9B,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,SAAS,YAAY,EAAE,OAAO,GAAwC;AACpE,QAAM,EAAE,cAAc,IAAI,gBAAgB;AAC1C,QAAM,EAAE,QAAQ,UAAU,IAAI,UAAU,EAAE,QAAQ,UAAU,OAAO,IAAI,MAAM,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AAG,MAChC,oBAAC,SAAY,WAAU,oCAAmC,8BAAC,0BAAuB,KAAxE,CAA0E,CACrF,IACD,YAAY,IAAI,CAAC,QACf,oBAAC,SAA8B,WAAU,4BAA2B,8BAAC,kBAAe,YAAY,KAAK,KAA3F,IAAI,eAAyF,CACxG;AAAA;AAAA,EACP;AAEJ;AAOO,SAAS,SAAS,EAAE,kBAAkB,gBAAgB,GAAkB;AAC7E,QAAM,SAAS,iBAAiB;AAChC,QAAM,EAAE,aAAa,UAAU,WAAW,gBAAgB,IAAI,eAAe,GAAG,GAAG,MAAM,UAAU,MAAM,QAAW,QAAW,eAAe;AAC9I,QAAM,EAAE,QAAQ,aAAa,IAAI,UAAU,EAAE,QAAQ,UAAU,MAAM,UAAU,OAAO,GAAG,CAAC;AAC1F,SACE,qBAAC,SAAI,WAAU,SACb;AAAA,wBAAC,cAAW,aAAa,UAAU,WAAW,iBAAiB,SAAS,CAAC,MAAM,eAAe,YAAY,EAAE,eAAe,GAAG;AAAA,IAC9H,oBAAC,iBAAc,WAAU,mCACvB,8BAAC,kBAAe,QAAQ,cAAc,UAAU,GAAG,SAAS,CAAC,MAAM,UAAU,YAAY,EAAE,aAAa,EAAE,UAAU,GAAG,GACzH;AAAA,IACA,qBAAC,iBAAc,WAAU,gFACvB;AAAA,0BAAC,eAAY,QAAgB;AAAA,MAC7B,oBAAC,oBAAiB;AAAA,MAClB,oBAAC,kBAAe,aAAY,YAAW;AAAA,MACvC,oBAAC,kBAAe,OAAO,iBAAiB,iBAAgB,gBAAe,eAAc,cAAa;AAAA,OACpG;AAAA,IACC,OAAO;AAAA,KACV;AAEJ;","names":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var ip_type_nav_exports = {};
|
|
31
|
+
__export(ip_type_nav_exports, {
|
|
32
|
+
IpTypeNav: () => IpTypeNav
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ip_type_nav_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
37
|
+
var import_lucide_react = require("lucide-react");
|
|
38
|
+
var import_ip_type_badge = require("./ip-type-badge.js");
|
|
39
|
+
var import_cn = require("../utils/cn.js");
|
|
40
|
+
function IpTypeNav() {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-xl sm:text-2xl font-black", children: "Browse by Type" }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
45
|
+
import_link.default,
|
|
46
|
+
{
|
|
47
|
+
href: "/nft",
|
|
48
|
+
className: "flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",
|
|
49
|
+
children: [
|
|
50
|
+
"View all ",
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3.5 w-3.5" })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-3", children: import_ip_type_badge.IP_TYPE_CONFIG.map(({ slug, label, icon: Icon, colorClass, bgClass }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
57
|
+
import_link.default,
|
|
58
|
+
{
|
|
59
|
+
href: `/${slug}`,
|
|
60
|
+
className: "group flex flex-col items-center gap-2.5 p-4 rounded-xl border border-border bg-card hover:border-primary/40 hover:bg-card/80 transition-all hover:shadow-md hover:shadow-black/10",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("h-10 w-10 rounded-xl flex items-center justify-center", bgClass), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)("h-5 w-5", colorClass) }) }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs font-semibold text-center leading-tight", children: label })
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
slug
|
|
67
|
+
)) })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {
|
|
72
|
+
IpTypeNav
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=ip-type-nav.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nimport { IP_TYPE_CONFIG } from \"./ip-type-badge.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport function IpTypeNav() {\n return (\n <section className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-xl sm:text-2xl font-black\">Browse by Type</h2>\n <Link\n href=\"/nft\"\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n View all <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </div>\n\n <div className=\"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-3\">\n {IP_TYPE_CONFIG.map(({ slug, label, icon: Icon, colorClass, bgClass }) => (\n <Link\n key={slug}\n href={`/${slug}`}\n className=\"group flex flex-col items-center gap-2.5 p-4 rounded-xl border border-border bg-card hover:border-primary/40 hover:bg-card/80 transition-all hover:shadow-md hover:shadow-black/10\"\n >\n <div className={cn(\"h-10 w-10 rounded-xl flex items-center justify-center\", bgClass)}>\n <Icon className={cn(\"h-5 w-5\", colorClass)} />\n </div>\n <span className=\"text-xs font-semibold text-center leading-tight\">{label}</span>\n </Link>\n ))}\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWQ;AATR,kBAAiB;AACjB,0BAA2B;AAC3B,2BAA+B;AAC/B,gBAAmB;AAEZ,SAAS,YAAY;AAC1B,SACE,6CAAC,aAAQ,WAAU,aACjB;AAAA,iDAAC,SAAI,WAAU,qCACb;AAAA,kDAAC,QAAG,WAAU,kCAAiC,4BAAc;AAAA,MAC7D;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACX;AAAA;AAAA,YACU,4CAAC,kCAAW,WAAU,eAAc;AAAA;AAAA;AAAA,MAC/C;AAAA,OACF;AAAA,IAEA,4CAAC,SAAI,WAAU,wDACZ,8CAAe,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,MAAM,YAAY,QAAQ,MAClE;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QAEC,MAAM,IAAI,IAAI;AAAA,QACd,WAAU;AAAA,QAEV;AAAA,sDAAC,SAAI,eAAW,cAAG,yDAAyD,OAAO,GACjF,sDAAC,QAAK,eAAW,cAAG,WAAW,UAAU,GAAG,GAC9C;AAAA,UACA,4CAAC,UAAK,WAAU,mDAAmD,iBAAM;AAAA;AAAA;AAAA,MAPpE;AAAA,IAQP,CACD,GACH;AAAA,KACF;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "./link.js";
|
|
4
|
+
import { ArrowRight } from "lucide-react";
|
|
5
|
+
import { IP_TYPE_CONFIG } from "./ip-type-badge.js";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
7
|
+
function IpTypeNav() {
|
|
8
|
+
return /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
10
|
+
/* @__PURE__ */ jsx("h2", { className: "text-xl sm:text-2xl font-black", children: "Browse by Type" }),
|
|
11
|
+
/* @__PURE__ */ jsxs(
|
|
12
|
+
Link,
|
|
13
|
+
{
|
|
14
|
+
href: "/nft",
|
|
15
|
+
className: "flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",
|
|
16
|
+
children: [
|
|
17
|
+
"View all ",
|
|
18
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-3.5 w-3.5" })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-3", children: IP_TYPE_CONFIG.map(({ slug, label, icon: Icon, colorClass, bgClass }) => /* @__PURE__ */ jsxs(
|
|
24
|
+
Link,
|
|
25
|
+
{
|
|
26
|
+
href: `/${slug}`,
|
|
27
|
+
className: "group flex flex-col items-center gap-2.5 p-4 rounded-xl border border-border bg-card hover:border-primary/40 hover:bg-card/80 transition-all hover:shadow-md hover:shadow-black/10",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: cn("h-10 w-10 rounded-xl flex items-center justify-center", bgClass), children: /* @__PURE__ */ jsx(Icon, { className: cn("h-5 w-5", colorClass) }) }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-center leading-tight", children: label })
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
slug
|
|
34
|
+
)) })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
IpTypeNav
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=ip-type-nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nimport { IP_TYPE_CONFIG } from \"./ip-type-badge.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport function IpTypeNav() {\n return (\n <section className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-xl sm:text-2xl font-black\">Browse by Type</h2>\n <Link\n href=\"/nft\"\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n View all <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </div>\n\n <div className=\"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-3\">\n {IP_TYPE_CONFIG.map(({ slug, label, icon: Icon, colorClass, bgClass }) => (\n <Link\n key={slug}\n href={`/${slug}`}\n className=\"group flex flex-col items-center gap-2.5 p-4 rounded-xl border border-border bg-card hover:border-primary/40 hover:bg-card/80 transition-all hover:shadow-md hover:shadow-black/10\"\n >\n <div className={cn(\"h-10 w-10 rounded-xl flex items-center justify-center\", bgClass)}>\n <Icon className={cn(\"h-5 w-5\", colorClass)} />\n </div>\n <span className=\"text-xs font-semibold text-center leading-tight\">{label}</span>\n </Link>\n ))}\n </div>\n </section>\n );\n}\n"],"mappings":";AAWQ,cACA,YADA;AATR,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,UAAU;AAEZ,SAAS,YAAY;AAC1B,SACE,qBAAC,aAAQ,WAAU,aACjB;AAAA,yBAAC,SAAI,WAAU,qCACb;AAAA,0BAAC,QAAG,WAAU,kCAAiC,4BAAc;AAAA,MAC7D;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACX;AAAA;AAAA,YACU,oBAAC,cAAW,WAAU,eAAc;AAAA;AAAA;AAAA,MAC/C;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,wDACZ,yBAAe,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,MAAM,YAAY,QAAQ,MAClE;AAAA,MAAC;AAAA;AAAA,QAEC,MAAM,IAAI,IAAI;AAAA,QACd,WAAU;AAAA,QAEV;AAAA,8BAAC,SAAI,WAAW,GAAG,yDAAyD,OAAO,GACjF,8BAAC,QAAK,WAAW,GAAG,WAAW,UAAU,GAAG,GAC9C;AAAA,UACA,oBAAC,UAAK,WAAU,mDAAmD,iBAAM;AAAA;AAAA;AAAA,MAPpE;AAAA,IAQP,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCS;AArCT,mBAAgG;AAkCzF,MAAM,0BAAsB,4BAAmC,IAAI;AAEnE,SAAS,qBAAqB,EAAE,OAAO,SAAS,GAAiD;AACtG,SAAO,4CAAC,oBAAoB,UAApB,EAA6B,OAAe,UAAS;AAC/D;AAEO,SAAS,kBAAgC;AAC9C,QAAM,UAAM,yBAAW,mBAAmB;AAC1C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,8BAA8B;AACxD,SAAO;AACT;","names":[]}
|
|
@@ -33,6 +33,7 @@ interface MedialaneApp {
|
|
|
33
33
|
getClient: () => MedialaneClient;
|
|
34
34
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
35
35
|
walletAddress: string | null;
|
|
36
|
+
walletLoading?: boolean;
|
|
36
37
|
onRequireWallet: () => void;
|
|
37
38
|
connectLabel?: string;
|
|
38
39
|
connectDescription?: string;
|
|
@@ -33,6 +33,7 @@ interface MedialaneApp {
|
|
|
33
33
|
getClient: () => MedialaneClient;
|
|
34
34
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
35
35
|
walletAddress: string | null;
|
|
36
|
+
walletLoading?: boolean;
|
|
36
37
|
onRequireWallet: () => void;
|
|
37
38
|
connectLabel?: string;
|
|
38
39
|
connectDescription?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";AAuCS;AArCT,SAAS,eAAe,kBAAwE;AAkCzF,MAAM,sBAAsB,cAAmC,IAAI;AAEnE,SAAS,qBAAqB,EAAE,OAAO,SAAS,GAAiD;AACtG,SAAO,oBAAC,oBAAoB,UAApB,EAA6B,OAAe,UAAS;AAC/D;AAEO,SAAS,kBAAgC;AAC9C,QAAM,MAAM,WAAW,mBAAmB;AAC1C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,8BAA8B;AACxD,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var portfolio_assets_exports = {};
|
|
21
|
+
__export(portfolio_assets_exports, {
|
|
22
|
+
PortfolioAssets: () => PortfolioAssets
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(portfolio_assets_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_lucide_react = require("lucide-react");
|
|
28
|
+
var import_empty_or_error = require("./empty-or-error.js");
|
|
29
|
+
var import_load_more_sentinel = require("./load-more-sentinel.js");
|
|
30
|
+
var import_token_card = require("./token-card.js");
|
|
31
|
+
var import_medialane_app = require("./medialane-app.js");
|
|
32
|
+
var import_order_usd = require("../utils/order-usd.js");
|
|
33
|
+
var import_use_usd_prices = require("../utils/use-usd-prices.js");
|
|
34
|
+
var import_use_tokens = require("../utils/use-tokens.js");
|
|
35
|
+
const PAGE_SIZE = 20;
|
|
36
|
+
const GRID = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4";
|
|
37
|
+
function usdFor(token, prices) {
|
|
38
|
+
const order = token.activeOrders?.find((o) => o.offer.itemType === "ERC721" || o.offer.itemType === "ERC1155");
|
|
39
|
+
return (0, import_order_usd.orderUsd)(order?.price, prices);
|
|
40
|
+
}
|
|
41
|
+
function PortfolioAssets({ address, useActions }) {
|
|
42
|
+
const { ReportDialog } = (0, import_medialane_app.useMedialaneApp)();
|
|
43
|
+
const [page, setPage] = (0, import_react.useState)(1);
|
|
44
|
+
const [all, setAll] = (0, import_react.useState)([]);
|
|
45
|
+
const [reportToken, setReportToken] = (0, import_react.useState)(null);
|
|
46
|
+
const { tokens, meta, isLoading, error, mutate } = (0, import_use_tokens.useTokensByOwner)(address, page, PAGE_SIZE);
|
|
47
|
+
const prices = (0, import_use_usd_prices.useUsdPrices)();
|
|
48
|
+
(0, import_react.useEffect)(() => setAll((prev) => page === 1 ? tokens : [...prev, ...tokens]), [tokens, page]);
|
|
49
|
+
(0, import_react.useEffect)(() => {
|
|
50
|
+
setPage(1);
|
|
51
|
+
setAll([]);
|
|
52
|
+
}, [address]);
|
|
53
|
+
const actions = useActions({ refresh: () => {
|
|
54
|
+
setPage(1);
|
|
55
|
+
setAll([]);
|
|
56
|
+
void mutate();
|
|
57
|
+
} });
|
|
58
|
+
const shown = page === 1 ? tokens : all;
|
|
59
|
+
const hasMore = meta ? (meta.total ?? 0) > shown.length : false;
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
62
|
+
import_empty_or_error.EmptyOrError,
|
|
63
|
+
{
|
|
64
|
+
isLoading: isLoading && page === 1,
|
|
65
|
+
error,
|
|
66
|
+
isEmpty: shown.length === 0 && !isLoading,
|
|
67
|
+
onRetry: () => void mutate(),
|
|
68
|
+
emptyTitle: "No assets yet",
|
|
69
|
+
emptyDescription: "Create your first asset to get started.",
|
|
70
|
+
emptyCta: { label: "Create your first asset", href: "/launchpad/single-editions" },
|
|
71
|
+
emptyIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImageIcon, { className: "h-7 w-7 text-muted-foreground" }),
|
|
72
|
+
skeletonNode: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: GRID, children: Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "animate-pulse overflow-hidden rounded-xl bg-muted", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full bg-muted-foreground/10" }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 p-3", children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-3/4 rounded bg-muted-foreground/10" }),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-3 w-1/2 rounded bg-muted-foreground/10" })
|
|
77
|
+
] })
|
|
78
|
+
] }, i)) }),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: GRID, children: shown.map((token) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_token_card.TokenCard,
|
|
82
|
+
{
|
|
83
|
+
token,
|
|
84
|
+
isOwner: true,
|
|
85
|
+
usdValue: usdFor(token, prices),
|
|
86
|
+
onList: actions.list,
|
|
87
|
+
onTransfer: actions.transfer,
|
|
88
|
+
onCancel: actions.cancel,
|
|
89
|
+
onReport: ReportDialog ? setReportToken : void 0
|
|
90
|
+
},
|
|
91
|
+
`${token.contractAddress}-${token.tokenId}`
|
|
92
|
+
)) }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_load_more_sentinel.LoadMoreSentinel, { hasMore, isLoading, onLoadMore: () => setPage((p) => p + 1) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
actions.dialogs,
|
|
98
|
+
ReportDialog && reportToken && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
+
ReportDialog,
|
|
100
|
+
{
|
|
101
|
+
open: !!reportToken,
|
|
102
|
+
onOpenChange: (open) => {
|
|
103
|
+
if (!open) setReportToken(null);
|
|
104
|
+
},
|
|
105
|
+
target: { type: "TOKEN", contract: reportToken.contractAddress, tokenId: reportToken.tokenId, name: reportToken.metadata?.name ?? void 0 }
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
+
0 && (module.exports = {
|
|
112
|
+
PortfolioAssets
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=portfolio-assets.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard } from \"./token-card.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const { ReportDialog } = useMedialaneApp();\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle=\"No assets yet\"\n emptyDescription=\"Create your first asset to get started.\"\n emptyCta={{ label: \"Create your first asset\", href: \"/launchpad/single-editions\" }}\n emptyIcon={<ImageIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <div key={i} className=\"animate-pulse overflow-hidden rounded-xl bg-muted\">\n <div className=\"aspect-square w-full bg-muted-foreground/10\" />\n <div className=\"space-y-2 p-3\">\n <div className=\"h-4 w-3/4 rounded bg-muted-foreground/10\" />\n <div className=\"h-3 w-1/2 rounded bg-muted-foreground/10\" />\n </div>\n </div>\n ))}\n </div>\n }\n >\n <div className={GRID}>\n {shown.map((token) => (\n <TokenCard\n key={`${token.contractAddress}-${token.tokenId}`}\n token={token}\n isOwner\n usdValue={usdFor(token, prices)}\n onList={actions.list}\n onTransfer={actions.transfer}\n onCancel={actions.cancel}\n onReport={ReportDialog ? setReportToken : undefined}\n />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </EmptyOrError>\n {actions.dialogs}\n {ReportDialog && reportToken && (\n <ReportDialog\n open={!!reportToken}\n onOpenChange={(open) => { if (!open) setReportToken(null); }}\n target={{ type: \"TOKEN\", contract: reportToken.contractAddress, tokenId: reportToken.tokenId, name: reportToken.metadata?.name ?? undefined }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CI;AA5CJ,mBAAoD;AAEpD,0BAA0B;AAC1B,4BAA6B;AAC7B,gCAAiC;AACjC,wBAA0B;AAC1B,2BAAgC;AAChC,uBAAyB;AACzB,4BAA6B;AAC7B,wBAAiC;AAWjC,MAAM,YAAY;AAClB,MAAM,OAAO;AAEb,SAAS,OAAO,OAAiB,QAAwD;AACvF,QAAM,QAAQ,MAAM,cAAc,KAAK,CAAC,MAAM,EAAE,MAAM,aAAa,YAAY,EAAE,MAAM,aAAa,SAAS;AAC7G,aAAO,2BAAS,OAAO,OAAO,MAAM;AACtC;AAEO,SAAS,gBAAgB,EAAE,SAAS,WAAW,GAA8D;AAClH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