@medialane/ui 0.371.0 → 0.372.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/asset-marketplace-panel.cjs +15 -19
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.js +15 -19
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/asset-overview-content.cjs +2 -7
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.js +2 -7
- package/dist/components/asset-overview-content.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 +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/home-page.cjs +5 -3
- package/dist/components/home-page.cjs.map +1 -1
- package/dist/components/home-page.d.cts +2 -1
- package/dist/components/home-page.d.ts +2 -1
- package/dist/components/home-page.js +5 -3
- package/dist/components/home-page.js.map +1 -1
- package/dist/components/image.cjs +5 -1
- package/dist/components/image.cjs.map +1 -1
- package/dist/components/image.d.cts +1 -1
- package/dist/components/image.d.ts +1 -1
- package/dist/components/image.js +5 -1
- package/dist/components/image.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/marketplace-dialog-primitives.cjs +5 -10
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.js +5 -10
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/scroll-section.cjs +1 -1
- package/dist/components/scroll-section.cjs.map +1 -1
- package/dist/components/scroll-section.d.cts +2 -2
- package/dist/components/scroll-section.d.ts +2 -2
- package/dist/components/scroll-section.js +1 -1
- package/dist/components/scroll-section.js.map +1 -1
- package/package.json +1 -1
|
@@ -66,14 +66,15 @@ function ListingsStrip({
|
|
|
66
66
|
title,
|
|
67
67
|
query,
|
|
68
68
|
href,
|
|
69
|
-
empty
|
|
69
|
+
empty,
|
|
70
|
+
heading = true
|
|
70
71
|
}) {
|
|
71
72
|
const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
|
|
72
73
|
const { orders, isLoading } = (0, import_use_orders.useOrders)(query);
|
|
73
74
|
const prices = (0, import_use_usd_prices.useUsdPrices)();
|
|
74
75
|
const listings = orders.filter((o) => o.offer.itemType === "ERC721" || o.offer.itemType === "ERC1155").slice(0, 10);
|
|
75
76
|
if (!isLoading && listings.length === 0 && !empty) return null;
|
|
76
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_section.ScrollSection, { icon, title, href, children: isLoading ? Array.from({ length: 8 }).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_listing_card.ListingCardSkeleton, {}) }, i)) : listings.length === 0 ? empty : listings.map((order) => {
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_section.ScrollSection, { icon: heading ? icon : void 0, title: heading ? title : void 0, href, children: isLoading ? Array.from({ length: 8 }).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_listing_card.ListingCardSkeleton, {}) }, i)) : listings.length === 0 ? empty : listings.map((order) => {
|
|
77
78
|
const own = !!walletAddress && (0, import_same_address.isSameAddress)(order.offerer, walletAddress);
|
|
78
79
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
80
|
import_listing_card.ListingCard,
|
|
@@ -99,11 +100,12 @@ function NewListings({ market }) {
|
|
|
99
100
|
}
|
|
100
101
|
);
|
|
101
102
|
}
|
|
102
|
-
function FeaturedListings({ market }) {
|
|
103
|
+
function FeaturedListings({ market, heading = true }) {
|
|
103
104
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
105
|
ListingsStrip,
|
|
105
106
|
{
|
|
106
107
|
market,
|
|
108
|
+
heading,
|
|
107
109
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, {}),
|
|
108
110
|
title: "Featured",
|
|
109
111
|
query: { status: "ACTIVE", isFeatured: true, limit: 20, page: 1 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection, type ApiOrdersQuery } from \"@medialane/sdk\";\nimport type { ReactNode } from \"react\";\nimport { Sparkles, Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { CollectionShowcase } from \"./collection-showcase.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 ListingsStrip({\n market, icon, title, query, href, empty,\n}: {\n market: CollectionMarketActions;\n icon: ReactNode;\n title: string;\n query: ApiOrdersQuery;\n href: string;\n empty?: ReactNode;\n}) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders(query);\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n if (!isLoading && listings.length === 0 && !empty) return null;\n return (\n <ScrollSection icon={icon} title={title} href={href}>\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? empty\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-56 shrink-0 snap-start sm:w-64\">\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 NewListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Tag />}\n title=\"Marketplace\"\n query={{ status: \"ACTIVE\", limit: 10, page: 1 }}\n href=\"/marketplace\"\n empty={\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n }\n />\n );\n}\n\nexport function FeaturedListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Sparkles />}\n title=\"Featured\"\n query={{ status: \"ACTIVE\", isFeatured: true, limit: 20, page: 1 }}\n href=\"/marketplace\"\n />\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\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-56 shrink-0 snap-start sm:w-64\"><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 <CollectionShowcase 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 <FeaturedListings 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;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection, type ApiOrdersQuery } from \"@medialane/sdk\";\nimport type { ReactNode } from \"react\";\nimport { Sparkles, Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { CollectionShowcase } from \"./collection-showcase.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 ListingsStrip({\n market, icon, title, query, href, empty, heading = true,\n}: {\n market: CollectionMarketActions;\n icon: ReactNode;\n title: string;\n query: ApiOrdersQuery;\n href: string;\n empty?: ReactNode;\n heading?: boolean;\n}) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders(query);\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n if (!isLoading && listings.length === 0 && !empty) return null;\n return (\n <ScrollSection icon={heading ? icon : undefined} title={heading ? title : undefined} href={href}>\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? empty\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-56 shrink-0 snap-start sm:w-64\">\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 NewListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Tag />}\n title=\"Marketplace\"\n query={{ status: \"ACTIVE\", limit: 10, page: 1 }}\n href=\"/marketplace\"\n empty={\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n }\n />\n );\n}\n\nexport function FeaturedListings({ market, heading = true }: { market: CollectionMarketActions; heading?: boolean }) {\n return (\n <ListingsStrip\n market={market}\n heading={heading}\n icon={<Sparkles />}\n title=\"Featured\"\n query={{ status: \"ACTIVE\", isFeatured: true, limit: 20, page: 1 }}\n href=\"/marketplace\"\n />\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\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-56 shrink-0 snap-start sm:w-64\"><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 <CollectionShowcase 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 <FeaturedListings 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;AAAA;AAoDsE;AAlDtE,iBAAmF;AAEnF,0BAA0C;AAC1C,kBAAiB;AACjB,4BAA8B;AAC9B,iCAAmC;AACnC,6BAA+B;AAC/B,4BAA8B;AAC9B,0BAAiD;AACjD,+BAAgC;AAChC,6BAAuD;AACvD,6BAA+B;AAC/B,6BAA+B;AAC/B,2BAAgC;AAEhC,wBAA0B;AAC1B,6BAA+B;AAC/B,4BAA6B;AAC7B,uBAAyB;AACzB,0BAA8B;AAE9B,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EAAQ;AAAA,EAAM;AA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AAAA,IACtI,4CAAC,uCAAc,WAAU,mCACvB,sDAAC,yCAAe,QAAQ,cAAc,UAAU,GAAG,SAAS,CAAC,UAAM,sBAAU,YAAY,EAAE,aAAa,EAAE,UAAU,GAAG,GACzH;AAAA,IACA,6CAAC,uCAAc,WAAU,gFACvB;AAAA,kDAAC,eAAY,QAAgB;AAAA,MAC7B,4CAAC,oBAAiB,QAAgB;AAAA,MAClC,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"]}
|
|
@@ -4,8 +4,9 @@ import { CollectionMarketActions } from './collection-page.cjs';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import './gated-content.cjs';
|
|
6
6
|
|
|
7
|
-
declare function FeaturedListings({ market }: {
|
|
7
|
+
declare function FeaturedListings({ market, heading }: {
|
|
8
8
|
market: CollectionMarketActions;
|
|
9
|
+
heading?: boolean;
|
|
9
10
|
}): react_jsx_runtime.JSX.Element;
|
|
10
11
|
interface HomePageProps {
|
|
11
12
|
useMarketActions: () => CollectionMarketActions;
|
|
@@ -4,8 +4,9 @@ import { CollectionMarketActions } from './collection-page.js';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import './gated-content.js';
|
|
6
6
|
|
|
7
|
-
declare function FeaturedListings({ market }: {
|
|
7
|
+
declare function FeaturedListings({ market, heading }: {
|
|
8
8
|
market: CollectionMarketActions;
|
|
9
|
+
heading?: boolean;
|
|
9
10
|
}): react_jsx_runtime.JSX.Element;
|
|
10
11
|
interface HomePageProps {
|
|
11
12
|
useMarketActions: () => CollectionMarketActions;
|
|
@@ -32,14 +32,15 @@ function ListingsStrip({
|
|
|
32
32
|
title,
|
|
33
33
|
query,
|
|
34
34
|
href,
|
|
35
|
-
empty
|
|
35
|
+
empty,
|
|
36
|
+
heading = true
|
|
36
37
|
}) {
|
|
37
38
|
const { walletAddress } = useMedialaneApp();
|
|
38
39
|
const { orders, isLoading } = useOrders(query);
|
|
39
40
|
const prices = useUsdPrices();
|
|
40
41
|
const listings = orders.filter((o) => o.offer.itemType === "ERC721" || o.offer.itemType === "ERC1155").slice(0, 10);
|
|
41
42
|
if (!isLoading && listings.length === 0 && !empty) return null;
|
|
42
|
-
return /* @__PURE__ */ jsx(ScrollSection, { icon, title, href, children: isLoading ? Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx("div", { className: "w-56 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ jsx(ListingCardSkeleton, {}) }, i)) : listings.length === 0 ? empty : listings.map((order) => {
|
|
43
|
+
return /* @__PURE__ */ jsx(ScrollSection, { icon: heading ? icon : void 0, title: heading ? title : void 0, href, children: isLoading ? Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx("div", { className: "w-56 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ jsx(ListingCardSkeleton, {}) }, i)) : listings.length === 0 ? empty : listings.map((order) => {
|
|
43
44
|
const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);
|
|
44
45
|
return /* @__PURE__ */ jsx("div", { className: "w-56 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ jsx(
|
|
45
46
|
ListingCard,
|
|
@@ -65,11 +66,12 @@ function NewListings({ market }) {
|
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
}
|
|
68
|
-
function FeaturedListings({ market }) {
|
|
69
|
+
function FeaturedListings({ market, heading = true }) {
|
|
69
70
|
return /* @__PURE__ */ jsx(
|
|
70
71
|
ListingsStrip,
|
|
71
72
|
{
|
|
72
73
|
market,
|
|
74
|
+
heading,
|
|
73
75
|
icon: /* @__PURE__ */ jsx(Sparkles, {}),
|
|
74
76
|
title: "Featured",
|
|
75
77
|
query: { status: "ACTIVE", isFeatured: true, limit: 20, page: 1 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection, type ApiOrdersQuery } from \"@medialane/sdk\";\nimport type { ReactNode } from \"react\";\nimport { Sparkles, Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { CollectionShowcase } from \"./collection-showcase.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 ListingsStrip({\n market, icon, title, query, href, empty,\n}: {\n market: CollectionMarketActions;\n icon: ReactNode;\n title: string;\n query: ApiOrdersQuery;\n href: string;\n empty?: ReactNode;\n}) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders(query);\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n if (!isLoading && listings.length === 0 && !empty) return null;\n return (\n <ScrollSection icon={icon} title={title} href={href}>\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? empty\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-56 shrink-0 snap-start sm:w-64\">\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 NewListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Tag />}\n title=\"Marketplace\"\n query={{ status: \"ACTIVE\", limit: 10, page: 1 }}\n href=\"/marketplace\"\n empty={\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n }\n />\n );\n}\n\nexport function FeaturedListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Sparkles />}\n title=\"Featured\"\n query={{ status: \"ACTIVE\", isFeatured: true, limit: 20, page: 1 }}\n href=\"/marketplace\"\n />\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\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-56 shrink-0 snap-start sm:w-64\"><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 <CollectionShowcase 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 <FeaturedListings 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":";
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection, type ApiOrdersQuery } from \"@medialane/sdk\";\nimport type { ReactNode } from \"react\";\nimport { Sparkles, Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { CollectionShowcase } from \"./collection-showcase.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 ListingsStrip({\n market, icon, title, query, href, empty, heading = true,\n}: {\n market: CollectionMarketActions;\n icon: ReactNode;\n title: string;\n query: ApiOrdersQuery;\n href: string;\n empty?: ReactNode;\n heading?: boolean;\n}) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders(query);\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n if (!isLoading && listings.length === 0 && !empty) return null;\n return (\n <ScrollSection icon={heading ? icon : undefined} title={heading ? title : undefined} href={href}>\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? empty\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-56 shrink-0 snap-start sm:w-64\">\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 NewListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Tag />}\n title=\"Marketplace\"\n query={{ status: \"ACTIVE\", limit: 10, page: 1 }}\n href=\"/marketplace\"\n empty={\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n }\n />\n );\n}\n\nexport function FeaturedListings({ market, heading = true }: { market: CollectionMarketActions; heading?: boolean }) {\n return (\n <ListingsStrip\n market={market}\n heading={heading}\n icon={<Sparkles />}\n title=\"Featured\"\n query={{ status: \"ACTIVE\", isFeatured: true, limit: 20, page: 1 }}\n href=\"/marketplace\"\n />\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\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-56 shrink-0 snap-start sm:w-64\"><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 <CollectionShowcase 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 <FeaturedListings 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":";AAoDsE,cAqFhE,YArFgE;AAlDtE,SAAS,WAAW,sBAA+D;AAEnF,SAAS,UAAU,KAAK,kBAAkB;AAC1C,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,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,cAAc;AAAA,EACrB;AAAA,EAAQ;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EAAM;AAAA,EAAO,UAAU;AACrD,GAQG;AACD,QAAM,EAAE,cAAc,IAAI,gBAAgB;AAC1C,QAAM,EAAE,QAAQ,UAAU,IAAI,UAAU,KAAK;AAC7C,QAAM,SAAS,aAAa;AAC5B,QAAM,WAAW,OAAO,OAAO,CAAC,MAAM,EAAE,MAAM,aAAa,YAAY,EAAE,MAAM,aAAa,SAAS,EAAE,MAAM,GAAG,EAAE;AAClH,MAAI,CAAC,aAAa,SAAS,WAAW,KAAK,CAAC,MAAO,QAAO;AAC1D,SACE,oBAAC,iBAAc,MAAM,UAAU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KACV;AAEJ;","names":[]}
|
|
@@ -36,9 +36,12 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var import_image = __toESM(require("next/image"), 1);
|
|
38
38
|
var import_cn = require("../utils/cn.js");
|
|
39
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
39
40
|
const RETRY_DELAY_MS = 5e3;
|
|
40
41
|
const MAX_RETRIES = 6;
|
|
41
|
-
function Image({ onError, className, ...props }) {
|
|
42
|
+
function Image({ onError, className, src, ...props }) {
|
|
43
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
44
|
+
const shown = typeof src === "string" && src.startsWith("ipfs://") ? resolveImage(src) ?? src : src;
|
|
42
45
|
const [attempt, setAttempt] = (0, import_react.useState)(0);
|
|
43
46
|
const [waiting, setWaiting] = (0, import_react.useState)(false);
|
|
44
47
|
const timer = (0, import_react.useRef)(void 0);
|
|
@@ -47,6 +50,7 @@ function Image({ onError, className, ...props }) {
|
|
|
47
50
|
import_image.default,
|
|
48
51
|
{
|
|
49
52
|
...props,
|
|
53
|
+
src: shown,
|
|
50
54
|
className: (0, import_cn.cn)(className, waiting && "invisible"),
|
|
51
55
|
onLoad: (event) => {
|
|
52
56
|
setWaiting(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/image.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport NextImage, { type ImageProps } from \"next/image\";\nimport { cn } from \"../utils/cn.js\";\n\nconst RETRY_DELAY_MS = 5000;\nconst MAX_RETRIES = 6;\n\nexport default function Image({ onError, className, ...props }: ImageProps) {\n const [attempt, setAttempt] = useState(0);\n const [waiting, setWaiting] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n return (\n <NextImage\n key={attempt}\n {...props}\n className={cn(className, waiting && \"invisible\")}\n onLoad={(event) => {\n setWaiting(false);\n props.onLoad?.(event);\n }}\n onError={(event) => {\n if (attempt >= MAX_RETRIES) {\n setWaiting(false);\n onError?.(event);\n return;\n }\n setWaiting(true);\n timer.current = setTimeout(() => setAttempt(attempt + 1), RETRY_DELAY_MS);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/image.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport NextImage, { type ImageProps } from \"next/image\";\nimport { cn } from \"../utils/cn.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst RETRY_DELAY_MS = 5000;\nconst MAX_RETRIES = 6;\n\nexport default function Image({ onError, className, src, ...props }: ImageProps) {\n const resolveImage = useImageUrl();\n const shown = typeof src === \"string\" && src.startsWith(\"ipfs://\") ? (resolveImage(src) ?? src) : src;\n const [attempt, setAttempt] = useState(0);\n const [waiting, setWaiting] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n return (\n <NextImage\n key={attempt}\n {...props}\n src={shown}\n className={cn(className, waiting && \"invisible\")}\n onLoad={(event) => {\n setWaiting(false);\n props.onLoad?.(event);\n }}\n onError={(event) => {\n if (attempt >= MAX_RETRIES) {\n setWaiting(false);\n onError?.(event);\n return;\n }\n setWaiting(true);\n timer.current = setTimeout(() => setAttempt(attempt + 1), RETRY_DELAY_MS);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBI;AAlBJ,mBAA4C;AAC5C,mBAA2C;AAC3C,gBAAmB;AACnB,2BAA4B;AAE5B,MAAM,iBAAiB;AACvB,MAAM,cAAc;AAEL,SAAR,MAAuB,EAAE,SAAS,WAAW,KAAK,GAAG,MAAM,GAAe;AAC/E,QAAM,mBAAe,kCAAY;AACjC,QAAM,QAAQ,OAAO,QAAQ,YAAY,IAAI,WAAW,SAAS,IAAK,aAAa,GAAG,KAAK,MAAO;AAClG,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,CAAC;AACxC,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,KAAK;AAC5C,QAAM,YAAQ,qBAAkD,MAAS;AAEzE,8BAAU,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,CAAC,CAAC;AAErD,SACE;AAAA,IAAC,aAAAA;AAAA,IAAA;AAAA,MAEE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,eAAW,cAAG,WAAW,WAAW,WAAW;AAAA,MAC/C,QAAQ,CAAC,UAAU;AACjB,mBAAW,KAAK;AAChB,cAAM,SAAS,KAAK;AAAA,MACtB;AAAA,MACA,SAAS,CAAC,UAAU;AAClB,YAAI,WAAW,aAAa;AAC1B,qBAAW,KAAK;AAChB,oBAAU,KAAK;AACf;AAAA,QACF;AACA,mBAAW,IAAI;AACf,cAAM,UAAU,WAAW,MAAM,WAAW,UAAU,CAAC,GAAG,cAAc;AAAA,MAC1E;AAAA;AAAA,IAhBK;AAAA,EAiBP;AAEJ;","names":["NextImage"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ImageProps } from 'next/image';
|
|
3
3
|
|
|
4
|
-
declare function Image({ onError, className, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
|
|
4
|
+
declare function Image({ onError, className, src, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
6
6
|
export { Image as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ImageProps } from 'next/image';
|
|
3
3
|
|
|
4
|
-
declare function Image({ onError, className, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
|
|
4
|
+
declare function Image({ onError, className, src, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
6
6
|
export { Image as default };
|
package/dist/components/image.js
CHANGED
|
@@ -3,9 +3,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import NextImage from "next/image";
|
|
5
5
|
import { cn } from "../utils/cn.js";
|
|
6
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
6
7
|
const RETRY_DELAY_MS = 5e3;
|
|
7
8
|
const MAX_RETRIES = 6;
|
|
8
|
-
function Image({ onError, className, ...props }) {
|
|
9
|
+
function Image({ onError, className, src, ...props }) {
|
|
10
|
+
const resolveImage = useImageUrl();
|
|
11
|
+
const shown = typeof src === "string" && src.startsWith("ipfs://") ? resolveImage(src) ?? src : src;
|
|
9
12
|
const [attempt, setAttempt] = useState(0);
|
|
10
13
|
const [waiting, setWaiting] = useState(false);
|
|
11
14
|
const timer = useRef(void 0);
|
|
@@ -14,6 +17,7 @@ function Image({ onError, className, ...props }) {
|
|
|
14
17
|
NextImage,
|
|
15
18
|
{
|
|
16
19
|
...props,
|
|
20
|
+
src: shown,
|
|
17
21
|
className: cn(className, waiting && "invisible"),
|
|
18
22
|
onLoad: (event) => {
|
|
19
23
|
setWaiting(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/image.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport NextImage, { type ImageProps } from \"next/image\";\nimport { cn } from \"../utils/cn.js\";\n\nconst RETRY_DELAY_MS = 5000;\nconst MAX_RETRIES = 6;\n\nexport default function Image({ onError, className, ...props }: ImageProps) {\n const [attempt, setAttempt] = useState(0);\n const [waiting, setWaiting] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n return (\n <NextImage\n key={attempt}\n {...props}\n className={cn(className, waiting && \"invisible\")}\n onLoad={(event) => {\n setWaiting(false);\n props.onLoad?.(event);\n }}\n onError={(event) => {\n if (attempt >= MAX_RETRIES) {\n setWaiting(false);\n onError?.(event);\n return;\n }\n setWaiting(true);\n timer.current = setTimeout(() => setAttempt(attempt + 1), RETRY_DELAY_MS);\n }}\n />\n );\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/components/image.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport NextImage, { type ImageProps } from \"next/image\";\nimport { cn } from \"../utils/cn.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst RETRY_DELAY_MS = 5000;\nconst MAX_RETRIES = 6;\n\nexport default function Image({ onError, className, src, ...props }: ImageProps) {\n const resolveImage = useImageUrl();\n const shown = typeof src === \"string\" && src.startsWith(\"ipfs://\") ? (resolveImage(src) ?? src) : src;\n const [attempt, setAttempt] = useState(0);\n const [waiting, setWaiting] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n return (\n <NextImage\n key={attempt}\n {...props}\n src={shown}\n className={cn(className, waiting && \"invisible\")}\n onLoad={(event) => {\n setWaiting(false);\n props.onLoad?.(event);\n }}\n onError={(event) => {\n if (attempt >= MAX_RETRIES) {\n setWaiting(false);\n onError?.(event);\n return;\n }\n setWaiting(true);\n timer.current = setTimeout(() => setAttempt(attempt + 1), RETRY_DELAY_MS);\n }}\n />\n );\n}\n"],"mappings":";AAoBI;AAlBJ,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,OAAO,eAAoC;AAC3C,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAE5B,MAAM,iBAAiB;AACvB,MAAM,cAAc;AAEL,SAAR,MAAuB,EAAE,SAAS,WAAW,KAAK,GAAG,MAAM,GAAe;AAC/E,QAAM,eAAe,YAAY;AACjC,QAAM,QAAQ,OAAO,QAAQ,YAAY,IAAI,WAAW,SAAS,IAAK,aAAa,GAAG,KAAK,MAAO;AAClG,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,CAAC;AACxC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,QAAQ,OAAkD,MAAS;AAEzE,YAAU,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,CAAC,CAAC;AAErD,SACE;AAAA,IAAC;AAAA;AAAA,MAEE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,WAAW,GAAG,WAAW,WAAW,WAAW;AAAA,MAC/C,QAAQ,CAAC,UAAU;AACjB,mBAAW,KAAK;AAChB,cAAM,SAAS,KAAK;AAAA,MACtB;AAAA,MACA,SAAS,CAAC,UAAU;AAClB,YAAI,WAAW,aAAa;AAC1B,qBAAW,KAAK;AAChB,oBAAU,KAAK;AACf;AAAA,QACF;AACA,mBAAW,IAAI;AACf,cAAM,UAAU,WAAW,MAAM,WAAW,UAAU,CAAC,GAAG,cAAc;AAAA,MAC1E;AAAA;AAAA,IAhBK;AAAA,EAiBP;AAEJ;","names":[]}
|
|
@@ -15,7 +15,6 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
15
15
|
aiPolicy: z.ZodEnum<["Allowed", "Not Allowed", "Training Only"]>;
|
|
16
16
|
royalty: z.ZodNumber;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
value: string;
|
|
19
18
|
name: string;
|
|
20
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
21
20
|
licenseType: string;
|
|
@@ -25,11 +24,11 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
25
24
|
geographicScope: string;
|
|
26
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
27
26
|
royalty: number;
|
|
27
|
+
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
|
-
value: string;
|
|
33
32
|
name: string;
|
|
34
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
35
34
|
licenseType: string;
|
|
@@ -39,6 +38,7 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
39
38
|
geographicScope: string;
|
|
40
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
41
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -15,7 +15,6 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
15
15
|
aiPolicy: z.ZodEnum<["Allowed", "Not Allowed", "Training Only"]>;
|
|
16
16
|
royalty: z.ZodNumber;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
value: string;
|
|
19
18
|
name: string;
|
|
20
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
21
20
|
licenseType: string;
|
|
@@ -25,11 +24,11 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
25
24
|
geographicScope: string;
|
|
26
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
27
26
|
royalty: number;
|
|
27
|
+
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
|
-
value: string;
|
|
33
32
|
name: string;
|
|
34
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
35
34
|
licenseType: string;
|
|
@@ -39,6 +38,7 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
39
38
|
geographicScope: string;
|
|
40
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
41
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -49,11 +49,6 @@ var import_button = require("./button.js");
|
|
|
49
49
|
var import_currency_icon = require("./currency-icon.js");
|
|
50
50
|
var import_cn = require("../utils/cn.js");
|
|
51
51
|
var import_format = require("../utils/format.js");
|
|
52
|
-
var import_use_image_url = require("../utils/use-image-url.js");
|
|
53
|
-
function DialogImage({ src, alt, sizes }) {
|
|
54
|
-
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
55
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: resolveImage(src) ?? src, alt, fill: true, sizes, className: "object-cover", unoptimized: true });
|
|
56
|
-
}
|
|
57
52
|
function MarketplaceTxLink({ txHash, explorerUrl, className }) {
|
|
58
53
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
59
54
|
"a",
|
|
@@ -86,7 +81,7 @@ function MarketplaceProcessingState({
|
|
|
86
81
|
}) {
|
|
87
82
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center gap-5 p-6 py-8", children: [
|
|
88
83
|
imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative h-20 w-20 rounded-2xl overflow-hidden border border-border", children: [
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imageUrl, alt: imageAlt, fill: true, sizes: "80px", className: "object-cover", unoptimized: true }),
|
|
90
85
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-background/50 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-7 w-7 animate-spin text-primary" }) })
|
|
91
86
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-10 w-10 animate-spin text-primary" }),
|
|
92
87
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-center space-y-1", children: [
|
|
@@ -127,7 +122,7 @@ function MarketplaceErrorState({
|
|
|
127
122
|
}) {
|
|
128
123
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center gap-5 p-6 py-8", children: [
|
|
129
124
|
tokenImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: tokenImage, alt: name, fill: true, sizes: "128px", className: "object-cover", unoptimized: true }) }),
|
|
131
126
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute -bottom-2 -right-2 h-9 w-9 rounded-full bg-destructive flex items-center justify-center border-2 border-background", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-5 w-5 text-white" }) })
|
|
132
127
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-16 w-16 rounded-full bg-destructive/15 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-9 w-9 text-destructive" }) }),
|
|
133
128
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-center space-y-1 max-w-full", children: [
|
|
@@ -154,7 +149,7 @@ function MarketplaceDialogHero({
|
|
|
154
149
|
}) {
|
|
155
150
|
const name = tokenName || `Token #${tokenId}`;
|
|
156
151
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative flex justify-center pt-6 shrink-0", children: [
|
|
157
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: tokenImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: tokenImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: tokenImage, alt: name, fill: true, sizes: "128px", className: "object-cover", unoptimized: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent flex items-center justify-center", children: fallbackIcon }) }),
|
|
158
153
|
badge
|
|
159
154
|
] });
|
|
160
155
|
}
|
|
@@ -174,7 +169,7 @@ function OrderSummaryHero({
|
|
|
174
169
|
const stable = price ? (0, import_format.isStableCurrency)(price.currency) : false;
|
|
175
170
|
const face = "font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums";
|
|
176
171
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center pt-6 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center pt-6 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: image, alt: name, fill: true, sizes: "128px", className: "object-cover", unoptimized: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
178
173
|
"div",
|
|
179
174
|
{
|
|
180
175
|
className: (0, import_cn.cn)(
|
|
@@ -243,7 +238,7 @@ function DurationPicker({ options, value, onChange, disabled }) {
|
|
|
243
238
|
}
|
|
244
239
|
function ListingAssetSummary({ name, image, fallbackIcon, badge }) {
|
|
245
240
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex shrink-0 items-center gap-3.5 px-5 pb-1 pt-5 pr-12", children: [
|
|
246
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: image, alt: name, fill: true, sizes: "64px", className: "object-cover", unoptimized: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-full w-full items-center justify-center bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent", children: fallbackIcon }) }),
|
|
247
242
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 space-y-1.5", children: [
|
|
248
243
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "truncate text-base font-semibold leading-tight", children: name }),
|
|
249
244
|
badge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/marketplace-dialog-primitives.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport Image from \"./image.js\";\nimport { AlertCircle, ExternalLink, Loader2, Wallet } from \"lucide-react\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { Button } from \"./button.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice, isStableCurrency } from \"../utils/format.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nfunction DialogImage({ src, alt, sizes }: { src: string; alt: string; sizes: string }) {\n const resolveImage = useImageUrl();\n return <Image src={resolveImage(src) ?? src} alt={alt} fill sizes={sizes} className=\"object-cover\" unoptimized />;\n}\n\ninterface MarketplaceTxLinkProps {\n txHash: string;\n explorerUrl: string;\n className?: string;\n}\n\nexport function MarketplaceTxLink({ txHash, explorerUrl, className }: MarketplaceTxLinkProps) {\n return (\n <a\n href={`${explorerUrl}/tx/${txHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors\",\n className\n )}\n >\n <span className=\"tabular-nums\">{txHash.slice(0, 10)}…{txHash.slice(-8)}</span>\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n );\n}\n\ninterface MarketplaceProcessingStateProps {\n title: string;\n description?: string;\n imageUrl?: string | null;\n imageAlt?: string;\n txHash?: string | null;\n explorerUrl?: string;\n}\n\nexport function MarketplaceProcessingState({\n title,\n description = \"Keep this window open until it finishes.\",\n imageUrl,\n imageAlt = \"Token preview\",\n txHash,\n explorerUrl,\n}: MarketplaceProcessingStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {imageUrl ? (\n <div className=\"relative h-20 w-20 rounded-2xl overflow-hidden border border-border\">\n <DialogImage src={imageUrl} alt={imageAlt} sizes=\"80px\" />\n <div className=\"absolute inset-0 bg-background/50 flex items-center justify-center\">\n <Loader2 className=\"h-7 w-7 animate-spin text-primary\" />\n </div>\n </div>\n ) : (\n <Loader2 className=\"h-10 w-10 animate-spin text-primary\" />\n )}\n <div className=\"text-center space-y-1\">\n <p className=\"font-semibold\">{title}</p>\n {txHash && explorerUrl ? (\n <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} className=\"mt-1\" />\n ) : null}\n </div>\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n </div>\n );\n}\n\ninterface MarketplaceSignInGateProps {\n title: string;\n description: string;\n href: string;\n ctaLabel?: string;\n}\n\nexport function MarketplaceSignInGate({ title, description, href, ctaLabel = \"Set up account\" }: MarketplaceSignInGateProps) {\n return (\n <div className=\"flex flex-col items-center gap-4 p-6 py-10 text-center\">\n <Wallet className=\"h-10 w-10 text-muted-foreground\" />\n <div>\n <p className=\"font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{description}</p>\n </div>\n <div className=\"btn-border-animated w-full p-[1px] rounded-lg\">\n <Button\n asChild\n className=\"w-full bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all\"\n >\n <a href={href}>{ctaLabel}</a>\n </Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceErrorStateProps {\n tokenImage?: string | null;\n name: string;\n title: string;\n description: ReactNode;\n error?: string | null;\n txHash?: string | null;\n explorerUrl: string;\n onRetry?: () => void;\n onDone: () => void;\n doneLabel?: string;\n}\n\nexport function MarketplaceErrorState({\n tokenImage,\n name,\n title,\n description,\n error,\n txHash,\n explorerUrl,\n onRetry,\n onDone,\n doneLabel = \"Done\",\n}: MarketplaceErrorStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {tokenImage ? (\n <div className=\"relative\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden\">\n <DialogImage src={tokenImage} alt={name} sizes=\"128px\" />\n </div>\n <div className=\"absolute -bottom-2 -right-2 h-9 w-9 rounded-full bg-destructive flex items-center justify-center border-2 border-background\">\n <AlertCircle className=\"h-5 w-5 text-white\" />\n </div>\n </div>\n ) : (\n <div className=\"h-16 w-16 rounded-full bg-destructive/15 flex items-center justify-center\">\n <AlertCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n )}\n <div className=\"text-center space-y-1 max-w-full\">\n <p className=\"font-bold text-xl break-words\">{title}</p>\n <p className=\"text-sm text-muted-foreground break-words\">{description}</p>\n </div>\n {error ? (\n <Alert variant=\"destructive\" className=\"text-left\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n {txHash && <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} />}\n <div className=\"flex w-full gap-2\">\n {onRetry ? (\n <Button variant=\"outline\" className=\"flex-1 h-11\" onClick={onRetry}>\n Try again\n </Button>\n ) : null}\n <Button className=\"flex-1 h-11\" onClick={onDone}>{doneLabel}</Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceDialogHeroProps {\n tokenImage?: string | null;\n tokenName?: string;\n tokenId: string;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function MarketplaceDialogHero({\n tokenImage,\n tokenName,\n tokenId,\n fallbackIcon,\n badge,\n}: MarketplaceDialogHeroProps) {\n const name = tokenName || `Token #${tokenId}`;\n\n return (\n <div className=\"relative flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {tokenImage ? (\n <DialogImage src={tokenImage} alt={name} sizes=\"128px\" />\n ) : (\n <div className=\"h-full w-full bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent flex items-center justify-center\">\n {fallbackIcon}\n </div>\n )}\n </div>\n {badge}\n </div>\n );\n}\n\ninterface OrderSummaryHeroProps {\n name: string;\n image?: string | null;\n subtitle?: ReactNode;\n tone?: \"default\" | \"destructive\";\n price?: { formatted: string | null; currency: string | null; decimals: number } | null;\n quantity?: number;\n usdTotal?: string | null;\n}\n\nexport function OrderSummaryHero({\n name,\n image,\n subtitle,\n tone = \"default\",\n price: rawPrice,\n quantity = 1,\n usdTotal,\n}: OrderSummaryHeroProps) {\n const price = rawPrice?.formatted && rawPrice.currency\n ? { formatted: rawPrice.formatted, currency: rawPrice.currency, decimals: rawPrice.decimals }\n : null;\n const unit = price ? parseFloat(price.formatted) : null;\n const showTotal = unit !== null && quantity > 1;\n const crypto = price\n ? formatDisplayPrice(showTotal ? (unit! * quantity).toFixed(price.decimals <= 6 ? 2 : 4) : price.formatted)\n : \"\";\n const stable = price ? isStableCurrency(price.currency) : false;\n const face = \"font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums\";\n\n return (\n <div>\n <div className=\"flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {image ? (\n <DialogImage src={image} alt={name} sizes=\"128px\" />\n ) : (\n <div\n className={cn(\n \"h-full w-full bg-gradient-to-br to-transparent\",\n tone === \"destructive\"\n ? \"from-destructive/20 via-brand-rose/10\"\n : \"from-primary/20 via-brand-purple/10\",\n )}\n />\n )}\n </div>\n </div>\n\n <div className=\"flex items-center justify-between gap-4 px-5 pt-4 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{name}</p>\n {subtitle ? <div className=\"mt-1 text-2xs font-medium text-muted-foreground\">{subtitle}</div> : null}\n </div>\n {price ? (\n <div className=\"shrink-0 text-right\">\n {usdTotal ? (\n <p className={cn(face, \"text-2xl\")}>{usdTotal}</p>\n ) : (\n <p className={cn(\"flex items-center gap-2 justify-end text-2xl\", face)}>\n <span className=\"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={13} />\n </span>\n {crypto}\n </p>\n )}\n <p className=\"mt-0.5 inline-flex items-center justify-end gap-1.5 text-sm font-semibold text-muted-foreground\">\n {usdTotal ? (\n <span className=\"grid h-4 w-4 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={10} />\n </span>\n ) : null}\n {usdTotal ? (stable ? price.currency : `${crypto} ${price.currency}`) : price.currency}\n </p>\n {showTotal ? (\n <p className=\"mt-0.5 text-2xs text-muted-foreground/60\">\n {formatDisplayPrice(price.formatted)} × {quantity} {price.currency}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\ninterface CurrencyPickerProps {\n currencies: string[];\n value: string;\n onChange: (value: string) => void;\n disabled?: boolean;\n}\n\nexport function CurrencyPicker({ currencies, value, onChange, disabled }: CurrencyPickerProps) {\n return (\n <div className=\"grid grid-cols-5 gap-1.5\">\n {currencies.map((c) => (\n <Button\n key={c}\n type=\"button\"\n variant={value === c ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onChange(c)}\n disabled={disabled}\n className=\"gap-1 px-2 text-xs w-full\"\n >\n <CurrencyIcon symbol={c} size={13} className=\"shrink-0\" />\n <span className=\"truncate\">{c}</span>\n </Button>\n ))}\n </div>\n );\n}\n\ninterface DurationPickerProps {\n options: ReadonlyArray<{ label: string; seconds: number }>;\n value: number;\n onChange: (value: number) => void;\n disabled?: boolean;\n}\n\nexport function DurationPicker({ options, value, onChange, disabled }: DurationPickerProps) {\n return (\n <div className=\"grid grid-cols-3 gap-2\">\n {options.map((opt) => (\n <Button\n key={opt.label}\n type=\"button\"\n variant={value === opt.seconds ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onChange(opt.seconds)}\n disabled={disabled}\n className=\"text-xs\"\n >\n {opt.label}\n </Button>\n ))}\n </div>\n );\n}\n\ninterface ListingAssetSummaryProps {\n name: string;\n image?: string | null;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function ListingAssetSummary({ name, image, fallbackIcon, badge }: ListingAssetSummaryProps) {\n return (\n <div className=\"flex shrink-0 items-center gap-3.5 px-5 pb-1 pt-5 pr-12\">\n <div className=\"relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted\">\n {image ? (\n <DialogImage src={image} alt={name} sizes=\"64px\" />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent\">\n {fallbackIcon}\n </div>\n )}\n </div>\n <div className=\"min-w-0 space-y-1.5\">\n <p className=\"truncate text-base font-semibold leading-tight\">{name}</p>\n {badge}\n </div>\n </div>\n );\n}\n\ninterface MarketplaceConfirmStepProps {\n summary?: ReactNode;\n description: string;\n error?: string | null;\n secondaryLabel: string;\n onSecondary: () => void;\n primaryLabel: string;\n onPrimary: () => void;\n primaryDisabled?: boolean;\n primaryIcon?: ReactNode;\n primaryVariant?: \"default\" | \"destructive\";\n footer?: ReactNode;\n}\n\nexport function MarketplaceConfirmStep({\n summary,\n description,\n error,\n secondaryLabel,\n onSecondary,\n primaryLabel,\n onPrimary,\n primaryDisabled,\n primaryIcon,\n primaryVariant = \"default\",\n footer,\n}: MarketplaceConfirmStepProps) {\n const primaryButton = primaryVariant === \"destructive\" ? (\n <Button\n variant=\"destructive\"\n className=\"flex-1 h-11\"\n disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryLabel}\n </Button>\n ) : (\n <div\n className={cn(\n \"btn-border-animated p-[1px] rounded-xl flex-1\",\n primaryDisabled && \"pointer-events-none\"\n )}\n >\n <button\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryIcon}\n {primaryLabel}\n </button>\n </div>\n );\n\n return (\n <div className=\"px-6 pb-6 pt-3 space-y-4\">\n {summary}\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n {error ? (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n <div className=\"flex gap-2 pt-1\">\n <Button\n variant=\"outline\"\n className=\"h-11 flex-1 gap-1.5\"\n onClick={onSecondary}\n >\n {secondaryLabel}\n </Button>\n {primaryButton}\n </div>\n {footer}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcS;AAXT,mBAAkB;AAClB,0BAA2D;AAC3D,mBAAwC;AACxC,oBA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AAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,UAAU;AAAA,UACV,SAAS;AAAA,UAER;AAAA;AAAA,YACA;AAAA;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAGF,SACE,6CAAC,SAAI,WAAU,4BACZ;AAAA;AAAA,IACD,4CAAC,OAAE,WAAU,iCAAiC,uBAAY;AAAA,IACzD,QACC,6CAAC,sBAAM,SAAQ,eACb;AAAA,kDAAC,mCAAY,WAAU,WAAU;AAAA,MACjC,4CAAC,iCAAkB,iBAAM;AAAA,OAC3B,IACE;AAAA,IACJ,6CAAC,SAAI,WAAU,mBACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS;AAAA,UAER;AAAA;AAAA,MACH;AAAA,MACC;AAAA,OACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":["Image"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/marketplace-dialog-primitives.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport Image from \"./image.js\";\nimport { AlertCircle, ExternalLink, Loader2, Wallet } from \"lucide-react\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { Button } from \"./button.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice, isStableCurrency } from \"../utils/format.js\";\n\ninterface MarketplaceTxLinkProps {\n txHash: string;\n explorerUrl: string;\n className?: string;\n}\n\nexport function MarketplaceTxLink({ txHash, explorerUrl, className }: MarketplaceTxLinkProps) {\n return (\n <a\n href={`${explorerUrl}/tx/${txHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors\",\n className\n )}\n >\n <span className=\"tabular-nums\">{txHash.slice(0, 10)}…{txHash.slice(-8)}</span>\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n );\n}\n\ninterface MarketplaceProcessingStateProps {\n title: string;\n description?: string;\n imageUrl?: string | null;\n imageAlt?: string;\n txHash?: string | null;\n explorerUrl?: string;\n}\n\nexport function MarketplaceProcessingState({\n title,\n description = \"Keep this window open until it finishes.\",\n imageUrl,\n imageAlt = \"Token preview\",\n txHash,\n explorerUrl,\n}: MarketplaceProcessingStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {imageUrl ? (\n <div className=\"relative h-20 w-20 rounded-2xl overflow-hidden border border-border\">\n <Image src={imageUrl} alt={imageAlt} fill sizes=\"80px\" className=\"object-cover\" unoptimized />\n <div className=\"absolute inset-0 bg-background/50 flex items-center justify-center\">\n <Loader2 className=\"h-7 w-7 animate-spin text-primary\" />\n </div>\n </div>\n ) : (\n <Loader2 className=\"h-10 w-10 animate-spin text-primary\" />\n )}\n <div className=\"text-center space-y-1\">\n <p className=\"font-semibold\">{title}</p>\n {txHash && explorerUrl ? (\n <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} className=\"mt-1\" />\n ) : null}\n </div>\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n </div>\n );\n}\n\ninterface MarketplaceSignInGateProps {\n title: string;\n description: string;\n href: string;\n ctaLabel?: string;\n}\n\nexport function MarketplaceSignInGate({ title, description, href, ctaLabel = \"Set up account\" }: MarketplaceSignInGateProps) {\n return (\n <div className=\"flex flex-col items-center gap-4 p-6 py-10 text-center\">\n <Wallet className=\"h-10 w-10 text-muted-foreground\" />\n <div>\n <p className=\"font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{description}</p>\n </div>\n <div className=\"btn-border-animated w-full p-[1px] rounded-lg\">\n <Button\n asChild\n className=\"w-full bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all\"\n >\n <a href={href}>{ctaLabel}</a>\n </Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceErrorStateProps {\n tokenImage?: string | null;\n name: string;\n title: string;\n description: ReactNode;\n error?: string | null;\n txHash?: string | null;\n explorerUrl: string;\n onRetry?: () => void;\n onDone: () => void;\n doneLabel?: string;\n}\n\nexport function MarketplaceErrorState({\n tokenImage,\n name,\n title,\n description,\n error,\n txHash,\n explorerUrl,\n onRetry,\n onDone,\n doneLabel = \"Done\",\n}: MarketplaceErrorStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {tokenImage ? (\n <div className=\"relative\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden\">\n <Image src={tokenImage} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n </div>\n <div className=\"absolute -bottom-2 -right-2 h-9 w-9 rounded-full bg-destructive flex items-center justify-center border-2 border-background\">\n <AlertCircle className=\"h-5 w-5 text-white\" />\n </div>\n </div>\n ) : (\n <div className=\"h-16 w-16 rounded-full bg-destructive/15 flex items-center justify-center\">\n <AlertCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n )}\n <div className=\"text-center space-y-1 max-w-full\">\n <p className=\"font-bold text-xl break-words\">{title}</p>\n <p className=\"text-sm text-muted-foreground break-words\">{description}</p>\n </div>\n {error ? (\n <Alert variant=\"destructive\" className=\"text-left\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n {txHash && <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} />}\n <div className=\"flex w-full gap-2\">\n {onRetry ? (\n <Button variant=\"outline\" className=\"flex-1 h-11\" onClick={onRetry}>\n Try again\n </Button>\n ) : null}\n <Button className=\"flex-1 h-11\" onClick={onDone}>{doneLabel}</Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceDialogHeroProps {\n tokenImage?: string | null;\n tokenName?: string;\n tokenId: string;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function MarketplaceDialogHero({\n tokenImage,\n tokenName,\n tokenId,\n fallbackIcon,\n badge,\n}: MarketplaceDialogHeroProps) {\n const name = tokenName || `Token #${tokenId}`;\n\n return (\n <div className=\"relative flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {tokenImage ? (\n <Image src={tokenImage} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"h-full w-full bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent flex items-center justify-center\">\n {fallbackIcon}\n </div>\n )}\n </div>\n {badge}\n </div>\n );\n}\n\ninterface OrderSummaryHeroProps {\n name: string;\n image?: string | null;\n subtitle?: ReactNode;\n tone?: \"default\" | \"destructive\";\n price?: { formatted: string | null; currency: string | null; decimals: number } | null;\n quantity?: number;\n usdTotal?: string | null;\n}\n\nexport function OrderSummaryHero({\n name,\n image,\n subtitle,\n tone = \"default\",\n price: rawPrice,\n quantity = 1,\n usdTotal,\n}: OrderSummaryHeroProps) {\n const price = rawPrice?.formatted && rawPrice.currency\n ? { formatted: rawPrice.formatted, currency: rawPrice.currency, decimals: rawPrice.decimals }\n : null;\n const unit = price ? parseFloat(price.formatted) : null;\n const showTotal = unit !== null && quantity > 1;\n const crypto = price\n ? formatDisplayPrice(showTotal ? (unit! * quantity).toFixed(price.decimals <= 6 ? 2 : 4) : price.formatted)\n : \"\";\n const stable = price ? isStableCurrency(price.currency) : false;\n const face = \"font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums\";\n\n return (\n <div>\n <div className=\"flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n ) : (\n <div\n className={cn(\n \"h-full w-full bg-gradient-to-br to-transparent\",\n tone === \"destructive\"\n ? \"from-destructive/20 via-brand-rose/10\"\n : \"from-primary/20 via-brand-purple/10\",\n )}\n />\n )}\n </div>\n </div>\n\n <div className=\"flex items-center justify-between gap-4 px-5 pt-4 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{name}</p>\n {subtitle ? <div className=\"mt-1 text-2xs font-medium text-muted-foreground\">{subtitle}</div> : null}\n </div>\n {price ? (\n <div className=\"shrink-0 text-right\">\n {usdTotal ? (\n <p className={cn(face, \"text-2xl\")}>{usdTotal}</p>\n ) : (\n <p className={cn(\"flex items-center gap-2 justify-end text-2xl\", face)}>\n <span className=\"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={13} />\n </span>\n {crypto}\n </p>\n )}\n <p className=\"mt-0.5 inline-flex items-center justify-end gap-1.5 text-sm font-semibold text-muted-foreground\">\n {usdTotal ? (\n <span className=\"grid h-4 w-4 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={10} />\n </span>\n ) : null}\n {usdTotal ? (stable ? price.currency : `${crypto} ${price.currency}`) : price.currency}\n </p>\n {showTotal ? (\n <p className=\"mt-0.5 text-2xs text-muted-foreground/60\">\n {formatDisplayPrice(price.formatted)} × {quantity} {price.currency}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\ninterface CurrencyPickerProps {\n currencies: string[];\n value: string;\n onChange: (value: string) => void;\n disabled?: boolean;\n}\n\nexport function CurrencyPicker({ currencies, value, onChange, disabled }: CurrencyPickerProps) {\n return (\n <div className=\"grid grid-cols-5 gap-1.5\">\n {currencies.map((c) => (\n <Button\n key={c}\n type=\"button\"\n variant={value === c ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onChange(c)}\n disabled={disabled}\n className=\"gap-1 px-2 text-xs w-full\"\n >\n <CurrencyIcon symbol={c} size={13} className=\"shrink-0\" />\n <span className=\"truncate\">{c}</span>\n </Button>\n ))}\n </div>\n );\n}\n\ninterface DurationPickerProps {\n options: ReadonlyArray<{ label: string; seconds: number }>;\n value: number;\n onChange: (value: number) => void;\n disabled?: boolean;\n}\n\nexport function DurationPicker({ options, value, onChange, disabled }: DurationPickerProps) {\n return (\n <div className=\"grid grid-cols-3 gap-2\">\n {options.map((opt) => (\n <Button\n key={opt.label}\n type=\"button\"\n variant={value === opt.seconds ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onChange(opt.seconds)}\n disabled={disabled}\n className=\"text-xs\"\n >\n {opt.label}\n </Button>\n ))}\n </div>\n );\n}\n\ninterface ListingAssetSummaryProps {\n name: string;\n image?: string | null;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function ListingAssetSummary({ name, image, fallbackIcon, badge }: ListingAssetSummaryProps) {\n return (\n <div className=\"flex shrink-0 items-center gap-3.5 px-5 pb-1 pt-5 pr-12\">\n <div className=\"relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"64px\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent\">\n {fallbackIcon}\n </div>\n )}\n </div>\n <div className=\"min-w-0 space-y-1.5\">\n <p className=\"truncate text-base font-semibold leading-tight\">{name}</p>\n {badge}\n </div>\n </div>\n );\n}\n\ninterface MarketplaceConfirmStepProps {\n summary?: ReactNode;\n description: string;\n error?: string | null;\n secondaryLabel: string;\n onSecondary: () => void;\n primaryLabel: string;\n onPrimary: () => void;\n primaryDisabled?: boolean;\n primaryIcon?: ReactNode;\n primaryVariant?: \"default\" | \"destructive\";\n footer?: ReactNode;\n}\n\nexport function MarketplaceConfirmStep({\n summary,\n description,\n error,\n secondaryLabel,\n onSecondary,\n primaryLabel,\n onPrimary,\n primaryDisabled,\n primaryIcon,\n primaryVariant = \"default\",\n footer,\n}: MarketplaceConfirmStepProps) {\n const primaryButton = primaryVariant === \"destructive\" ? (\n <Button\n variant=\"destructive\"\n className=\"flex-1 h-11\"\n disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryLabel}\n </Button>\n ) : (\n <div\n className={cn(\n \"btn-border-animated p-[1px] rounded-xl flex-1\",\n primaryDisabled && \"pointer-events-none\"\n )}\n >\n <button\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryIcon}\n {primaryLabel}\n </button>\n </div>\n );\n\n return (\n <div className=\"px-6 pb-6 pt-3 space-y-4\">\n {summary}\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n {error ? (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n <div className=\"flex gap-2 pt-1\">\n <Button\n variant=\"outline\"\n className=\"h-11 flex-1 gap-1.5\"\n onClick={onSecondary}\n >\n {secondaryLabel}\n </Button>\n {primaryButton}\n </div>\n {footer}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BM;AAzBN,mBAAkB;AAClB,0BAA2D;AAC3D,mBAAwC;AACxC,oBAAuB;AACvB,2BAA6B;AAC7B,gBAAmB;AACnB,oBAAqD;AAQ9C,SAAS,kBAAkB,EAAE,QAAQ,aAAa,UAAU,GAA2B;AAC5F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,GAAG,WAAW,OAAO,MAAM;AAAA,MACjC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,eAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,qDAAC,UAAK,WAAU,gBAAgB;AAAA,iBAAO,MAAM,GAAG,EAAE;AAAA,UAAE;AAAA,UAAE,OAAO,MAAM,EAAE;AAAA,WAAE;AAAA,QACvE,4CAAC,oCAAa,WAAU,WAA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AI,WAAU,mBACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS;AAAA,UAER;AAAA;AAAA,MACH;AAAA,MACC;AAAA,OACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":["Image"]}
|
|
@@ -7,11 +7,6 @@ import { Button } from "./button.js";
|
|
|
7
7
|
import { CurrencyIcon } from "./currency-icon.js";
|
|
8
8
|
import { cn } from "../utils/cn.js";
|
|
9
9
|
import { formatDisplayPrice, isStableCurrency } from "../utils/format.js";
|
|
10
|
-
import { useImageUrl } from "../utils/use-image-url.js";
|
|
11
|
-
function DialogImage({ src, alt, sizes }) {
|
|
12
|
-
const resolveImage = useImageUrl();
|
|
13
|
-
return /* @__PURE__ */ jsx(Image, { src: resolveImage(src) ?? src, alt, fill: true, sizes, className: "object-cover", unoptimized: true });
|
|
14
|
-
}
|
|
15
10
|
function MarketplaceTxLink({ txHash, explorerUrl, className }) {
|
|
16
11
|
return /* @__PURE__ */ jsxs(
|
|
17
12
|
"a",
|
|
@@ -44,7 +39,7 @@ function MarketplaceProcessingState({
|
|
|
44
39
|
}) {
|
|
45
40
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-5 p-6 py-8", children: [
|
|
46
41
|
imageUrl ? /* @__PURE__ */ jsxs("div", { className: "relative h-20 w-20 rounded-2xl overflow-hidden border border-border", children: [
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
42
|
+
/* @__PURE__ */ jsx(Image, { src: imageUrl, alt: imageAlt, fill: true, sizes: "80px", className: "object-cover", unoptimized: true }),
|
|
48
43
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/50 flex items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "h-7 w-7 animate-spin text-primary" }) })
|
|
49
44
|
] }) : /* @__PURE__ */ jsx(Loader2, { className: "h-10 w-10 animate-spin text-primary" }),
|
|
50
45
|
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-1", children: [
|
|
@@ -85,7 +80,7 @@ function MarketplaceErrorState({
|
|
|
85
80
|
}) {
|
|
86
81
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-5 p-6 py-8", children: [
|
|
87
82
|
tokenImage ? /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
88
|
-
/* @__PURE__ */ jsx("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
83
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden", children: /* @__PURE__ */ jsx(Image, { src: tokenImage, alt: name, fill: true, sizes: "128px", className: "object-cover", unoptimized: true }) }),
|
|
89
84
|
/* @__PURE__ */ jsx("div", { className: "absolute -bottom-2 -right-2 h-9 w-9 rounded-full bg-destructive flex items-center justify-center border-2 border-background", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-white" }) })
|
|
90
85
|
] }) : /* @__PURE__ */ jsx("div", { className: "h-16 w-16 rounded-full bg-destructive/15 flex items-center justify-center", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-9 w-9 text-destructive" }) }),
|
|
91
86
|
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-1 max-w-full", children: [
|
|
@@ -112,7 +107,7 @@ function MarketplaceDialogHero({
|
|
|
112
107
|
}) {
|
|
113
108
|
const name = tokenName || `Token #${tokenId}`;
|
|
114
109
|
return /* @__PURE__ */ jsxs("div", { className: "relative flex justify-center pt-6 shrink-0", children: [
|
|
115
|
-
/* @__PURE__ */ jsx("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: tokenImage ? /* @__PURE__ */ jsx(
|
|
110
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: tokenImage ? /* @__PURE__ */ jsx(Image, { src: tokenImage, alt: name, fill: true, sizes: "128px", className: "object-cover", unoptimized: true }) : /* @__PURE__ */ jsx("div", { className: "h-full w-full bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent flex items-center justify-center", children: fallbackIcon }) }),
|
|
116
111
|
badge
|
|
117
112
|
] });
|
|
118
113
|
}
|
|
@@ -132,7 +127,7 @@ function OrderSummaryHero({
|
|
|
132
127
|
const stable = price ? isStableCurrency(price.currency) : false;
|
|
133
128
|
const face = "font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums";
|
|
134
129
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
135
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-center pt-6 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: image ? /* @__PURE__ */ jsx(
|
|
130
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center pt-6 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "relative h-32 w-32 rounded-2xl overflow-hidden bg-muted", children: image ? /* @__PURE__ */ jsx(Image, { src: image, alt: name, fill: true, sizes: "128px", className: "object-cover", unoptimized: true }) : /* @__PURE__ */ jsx(
|
|
136
131
|
"div",
|
|
137
132
|
{
|
|
138
133
|
className: cn(
|
|
@@ -201,7 +196,7 @@ function DurationPicker({ options, value, onChange, disabled }) {
|
|
|
201
196
|
}
|
|
202
197
|
function ListingAssetSummary({ name, image, fallbackIcon, badge }) {
|
|
203
198
|
return /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-3.5 px-5 pb-1 pt-5 pr-12", children: [
|
|
204
|
-
/* @__PURE__ */ jsx("div", { className: "relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted", children: image ? /* @__PURE__ */ jsx(
|
|
199
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted", children: image ? /* @__PURE__ */ jsx(Image, { src: image, alt: name, fill: true, sizes: "64px", className: "object-cover", unoptimized: true }) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent", children: fallbackIcon }) }),
|
|
205
200
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1.5", children: [
|
|
206
201
|
/* @__PURE__ */ jsx("p", { className: "truncate text-base font-semibold leading-tight", children: name }),
|
|
207
202
|
badge
|