@medialane/ui 0.244.0 → 0.246.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/launchpad/coin-create.cjs +424 -0
- package/dist/components/launchpad/coin-create.cjs.map +1 -0
- package/dist/components/launchpad/coin-create.d.cts +10 -0
- package/dist/components/launchpad/coin-create.d.ts +10 -0
- package/dist/components/launchpad/coin-create.js +402 -0
- package/dist/components/launchpad/coin-create.js.map +1 -0
- package/dist/components/pop-burn-button.cjs +65 -0
- package/dist/components/pop-burn-button.cjs.map +1 -0
- package/dist/components/pop-burn-button.d.cts +10 -0
- package/dist/components/pop-burn-button.d.ts +10 -0
- package/dist/components/pop-burn-button.js +41 -0
- package/dist/components/pop-burn-button.js.map +1 -0
- package/dist/components/pop-claim-button.cjs +92 -0
- package/dist/components/pop-claim-button.cjs.map +1 -0
- package/dist/components/pop-claim-button.d.cts +7 -0
- package/dist/components/pop-claim-button.d.ts +7 -0
- package/dist/components/pop-claim-button.js +68 -0
- package/dist/components/pop-claim-button.js.map +1 -0
- package/dist/components/portfolio-sponsorships.cjs +209 -0
- package/dist/components/portfolio-sponsorships.cjs.map +1 -0
- package/dist/components/portfolio-sponsorships.d.cts +5 -0
- package/dist/components/portfolio-sponsorships.d.ts +5 -0
- package/dist/components/portfolio-sponsorships.js +175 -0
- package/dist/components/portfolio-sponsorships.js.map +1 -0
- package/dist/components/sponsorship-offer-page.cjs +181 -0
- package/dist/components/sponsorship-offer-page.cjs.map +1 -0
- package/dist/components/sponsorship-offer-page.d.cts +7 -0
- package/dist/components/sponsorship-offer-page.d.ts +7 -0
- package/dist/components/sponsorship-offer-page.js +147 -0
- package/dist/components/sponsorship-offer-page.js.map +1 -0
- package/dist/components/sponsorship-offers-page.cjs +118 -0
- package/dist/components/sponsorship-offers-page.cjs.map +1 -0
- package/dist/components/sponsorship-offers-page.d.cts +5 -0
- package/dist/components/sponsorship-offers-page.d.ts +5 -0
- package/dist/components/sponsorship-offers-page.js +84 -0
- package/dist/components/sponsorship-offers-page.js.map +1 -0
- package/dist/components/transaction-done.cjs +46 -0
- package/dist/components/transaction-done.cjs.map +1 -0
- package/dist/components/transaction-done.d.cts +18 -0
- package/dist/components/transaction-done.d.ts +18 -0
- package/dist/components/transaction-done.js +22 -0
- package/dist/components/transaction-done.js.map +1 -0
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/sponsorship-offer-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Handshake, ImageIcon, Loader2 } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, normalizeAddress } from \"@medialane/sdk\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Image from \"./image.js\";\nimport { Input } from \"./input.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionDone } from \"./transaction-done.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useSponsorshipBids, useSponsorshipOffer } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\ntype Action = \"bid\" | \"accept\";\n\nconst COPY = {\n bid: { title: \"Place bid\", working: \"Placing your bid…\", done: \"Bid placed!\", description: \"Your bid is now on-chain.\" },\n accept: { title: \"Accept bid\", working: \"Accepting the bid…\", done: \"Bid accepted!\", description: \"The license is minted to the sponsor.\" },\n} as const;\n\nexport function SponsorshipOfferPage({ offerId }: { offerId: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const resolveImage = useImageUrl();\n const { offer, isLoading, mutate: mutateOffer } = useSponsorshipOffer(offerId);\n const { bids, isLoading: bidsLoading, mutate: mutateBids } = useSponsorshipBids(offerId);\n const { token } = useToken(offer?.nftContract ?? \"\", offer?.tokenId ?? \"\");\n const tx = useTransaction();\n const [action, setAction] = useState<Action>(\"bid\");\n const [amount, setAmount] = useState(\"\");\n const [activeSponsor, setActiveSponsor] = useState<string | null>(null);\n\n useEffect(() => {\n if (tx.phase !== \"success\") return;\n setAmount(\"\");\n void Promise.all([mutateOffer(), mutateBids()]);\n }, [tx.phase, mutateOffer, mutateBids]);\n\n if (isLoading) {\n return <div className=\"max-w-3xl mx-auto px-4 pt-24 pb-8 text-center text-sm text-muted-foreground\">Loading offer…</div>;\n }\n if (!offer) {\n return <div className=\"max-w-3xl mx-auto px-4 pt-24 pb-8 text-center text-sm text-muted-foreground\">Offer not found.</div>;\n }\n\n const isOwner = !!walletAddress && normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", offer.author);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n const name = token?.metadata?.name ?? `Token #${offer.tokenId}`;\n const imageUrl = resolveImage(token?.metadata?.image);\n const minDisplay = paymentToken ? `${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : offer.minAmount;\n const format = (value: string) => (paymentToken ? `${formatAmount(value, paymentToken.decimals)} ${paymentToken.symbol}` : value);\n\n const placeBid = () => {\n if (!walletAddress || !paymentToken) return;\n setAction(\"bid\");\n void tx.run(async (signer) => {\n const value = BigInt(Math.round(Number(amount) * 10 ** paymentToken.decimals));\n await runIntentCalls(signer, () =>\n app.getClient().api.intents.create(\"sponsorship-bid\", { sponsor: walletAddress, offerId: offer.offerId, amount: value.toString(), paymentToken: offer.paymentToken }),\n );\n });\n };\n\n const acceptBid = (sponsor: string) => {\n if (!walletAddress) return;\n setAction(\"accept\");\n setActiveSponsor(sponsor);\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().api.intents.create(\"sponsorship-bid-accept\", { author: walletAddress, offerId: offer.offerId, sponsor }),\n );\n })\n .finally(() => setActiveSponsor(null));\n };\n\n const copy = COPY[action];\n\n return (\n <div className=\"pb-16\">\n <TransactionDialog tx={tx} title={copy.title} workingLabel={copy.working} firstStepLabel=\"Prepare\">\n <TransactionDone\n tx={tx}\n name={name}\n title={copy.done}\n description={copy.description}\n footer={action === \"bid\" ? <RewardEarned actionType=\"place_sponsorship_bid\" /> : undefined}\n />\n </TransactionDialog>\n\n <section className=\"px-4 pt-10 max-w-3xl mx-auto space-y-6\">\n <BackButton fallbackHref=\"/launchpad/sponsorship\" />\n <FadeIn>\n <ServiceHeader plain icon={<Handshake className=\"h-4 w-4 text-white\" />} title={name} subtitle={offer.open ? \"Open for bids\" : \"Closed\"} />\n </FadeIn>\n\n <FadeIn>\n <div className=\"rounded-2xl border border-border/40 overflow-hidden\">\n <div className=\"relative aspect-square bg-muted/40\">\n {imageUrl ? (\n <Image src={imageUrl} alt={name} fill sizes=\"(min-width: 768px) 768px, 100vw\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"h-full w-full flex items-center justify-center\">\n <ImageIcon className=\"h-8 w-8 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n <div className=\"p-5 grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm\">\n <div>\n <p className=\"text-xs text-muted-foreground\">Minimum bid</p>\n <p className=\"font-semibold\">{minDisplay}</p>\n </div>\n <div>\n <p className=\"text-xs text-muted-foreground\">License length</p>\n <p className=\"font-semibold\">{Math.round(Number(offer.duration) / 86400)} days</p>\n </div>\n <div>\n <p className=\"text-xs text-muted-foreground\">Resale royalty</p>\n <p className=\"font-semibold\">{(offer.royaltyBps / 100).toFixed(1)}%</p>\n </div>\n <div>\n <p className=\"text-xs text-muted-foreground\">Owner</p>\n <p className=\"font-semibold\">{shortenAddress(offer.author)}</p>\n </div>\n </div>\n </div>\n </FadeIn>\n\n {!offer.open ? (\n <FadeIn>\n <p className=\"text-sm text-muted-foreground text-center py-6\">This offer is no longer open.</p>\n </FadeIn>\n ) : isOwner ? (\n <FadeIn>\n <div className=\"space-y-3\">\n <p className=\"text-sm font-semibold\">Bids</p>\n {bidsLoading ? (\n <p className=\"text-xs text-muted-foreground\">Loading bids…</p>\n ) : bids.length === 0 ? (\n <p className=\"text-xs text-muted-foreground\">No bids yet.</p>\n ) : (\n <div className=\"space-y-2\">\n {bids.map((bid) => (\n <div key={bid.id} className=\"flex items-center justify-between gap-3 rounded-xl border border-border/30 p-3\">\n <div>\n <p className=\"text-sm font-medium\">{shortenAddress(bid.sponsor)}</p>\n <p className=\"text-xs text-muted-foreground\">{format(bid.amount)}</p>\n </div>\n <Button size=\"sm\" className=\"bg-brand-rose hover:brightness-110 text-white\" disabled={busy} onClick={() => acceptBid(bid.sponsor)}>\n {busy && activeSponsor === bid.sponsor ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : \"Accept\"}\n </Button>\n </div>\n ))}\n </div>\n )}\n </div>\n </FadeIn>\n ) : (\n <FadeIn>\n <div className=\"space-y-2\">\n <p className=\"text-sm font-semibold\">Place a bid</p>\n <div className=\"flex gap-2\">\n <Input type=\"number\" min={0} step=\"0.01\" placeholder=\"Your bid\" value={amount} onChange={(e) => setAmount(e.target.value)} disabled={busy} />\n <Button className=\"bg-brand-rose hover:brightness-110 text-white shrink-0\" disabled={busy || !walletAddress || !paymentToken || !amount || Number(amount) <= 0} onClick={placeBid}>\n {busy ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : \"Place bid\"}\n </Button>\n </div>\n {!walletAddress && (\n <button type=\"button\" className=\"text-xs text-muted-foreground underline\" onClick={app.onRequireWallet}>\n {app.connectLabel ?? \"Connect\"} to place a bid\n </button>\n )}\n {!paymentToken && <p className=\"text-xs text-destructive\">This offer uses a currency the app does not support yet.</p>}\n <p className=\"text-xs text-muted-foreground\">\n Placing a bid approves the offer's payment token — no funds move until the owner accepts.\n </p>\n </div>\n </FadeIn>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";AAgDW,cAsEG,YAtEH;AA9CX,SAAS,WAAW,gBAAgB;AACpC,SAAS,WAAW,WAAW,eAAe;AAC9C,SAAS,cAAc,mBAAmB,wBAAwB;AAClE,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,OAAO,WAAW;AAClB,SAAS,aAAa;AACtB,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB,2BAA2B;AACxD,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAI/B,MAAM,OAAO;AAAA,EACX,KAAK,EAAE,OAAO,aAAa,SAAS,0BAAqB,MAAM,eAAe,aAAa,4BAA4B;AAAA,EACvH,QAAQ,EAAE,OAAO,cAAc,SAAS,2BAAsB,MAAM,iBAAiB,aAAa,wCAAwC;AAC5I;AAEO,SAAS,qBAAqB,EAAE,QAAQ,GAAwB;AACrE,QAAM,MAAM,gBAAgB;AAC5B,QAAM,gBAAgB,IAAI;AAC1B,QAAM,eAAe,YAAY;AACjC,QAAM,EAAE,OAAO,WAAW,QAAQ,YAAY,IAAI,oBAAoB,OAAO;AAC7E,QAAM,EAAE,MAAM,WAAW,aAAa,QAAQ,WAAW,IAAI,mBAAmB,OAAO;AACvF,QAAM,EAAE,MAAM,IAAI,SAAS,OAAO,eAAe,IAAI,OAAO,WAAW,EAAE;AACzE,QAAM,KAAK,eAAe;AAC1B,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAiB,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E;AAAA,aACnE;AAAA,UACA,oBAAC,UAAO,MAAK,MAAK,WAAU,iDAAgD,UAAU,MAAM,SAAS,MAAM,UAAU,IAAI,OAAO,GAC7H,kBAAQ,kBAAkB,IAAI,UAAU,oBAAC,WAAQ,WAAU,4BAA2B,IAAK,UAC9F;AAAA,aAPQ,IAAI,EAQd,CACD,GACH;AAAA,SAEJ,GACF,IAEA,oBAAC,UACC,+BAAC,SAAI,WAAU,aACb;AAAA,4BAAC,OAAE,WAAU,yBAAwB,yBAAW;AAAA,QAChD,qBAAC,SAAI,WAAU,cACb;AAAA,8BAAC,SAAM,MAAK,UAAS,KAAK,GAAG,MAAK,QAAO,aAAY,YAAW,OAAO,QAAQ,UAAU,CAAC,MAAM,UAAU,EAAE,OAAO,KAAK,GAAG,UAAU,MAAM;AAAA,UAC3I,oBAAC,UAAO,WAAU,0DAAyD,UAAU,QAAQ,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,UAAU,OAAO,MAAM,KAAK,GAAG,SAAS,UACtK,iBAAO,oBAAC,WAAQ,WAAU,wBAAuB,IAAK,aACzD;AAAA,WACF;AAAA,QACC,CAAC,iBACA,qBAAC,YAAO,MAAK,UAAS,WAAU,2CAA0C,SAAS,IAAI,iBACpF;AAAA,cAAI,gBAAgB;AAAA,UAAU;AAAA,WACjC;AAAA,QAED,CAAC,gBAAgB,oBAAC,OAAE,WAAU,4BAA2B,sEAAwD;AAAA,QAClH,oBAAC,OAAE,WAAU,iCAAgC,4GAE7C;AAAA,SACF,GACF;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,118 @@
|
|
|
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 sponsorship_offers_page_exports = {};
|
|
31
|
+
__export(sponsorship_offers_page_exports, {
|
|
32
|
+
SponsorshipOffersPage: () => SponsorshipOffersPage
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(sponsorship_offers_page_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_lucide_react = require("lucide-react");
|
|
37
|
+
var import_sdk = require("@medialane/sdk");
|
|
38
|
+
var import_asset_card = require("./asset-card.js");
|
|
39
|
+
var import_back_button = require("./back-button.js");
|
|
40
|
+
var import_button = require("./button.js");
|
|
41
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
42
|
+
var import_motion_primitives = require("./motion-primitives.js");
|
|
43
|
+
var import_service_header = require("./service-header.js");
|
|
44
|
+
var import_address = require("../utils/address.js");
|
|
45
|
+
var import_use_sponsorship = require("../utils/use-sponsorship.js");
|
|
46
|
+
var import_use_tokens = require("../utils/use-tokens.js");
|
|
47
|
+
const FEATURES = [
|
|
48
|
+
"No escrow \u2014 direct settlement",
|
|
49
|
+
"Owner-verified on-chain",
|
|
50
|
+
"Open bidding or one invited sponsor"
|
|
51
|
+
];
|
|
52
|
+
function OfferCard({ offer }) {
|
|
53
|
+
const { token } = (0, import_use_tokens.useToken)(offer.nftContract, offer.tokenId);
|
|
54
|
+
const paymentToken = (0, import_sdk.getTokenByAddress)(offer.paymentToken);
|
|
55
|
+
const min = paymentToken ? `Min ${(0, import_sdk.formatAmount)(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;
|
|
56
|
+
const days = Math.round(Number(offer.duration) / 86400);
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
import_asset_card.AssetCard,
|
|
59
|
+
{
|
|
60
|
+
href: `/launchpad/sponsorship/${offer.offerId}`,
|
|
61
|
+
name: token?.metadata?.name ?? `Token #${offer.tokenId}`,
|
|
62
|
+
image: token?.metadata?.image ?? null,
|
|
63
|
+
subtitle: (0, import_address.shortenAddress)(offer.nftContract),
|
|
64
|
+
fallbackId: offer.tokenId,
|
|
65
|
+
price: { formatted: `${min} \xB7 ${days}d`, currency: null }
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function SponsorshipOffersPage() {
|
|
70
|
+
const { offers, isLoading } = (0, import_use_sponsorship.useSponsorshipOffers)();
|
|
71
|
+
const openOffers = offers.filter((o) => o.open);
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pb-16 space-y-10", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "px-4 pt-10 max-w-5xl mx-auto", children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.BackButton, {}),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-6", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
import_service_header.ServiceHeader,
|
|
77
|
+
{
|
|
78
|
+
plain: true,
|
|
79
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, { className: "h-4 w-4 text-white" }),
|
|
80
|
+
title: "IP Sponsorship",
|
|
81
|
+
subtitle: "Sponsorship offers anchored to your IP assets \u2014 a sponsor bids, you accept, they receive a license."
|
|
82
|
+
}
|
|
83
|
+
) }) })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground", children: [
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-3 w-3 text-brand-rose shrink-0" }),
|
|
87
|
+
f
|
|
88
|
+
] }, f)) }) }) }),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-0.5", children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: "Start a sponsorship deal" }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor." })
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, size: "sm", className: "shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/sponsorship/create", children: [
|
|
95
|
+
"Get started",
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3.5 w-3.5" })
|
|
97
|
+
] }) })
|
|
98
|
+
] }) }) }),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "px-4 space-y-4 max-w-5xl mx-auto", children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "section-label", children: "Open" }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-xl font-bold mt-0.5", children: "Sponsorship offers" })
|
|
103
|
+
] }) }),
|
|
104
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_card.AssetCardSkeleton, {}, i)) }) : openOffers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell border-dashed p-12 text-center space-y-4", children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, { className: "h-8 w-8 text-brand-rose/30" }) }) }),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold text-sm", children: "No open sponsorship offers yet" }),
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Creators open offers from their asset pages \u2014 sponsors bid on them here." })
|
|
109
|
+
] })
|
|
110
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.Stagger, { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: openOffers.map((offer) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.StaggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OfferCard, { offer }) }, offer.id)) })
|
|
111
|
+
] })
|
|
112
|
+
] });
|
|
113
|
+
}
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {
|
|
116
|
+
SponsorshipOffersPage
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=sponsorship-offers-page.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\n\nconst FEATURES = [\n \"No escrow — direct settlement\",\n \"Owner-verified on-chain\",\n \"Open bidding or one invited sponsor\",\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title=\"IP Sponsorship\"\n subtitle=\"Sponsorship offers anchored to your IP assets — a sponsor bids, you accept, they receive a license.\"\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {f}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">Start a sponsorship deal</p>\n <p className=\"text-xs text-muted-foreground\">\n Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor.\n </p>\n </div>\n <Button asChild size=\"sm\" className=\"shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5\">\n <Link href=\"/launchpad/sponsorship/create\">\n Get started\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </Button>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">Open</p>\n <h2 className=\"text-xl font-bold mt-0.5\">Sponsorship offers</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <div className=\"h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center\">\n <Handshake className=\"h-8 w-8 text-brand-rose/30\" />\n </div>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">No open sponsorship offers yet</p>\n <p className=\"text-xs text-muted-foreground\">Creators open offers from their asset pages — sponsors bid on them here.</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BI;AAzBJ,0BAA6C;AAC7C,iBAA0E;AAC1E,wBAA6C;AAC7C,yBAA2B;AAC3B,oBAAuB;AACvB,kBAAiB;AACjB,+BAA6C;AAC7C,4BAA8B;AAC9B,qBAA+B;AAC/B,6BAAqC;AACrC,wBAAyB;AAEzB,MAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,QAAI,4BAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,mBAAe,8BAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,WAAO,yBAAa,MAAM,WAAW,aAAa,QAAQ,CAAC,IAAI,aAAa,MAAM,KAAK,OAAO,MAAM,SAAS;AACxI,QAAM,OAAO,KAAK,MAAM,OAAO,MAAM,QAAQ,IAAI,KAAK;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,0BAA0B,MAAM,OAAO;AAAA,MAC7C,MAAM,OAAO,UAAU,QAAQ,UAAU,MAAM,OAAO;AAAA,MACtD,OAAO,OAAO,UAAU,SAAS;AAAA,MACjC,cAAU,+BAAe,MAAM,WAAW;AAAA,MAC1C,YAAY,MAAM;AAAA,MAClB,OAAO,EAAE,WAAW,GAAG,GAAG,SAAM,IAAI,KAAK,UAAU,KAAK;AAAA;AAAA,EAC1D;AAEJ;AAEO,SAAS,wBAAwB;AACtC,QAAM,EAAE,QAAQ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AE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,4CAAC,yCAAuB,CAAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,4CAAC,mCACC,uDAAC,SAAI,WAAU,uDACb;AAAA,oDAAC,SAAI,WAAU,uBACb,sDAAC,SAAI,WAAU,0EACb,sDAAC,iCAAU,WAAU,8BAA6B,GACpD,GACF;AAAA,QACA,6CAAC,SAAI,WAAU,aACb;AAAA,sDAAC,OAAE,WAAU,yBAAwB,4CAA8B;AAAA,UACnE,4CAAC,OAAE,WAAU,iCAAgC,2FAAwE;AAAA,WACvH;AAAA,SACF,GACF,IAEA,4CAAC,oCAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,4CAAC,wCACC,sDAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowRight, Check, Handshake } from "lucide-react";
|
|
4
|
+
import { formatAmount, getTokenByAddress } from "@medialane/sdk";
|
|
5
|
+
import { AssetCard, AssetCardSkeleton } from "./asset-card.js";
|
|
6
|
+
import { BackButton } from "./back-button.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
import Link from "./link.js";
|
|
9
|
+
import { FadeIn, Stagger, StaggerItem } from "./motion-primitives.js";
|
|
10
|
+
import { ServiceHeader } from "./service-header.js";
|
|
11
|
+
import { shortenAddress } from "../utils/address.js";
|
|
12
|
+
import { useSponsorshipOffers } from "../utils/use-sponsorship.js";
|
|
13
|
+
import { useToken } from "../utils/use-tokens.js";
|
|
14
|
+
const FEATURES = [
|
|
15
|
+
"No escrow \u2014 direct settlement",
|
|
16
|
+
"Owner-verified on-chain",
|
|
17
|
+
"Open bidding or one invited sponsor"
|
|
18
|
+
];
|
|
19
|
+
function OfferCard({ offer }) {
|
|
20
|
+
const { token } = useToken(offer.nftContract, offer.tokenId);
|
|
21
|
+
const paymentToken = getTokenByAddress(offer.paymentToken);
|
|
22
|
+
const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;
|
|
23
|
+
const days = Math.round(Number(offer.duration) / 86400);
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
AssetCard,
|
|
26
|
+
{
|
|
27
|
+
href: `/launchpad/sponsorship/${offer.offerId}`,
|
|
28
|
+
name: token?.metadata?.name ?? `Token #${offer.tokenId}`,
|
|
29
|
+
image: token?.metadata?.image ?? null,
|
|
30
|
+
subtitle: shortenAddress(offer.nftContract),
|
|
31
|
+
fallbackId: offer.tokenId,
|
|
32
|
+
price: { formatted: `${min} \xB7 ${days}d`, currency: null }
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function SponsorshipOffersPage() {
|
|
37
|
+
const { offers, isLoading } = useSponsorshipOffers();
|
|
38
|
+
const openOffers = offers.filter((o) => o.open);
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", { className: "pb-16 space-y-10", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("section", { className: "px-4 pt-10 max-w-5xl mx-auto", children: [
|
|
41
|
+
/* @__PURE__ */ jsx(BackButton, {}),
|
|
42
|
+
/* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
|
|
43
|
+
ServiceHeader,
|
|
44
|
+
{
|
|
45
|
+
plain: true,
|
|
46
|
+
icon: /* @__PURE__ */ jsx(Handshake, { className: "h-4 w-4 text-white" }),
|
|
47
|
+
title: "IP Sponsorship",
|
|
48
|
+
subtitle: "Sponsorship offers anchored to your IP assets \u2014 a sponsor bids, you accept, they receive a license."
|
|
49
|
+
}
|
|
50
|
+
) }) })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground", children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-brand-rose shrink-0" }),
|
|
54
|
+
f
|
|
55
|
+
] }, f)) }) }) }),
|
|
56
|
+
/* @__PURE__ */ jsx("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: "Start a sponsorship deal" }),
|
|
59
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor." })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, size: "sm", className: "shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/sponsorship/create", children: [
|
|
62
|
+
"Get started",
|
|
63
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-3.5 w-3.5" })
|
|
64
|
+
] }) })
|
|
65
|
+
] }) }) }),
|
|
66
|
+
/* @__PURE__ */ jsxs("section", { className: "px-4 space-y-4 max-w-5xl mx-auto", children: [
|
|
67
|
+
/* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "section-label", children: "Open" }),
|
|
69
|
+
/* @__PURE__ */ jsx("h2", { className: "text-xl font-bold mt-0.5", children: "Sponsorship offers" })
|
|
70
|
+
] }) }),
|
|
71
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx(AssetCardSkeleton, {}, i)) }) : openOffers.length === 0 ? /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "bento-cell border-dashed p-12 text-center space-y-4", children: [
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center", children: /* @__PURE__ */ jsx(Handshake, { className: "h-8 w-8 text-brand-rose/30" }) }) }),
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
74
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-sm", children: "No open sponsorship offers yet" }),
|
|
75
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Creators open offers from their asset pages \u2014 sponsors bid on them here." })
|
|
76
|
+
] })
|
|
77
|
+
] }) }) : /* @__PURE__ */ jsx(Stagger, { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: openOffers.map((offer) => /* @__PURE__ */ jsx(StaggerItem, { children: /* @__PURE__ */ jsx(OfferCard, { offer }) }, offer.id)) })
|
|
78
|
+
] })
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
SponsorshipOffersPage
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=sponsorship-offers-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\n\nconst FEATURES = [\n \"No escrow — direct settlement\",\n \"Owner-verified on-chain\",\n \"Open bidding or one invited sponsor\",\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title=\"IP Sponsorship\"\n subtitle=\"Sponsorship offers anchored to your IP assets — a sponsor bids, you accept, they receive a license.\"\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {f}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">Start a sponsorship deal</p>\n <p className=\"text-xs text-muted-foreground\">\n Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor.\n </p>\n </div>\n <Button asChild size=\"sm\" className=\"shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5\">\n <Link href=\"/launchpad/sponsorship/create\">\n Get started\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </Button>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">Open</p>\n <h2 className=\"text-xl font-bold mt-0.5\">Sponsorship offers</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <div className=\"h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center\">\n <Handshake className=\"h-8 w-8 text-brand-rose/30\" />\n </div>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">No open sponsorship offers yet</p>\n <p className=\"text-xs text-muted-foreground\">Creators open offers from their asset pages — sponsors bid on them here.</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";AA2BI,cAiBE,YAjBF;AAzBJ,SAAS,YAAY,OAAO,iBAAiB;AAC7C,SAAS,cAAc,yBAAmD;AAC1E,SAAS,WAAW,yBAAyB;AAC7C,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,QAAQ,SAAS,mBAAmB;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AAEzB,MAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,IAAI,SAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,eAAe,kBAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,OAAO,aAAa,MAAM,WAAW,aAAa,QAAQ,CAAC,IAAI,aAAa,MAAM,KAAK,OAAO,MAAM,SAAS;AACxI,QAAM,OAAO,KAAK,MAAM,OAAO,MAAM,QAAQ,IAAI,KAAK;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,0BAA0B,MAAM,OAAO;AAAA,MAC7C,MAAM,OAAO,UAAU,QAAQ,UAAU,MAAM,OAAO;AAAA,MACtD,OAAO,OAAO,UAAU,SAAS;AAAA,MACjC,UAAU,eAAe,MAAM,WAAW;AAAA,MAC1C,YAAY,MAAM;AAAA,MAClB,OAAO,EAAE,WAAW,GAAG,GAAG,SAAM,IAAI,KAAK,UAAU,KAAK;AAAA;AAAA,EAC1D;AAEJ;AAEO,SAAS,wBAAwB;AACtC,QAAM,EAAE,QAAQ,UAAU,IAAI,qBAAqB;AACnD,QAAM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AAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,oBAAC,UACC,+BAAC,SAAI,WAAU,uDACb;AAAA,4BAAC,SAAI,WAAU,uBACb,8BAAC,SAAI,WAAU,0EACb,8BAAC,aAAU,WAAU,8BAA6B,GACpD,GACF;AAAA,QACA,qBAAC,SAAI,WAAU,aACb;AAAA,8BAAC,OAAE,WAAU,yBAAwB,4CAA8B;AAAA,UACnE,oBAAC,OAAE,WAAU,iCAAgC,2FAAwE;AAAA,WACvH;AAAA,SACF,GACF,IAEA,oBAAC,WAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,oBAAC,eACC,8BAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 transaction_done_exports = {};
|
|
21
|
+
__export(transaction_done_exports, {
|
|
22
|
+
TransactionDone: () => TransactionDone
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(transaction_done_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_marketplace_dialog_primitives = require("./marketplace-dialog-primitives.js");
|
|
27
|
+
var import_explorer_url = require("../utils/explorer-url.js");
|
|
28
|
+
function TransactionDone({ tx, name, title, description, footer }) {
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
30
|
+
import_marketplace_dialog_primitives.MarketplaceSuccessState,
|
|
31
|
+
{
|
|
32
|
+
name,
|
|
33
|
+
title,
|
|
34
|
+
description,
|
|
35
|
+
txHash: tx.txHash,
|
|
36
|
+
explorerUrl: import_explorer_url.EXPLORER_URL,
|
|
37
|
+
footer,
|
|
38
|
+
onDone: tx.reset
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
TransactionDone
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=transaction-done.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/transaction-done.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { MarketplaceSuccessState } from \"./marketplace-dialog-primitives.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDoneProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"txHash\" | \"reset\">;\n name: string;\n title: string;\n description: ReactNode;\n footer?: ReactNode;\n}\n\nexport function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps) {\n return (\n <MarketplaceSuccessState\n name={name}\n title={title}\n description={description}\n txHash={tx.txHash}\n explorerUrl={EXPLORER_URL}\n footer={footer}\n onDone={tx.reset}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBI;AAdJ,2CAAwC;AACxC,0BAA6B;AAWtB,SAAS,gBAAgB,EAAE,IAAI,MAAM,OAAO,aAAa,OAAO,GAAyB;AAC9F,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,GAAG;AAAA,MACX,aAAa;AAAA,MACb;AAAA,MACA,QAAQ,GAAG;AAAA;AAAA,EACb;AAEJ;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { useTransaction } from '../utils/use-transaction.cjs';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.cjs';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
|
|
9
|
+
interface TransactionDoneProps {
|
|
10
|
+
tx: Pick<ReturnType<typeof useTransaction>, "txHash" | "reset">;
|
|
11
|
+
name: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: ReactNode;
|
|
14
|
+
footer?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { TransactionDone, type TransactionDoneProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { useTransaction } from '../utils/use-transaction.js';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.js';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
|
|
9
|
+
interface TransactionDoneProps {
|
|
10
|
+
tx: Pick<ReturnType<typeof useTransaction>, "txHash" | "reset">;
|
|
11
|
+
name: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: ReactNode;
|
|
14
|
+
footer?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { TransactionDone, type TransactionDoneProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { MarketplaceSuccessState } from "./marketplace-dialog-primitives.js";
|
|
4
|
+
import { EXPLORER_URL } from "../utils/explorer-url.js";
|
|
5
|
+
function TransactionDone({ tx, name, title, description, footer }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
MarketplaceSuccessState,
|
|
8
|
+
{
|
|
9
|
+
name,
|
|
10
|
+
title,
|
|
11
|
+
description,
|
|
12
|
+
txHash: tx.txHash,
|
|
13
|
+
explorerUrl: EXPLORER_URL,
|
|
14
|
+
footer,
|
|
15
|
+
onDone: tx.reset
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
TransactionDone
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=transaction-done.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/transaction-done.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { MarketplaceSuccessState } from \"./marketplace-dialog-primitives.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDoneProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"txHash\" | \"reset\">;\n name: string;\n title: string;\n description: ReactNode;\n footer?: ReactNode;\n}\n\nexport function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps) {\n return (\n <MarketplaceSuccessState\n name={name}\n title={title}\n description={description}\n txHash={tx.txHash}\n explorerUrl={EXPLORER_URL}\n footer={footer}\n onDone={tx.reset}\n />\n );\n}\n"],"mappings":";AAiBI;AAdJ,SAAS,+BAA+B;AACxC,SAAS,oBAAoB;AAWtB,SAAS,gBAAgB,EAAE,IAAI,MAAM,OAAO,aAAa,OAAO,GAAyB;AAC9F,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,GAAG;AAAA,MACX,aAAa;AAAA,MACb;AAAA,MACA,QAAQ,GAAG;AAAA;AAAA,EACb;AAEJ;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -82,6 +82,7 @@ __export(index_exports, {
|
|
|
82
82
|
ClaimRouteShell: () => import_claim_route_shell.ClaimRouteShell,
|
|
83
83
|
ClubOwnerActions: () => import_club_owner_actions.ClubOwnerActions,
|
|
84
84
|
CoinAvatar: () => import_coin_row.CoinAvatar,
|
|
85
|
+
CoinCreate: () => import_coin_create.CoinCreate,
|
|
85
86
|
CoinGuarantees: () => import_coin_guarantees.CoinGuarantees,
|
|
86
87
|
CoinLaunchPreview: () => import_coin_launch_preview.CoinLaunchPreview,
|
|
87
88
|
CoinRow: () => import_coin_row.CoinRow,
|
|
@@ -290,6 +291,8 @@ __export(index_exports, {
|
|
|
290
291
|
PageBackdrop: () => import_media_header.PageBackdrop,
|
|
291
292
|
PageContainer: () => import_page_container.PageContainer,
|
|
292
293
|
ParentAttributionBanner: () => import_parent_attribution_banner.ParentAttributionBanner,
|
|
294
|
+
PopBurnButton: () => import_pop_burn_button.PopBurnButton,
|
|
295
|
+
PopClaimButton: () => import_pop_claim_button.PopClaimButton,
|
|
293
296
|
PopCreate: () => import_pop_create.PopCreate,
|
|
294
297
|
PopMyEventsPage: () => import_pop_my_events_page.PopMyEventsPage,
|
|
295
298
|
Popover: () => import_popover.Popover,
|
|
@@ -304,6 +307,7 @@ __export(index_exports, {
|
|
|
304
307
|
PortfolioOrders: () => import_portfolio_orders.PortfolioOrders,
|
|
305
308
|
PortfolioSection: () => import_portfolio_section.PortfolioSection,
|
|
306
309
|
PortfolioShell: () => import_portfolio_shell.PortfolioShell,
|
|
310
|
+
PortfolioSponsorships: () => import_portfolio_sponsorships.PortfolioSponsorships,
|
|
307
311
|
PriceHistoryChart: () => import_price_history_chart.PriceHistoryChart,
|
|
308
312
|
QUERY_PREFIX: () => import_query_keys.QUERY_PREFIX,
|
|
309
313
|
RESEND_COOLDOWN_SECONDS: () => import_email_code.RESEND_COOLDOWN_SECONDS,
|
|
@@ -354,6 +358,8 @@ __export(index_exports, {
|
|
|
354
358
|
SingleEditionMint: () => import_single_edition_mint.SingleEditionMint,
|
|
355
359
|
Skeleton: () => import_skeleton.Skeleton,
|
|
356
360
|
SponsorshipCreate: () => import_sponsorship_create.SponsorshipCreate,
|
|
361
|
+
SponsorshipOfferPage: () => import_sponsorship_offer_page.SponsorshipOfferPage,
|
|
362
|
+
SponsorshipOffersPage: () => import_sponsorship_offers_page.SponsorshipOffersPage,
|
|
357
363
|
Stagger: () => import_motion_primitives.Stagger,
|
|
358
364
|
StaggerItem: () => import_motion_primitives.StaggerItem,
|
|
359
365
|
StatPill: () => import_stat_tile.StatPill,
|
|
@@ -380,6 +386,7 @@ __export(index_exports, {
|
|
|
380
386
|
TokenCardSkeleton: () => import_token_card.TokenCardSkeleton,
|
|
381
387
|
TokenGlyph: () => import_token_glyph.TokenGlyph,
|
|
382
388
|
TransactionDialog: () => import_transaction_dialog.TransactionDialog,
|
|
389
|
+
TransactionDone: () => import_transaction_done.TransactionDone,
|
|
383
390
|
UserFacingError: () => import_describe_error.UserFacingError,
|
|
384
391
|
WalletRequired: () => import_wallet_required.WalletRequired,
|
|
385
392
|
WrongNetworkError: () => import_wallet_error.WrongNetworkError,
|
|
@@ -737,6 +744,13 @@ var import_ip_type_page = require("./components/ip-type-page.js");
|
|
|
737
744
|
var import_collections_page = require("./components/collections-page.js");
|
|
738
745
|
var import_sponsorship_create = require("./components/launchpad/sponsorship-create.js");
|
|
739
746
|
var import_pop_create = require("./components/launchpad/pop-create.js");
|
|
747
|
+
var import_pop_claim_button = require("./components/pop-claim-button.js");
|
|
748
|
+
var import_pop_burn_button = require("./components/pop-burn-button.js");
|
|
749
|
+
var import_sponsorship_offers_page = require("./components/sponsorship-offers-page.js");
|
|
750
|
+
var import_sponsorship_offer_page = require("./components/sponsorship-offer-page.js");
|
|
751
|
+
var import_portfolio_sponsorships = require("./components/portfolio-sponsorships.js");
|
|
752
|
+
var import_transaction_done = require("./components/transaction-done.js");
|
|
753
|
+
var import_coin_create = require("./components/launchpad/coin-create.js");
|
|
740
754
|
var import_wallet_required = require("./components/wallet-required.js");
|
|
741
755
|
var import_claim_route_shell = require("./components/claim-route-shell.js");
|
|
742
756
|
var import_use_launchpad_image_upload = require("./utils/use-launchpad-image-upload.js");
|
|
@@ -892,6 +906,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
892
906
|
ClaimRouteShell,
|
|
893
907
|
ClubOwnerActions,
|
|
894
908
|
CoinAvatar,
|
|
909
|
+
CoinCreate,
|
|
895
910
|
CoinGuarantees,
|
|
896
911
|
CoinLaunchPreview,
|
|
897
912
|
CoinRow,
|
|
@@ -1100,6 +1115,8 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1100
1115
|
PageBackdrop,
|
|
1101
1116
|
PageContainer,
|
|
1102
1117
|
ParentAttributionBanner,
|
|
1118
|
+
PopBurnButton,
|
|
1119
|
+
PopClaimButton,
|
|
1103
1120
|
PopCreate,
|
|
1104
1121
|
PopMyEventsPage,
|
|
1105
1122
|
Popover,
|
|
@@ -1114,6 +1131,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1114
1131
|
PortfolioOrders,
|
|
1115
1132
|
PortfolioSection,
|
|
1116
1133
|
PortfolioShell,
|
|
1134
|
+
PortfolioSponsorships,
|
|
1117
1135
|
PriceHistoryChart,
|
|
1118
1136
|
QUERY_PREFIX,
|
|
1119
1137
|
RESEND_COOLDOWN_SECONDS,
|
|
@@ -1164,6 +1182,8 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1164
1182
|
SingleEditionMint,
|
|
1165
1183
|
Skeleton,
|
|
1166
1184
|
SponsorshipCreate,
|
|
1185
|
+
SponsorshipOfferPage,
|
|
1186
|
+
SponsorshipOffersPage,
|
|
1167
1187
|
Stagger,
|
|
1168
1188
|
StaggerItem,
|
|
1169
1189
|
StatPill,
|
|
@@ -1190,6 +1210,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1190
1210
|
TokenCardSkeleton,
|
|
1191
1211
|
TokenGlyph,
|
|
1192
1212
|
TransactionDialog,
|
|
1213
|
+
TransactionDone,
|
|
1193
1214
|
UserFacingError,
|
|
1194
1215
|
WalletRequired,
|
|
1195
1216
|
WrongNetworkError,
|