@medialane/ui 0.205.1 → 0.207.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/back-button.cjs +47 -0
- package/dist/components/back-button.cjs.map +1 -0
- package/dist/components/back-button.d.cts +7 -0
- package/dist/components/back-button.d.ts +7 -0
- package/dist/components/back-button.js +23 -0
- package/dist/components/back-button.js.map +1 -0
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/collection-page.cjs +2 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +2 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/creator-header.cjs +1 -7
- package/dist/components/creator-header.cjs.map +1 -1
- package/dist/components/creator-header.js +1 -7
- package/dist/components/creator-header.js.map +1 -1
- package/dist/components/creator-page.cjs +206 -0
- package/dist/components/creator-page.cjs.map +1 -0
- package/dist/components/creator-page.d.cts +16 -0
- package/dist/components/creator-page.d.ts +16 -0
- package/dist/components/creator-page.js +172 -0
- package/dist/components/creator-page.js.map +1 -0
- package/dist/components/drops-page.cjs +54 -0
- package/dist/components/drops-page.cjs.map +1 -0
- package/dist/components/drops-page.d.cts +5 -0
- package/dist/components/drops-page.d.ts +5 -0
- package/dist/components/drops-page.js +30 -0
- package/dist/components/drops-page.js.map +1 -0
- package/dist/components/editions-page.cjs +195 -0
- package/dist/components/editions-page.cjs.map +1 -0
- package/dist/components/editions-page.d.cts +5 -0
- package/dist/components/editions-page.d.ts +5 -0
- package/dist/components/editions-page.js +169 -0
- package/dist/components/editions-page.js.map +1 -0
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/launchpad-page.cjs +77 -0
- package/dist/components/launchpad-page.cjs.map +1 -0
- package/dist/components/launchpad-page.d.cts +11 -0
- package/dist/components/launchpad-page.d.ts +11 -0
- package/dist/components/launchpad-page.js +53 -0
- package/dist/components/launchpad-page.js.map +1 -0
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +4 -0
- package/dist/components/medialane-app.d.ts +4 -0
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/{collection-more-menu.cjs → more-menu.cjs} +7 -7
- package/dist/components/more-menu.cjs.map +1 -0
- package/dist/components/{collection-more-menu.d.cts → more-menu.d.cts} +2 -2
- package/dist/components/{collection-more-menu.d.ts → more-menu.d.ts} +2 -2
- package/dist/components/{collection-more-menu.js → more-menu.js} +3 -3
- package/dist/components/more-menu.js.map +1 -0
- package/dist/components/pop-my-events-page.cjs +100 -0
- package/dist/components/pop-my-events-page.cjs.map +1 -0
- package/dist/components/pop-my-events-page.d.cts +5 -0
- package/dist/components/pop-my-events-page.d.ts +5 -0
- package/dist/components/pop-my-events-page.js +66 -0
- package/dist/components/pop-my-events-page.js.map +1 -0
- package/dist/components/remix-browse-page.cjs +154 -0
- package/dist/components/remix-browse-page.cjs.map +1 -0
- package/dist/components/remix-browse-page.d.cts +5 -0
- package/dist/components/remix-browse-page.d.ts +5 -0
- package/dist/components/remix-browse-page.js +120 -0
- package/dist/components/remix-browse-page.js.map +1 -0
- package/dist/components/service-collections-page.cjs +113 -0
- package/dist/components/service-collections-page.cjs.map +1 -0
- package/dist/components/service-collections-page.d.cts +37 -0
- package/dist/components/service-collections-page.d.ts +37 -0
- package/dist/components/service-collections-page.js +79 -0
- package/dist/components/service-collections-page.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sign-in-prompt.cjs +43 -0
- package/dist/components/sign-in-prompt.cjs.map +1 -0
- package/dist/components/sign-in-prompt.d.cts +10 -0
- package/dist/components/sign-in-prompt.d.ts +10 -0
- package/dist/components/sign-in-prompt.js +19 -0
- package/dist/components/sign-in-prompt.js.map +1 -0
- package/dist/components/token-card.cjs +6 -3
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +6 -3
- package/dist/components/token-card.js.map +1 -1
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/use-profiles.cjs +11 -0
- package/dist/utils/use-profiles.cjs.map +1 -1
- package/dist/utils/use-profiles.d.cts +6 -1
- package/dist/utils/use-profiles.d.ts +6 -1
- package/dist/utils/use-profiles.js +10 -0
- package/dist/utils/use-profiles.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/collection-more-menu.cjs.map +0 -1
- package/dist/components/collection-more-menu.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface LaunchpadPageProps {
|
|
5
|
+
fastMint: ReactNode;
|
|
6
|
+
hideGroups?: string[];
|
|
7
|
+
excludeKeys?: string[];
|
|
8
|
+
}
|
|
9
|
+
declare function LaunchpadPage({ fastMint, hideGroups, excludeKeys }: LaunchpadPageProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { LaunchpadPage, type LaunchpadPageProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { getService } from "@medialane/sdk";
|
|
5
|
+
import { FadeIn } from "./motion-primitives.js";
|
|
6
|
+
import { LaunchpadGroupedSections, LAUNCHPAD_ROUTE_OVERRIDES, useLaunchpadFilter } from "./launchpad-services.js";
|
|
7
|
+
import { LaunchpadFilterBar } from "./launchpad-filter-bar.js";
|
|
8
|
+
import { useMedialaneApp } from "./medialane-app.js";
|
|
9
|
+
import { useCollectionsByOwner } from "../utils/use-collections.js";
|
|
10
|
+
function LaunchpadPage({ fastMint, hideGroups = [], excludeKeys }) {
|
|
11
|
+
const { walletAddress } = useMedialaneApp();
|
|
12
|
+
const filter = useLaunchpadFilter();
|
|
13
|
+
const { collections } = useCollectionsByOwner(walletAddress);
|
|
14
|
+
const overrides = useMemo(() => {
|
|
15
|
+
const nftCount = collections.filter((c) => getService(c.service)?.id === "mip-erc721").length;
|
|
16
|
+
const editionsCount = collections.filter((c) => c.standard === "ERC1155").length;
|
|
17
|
+
const withMeta = (key, count) => count > 0 ? { [key]: { ...LAUNCHPAD_ROUTE_OVERRIDES[key], meta: `${count} collection${count === 1 ? "" : "s"}` } } : {};
|
|
18
|
+
return { ...LAUNCHPAD_ROUTE_OVERRIDES, ...withMeta("nfts", nftCount), ...withMeta("limited-editions", editionsCount) };
|
|
19
|
+
}, [collections]);
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative pb-20 space-y-16 sm:space-y-24", children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("section", { className: "max-w-[1400px] mx-auto px-4 sm:px-6 lg:px-8 pt-20 sm:pt-24 space-y-6", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl sm:text-4xl font-semibold leading-tight", children: "Creator Launchpad" }) }),
|
|
23
|
+
/* @__PURE__ */ jsx(FadeIn, { delay: 0.06, children: fastMint })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsxs("section", { className: "max-w-[1400px] mx-auto px-4 sm:px-6 lg:px-8 space-y-6", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("h2", { className: "text-3xl sm:text-4xl font-semibold leading-tight", children: "Launchpad Services" }) }),
|
|
27
|
+
/* @__PURE__ */ jsx(FadeIn, { delay: 0.06, children: /* @__PURE__ */ jsx(
|
|
28
|
+
LaunchpadFilterBar,
|
|
29
|
+
{
|
|
30
|
+
query: filter.query,
|
|
31
|
+
onQueryChange: filter.setQuery,
|
|
32
|
+
groups: filter.filterableGroups.filter((g) => !hideGroups.includes(g.key)),
|
|
33
|
+
activeGroups: filter.activeGroups,
|
|
34
|
+
onToggleGroup: filter.toggleGroup
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
LaunchpadGroupedSections,
|
|
39
|
+
{
|
|
40
|
+
overrides,
|
|
41
|
+
query: filter.query,
|
|
42
|
+
activeGroups: filter.activeGroups,
|
|
43
|
+
onClearFilters: filter.clear,
|
|
44
|
+
excludeKeys
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] })
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
LaunchpadPage
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=launchpad-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/launchpad-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo, type ReactNode } from \"react\";\nimport { getService } from \"@medialane/sdk\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { LaunchpadGroupedSections, LAUNCHPAD_ROUTE_OVERRIDES, useLaunchpadFilter, type ServiceOverrides } from \"./launchpad-services.js\";\nimport { LaunchpadFilterBar } from \"./launchpad-filter-bar.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useCollectionsByOwner } from \"../utils/use-collections.js\";\n\nexport interface LaunchpadPageProps {\n fastMint: ReactNode;\n hideGroups?: string[];\n excludeKeys?: string[];\n}\n\nexport function LaunchpadPage({ fastMint, hideGroups = [], excludeKeys }: LaunchpadPageProps) {\n const { walletAddress } = useMedialaneApp();\n const filter = useLaunchpadFilter();\n const { collections } = useCollectionsByOwner(walletAddress);\n\n const overrides = useMemo<ServiceOverrides>(() => {\n const nftCount = collections.filter((c) => getService(c.service)?.id === \"mip-erc721\").length;\n const editionsCount = collections.filter((c) => c.standard === \"ERC1155\").length;\n const withMeta = (key: string, count: number): ServiceOverrides =>\n count > 0 ? { [key]: { ...LAUNCHPAD_ROUTE_OVERRIDES[key], meta: `${count} collection${count === 1 ? \"\" : \"s\"}` } } : {};\n return { ...LAUNCHPAD_ROUTE_OVERRIDES, ...withMeta(\"nfts\", nftCount), ...withMeta(\"limited-editions\", editionsCount) };\n }, [collections]);\n\n return (\n <div className=\"relative pb-20 space-y-16 sm:space-y-24\">\n <section className=\"max-w-[1400px] mx-auto px-4 sm:px-6 lg:px-8 pt-20 sm:pt-24 space-y-6\">\n <FadeIn>\n <h1 className=\"text-3xl sm:text-4xl font-semibold leading-tight\">Creator Launchpad</h1>\n </FadeIn>\n <FadeIn delay={0.06}>{fastMint}</FadeIn>\n </section>\n\n <section className=\"max-w-[1400px] mx-auto px-4 sm:px-6 lg:px-8 space-y-6\">\n <FadeIn>\n <h2 className=\"text-3xl sm:text-4xl font-semibold leading-tight\">Launchpad Services</h2>\n </FadeIn>\n <FadeIn delay={0.06}>\n <LaunchpadFilterBar\n query={filter.query}\n onQueryChange={filter.setQuery}\n groups={filter.filterableGroups.filter((g) => !hideGroups.includes(g.key))}\n activeGroups={filter.activeGroups}\n onToggleGroup={filter.toggleGroup}\n />\n </FadeIn>\n <LaunchpadGroupedSections\n overrides={overrides}\n query={filter.query}\n activeGroups={filter.activeGroups}\n onClearFilters={filter.clear}\n excludeKeys={excludeKeys}\n />\n </section>\n </div>\n );\n}\n"],"mappings":";AA+BM,SAEI,KAFJ;AA7BN,SAAS,eAA+B;AACxC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,0BAA0B,2BAA2B,0BAAiD;AAC/G,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AAQ/B,SAAS,cAAc,EAAE,UAAU,aAAa,CAAC,GAAG,YAAY,GAAuB;AAC5F,QAAM,EAAE,cAAc,IAAI,gBAAgB;AAC1C,QAAM,SAAS,mBAAmB;AAClC,QAAM,EAAE,YAAY,IAAI,sBAAsB,aAAa;AAE3D,QAAM,YAAY,QAA0B,MAAM;AAChD,UAAM,WAAW,YAAY,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,YAAY,EAAE;AACvF,UAAM,gBAAgB,YAAY,OAAO,CAAC,MAAM,EAAE,aAAa,SAAS,EAAE;AAC1E,UAAM,WAAW,CAAC,KAAa,UAC7B,QAAQ,IAAI,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,0BAA0B,GAAG,GAAG,MAAM,GAAG,KAAK,cAAc,UAAU,IAAI,KAAK,GAAG,GAAG,EAAE,IAAI,CAAC;AACxH,WAAO,EAAE,GAAG,2BAA2B,GAAG,SAAS,QAAQ,QAAQ,GAAG,GAAG,SAAS,oBAAoB,aAAa,EAAE;AAAA,EACvH,GAAG,CAAC,WAAW,CAAC;AAEhB,SACE,qBAAC,SAAI,WAAU,2CACb;AAAA,yBAAC,aAAQ,WAAU,wEACjB;AAAA,0BAAC,UACC,8BAAC,QAAG,WAAU,oDAAmD,+BAAiB,GACpF;AAAA,MACA,oBAAC,UAAO,OAAO,MAAO,oBAAS;AAAA,OACjC;AAAA,IAEA,qBAAC,aAAQ,WAAU,yDACjB;AAAA,0BAAC,UACC,8BAAC,QAAG,WAAU,oDAAmD,gCAAkB,GACrF;AAAA,MACA,oBAAC,UAAO,OAAO,MACb;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,OAAO;AAAA,UACd,eAAe,OAAO;AAAA,UACtB,QAAQ,OAAO,iBAAiB,OAAO,CAAC,MAAM,CAAC,WAAW,SAAS,EAAE,GAAG,CAAC;AAAA,UACzE,cAAc,OAAO;AAAA,UACrB,eAAe,OAAO;AAAA;AAAA,MACxB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,OAAO,OAAO;AAAA,UACd,cAAc,OAAO;AAAA,UACrB,gBAAgB,OAAO;AAAA,UACvB;AAAA;AAAA,MACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string }\n | { type: \"CREATOR\"; address: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCS;AAtCT,mBAAgG;AAmCzF,MAAM,0BAAsB,4BAAmC,IAAI;AAEnE,SAAS,qBAAqB,EAAE,OAAO,SAAS,GAAiD;AACtG,SAAO,4CAAC,oBAAoB,UAApB,EAA6B,OAAe,UAAS;AAC/D;AAEO,SAAS,kBAAgC;AAC9C,QAAM,UAAM,yBAAW,mBAAmB;AAC1C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,8BAA8B;AACxD,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentType, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string }\n | { type: \"CREATOR\"; address: string; name?: string };\n\nexport type ReportDialogSlot = ComponentType<{ open: boolean; onOpenChange: (open: boolean) => void; target: ReportTarget }>;\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n connectLabel?: string;\n connectDescription?: string;\n companion?: CompanionApp;\n ReportDialog?: ReportDialogSlot;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";AAwCS;AAtCT,SAAS,eAAe,kBAAwE;AAmCzF,MAAM,sBAAsB,cAAmC,IAAI;AAEnE,SAAS,qBAAqB,EAAE,OAAO,SAAS,GAAiD;AACtG,SAAO,oBAAC,oBAAoB,UAApB,EAA6B,OAAe,UAAS;AAC/D;AAEO,SAAS,kBAAgC;AAC9C,QAAM,MAAM,WAAW,mBAAmB;AAC1C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,8BAA8B;AACxD,SAAO;AACT;","names":[]}
|
|
@@ -17,17 +17,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
|
|
20
|
+
var more_menu_exports = {};
|
|
21
|
+
__export(more_menu_exports, {
|
|
22
|
+
MoreMenu: () => MoreMenu
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(more_menu_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
var import_lucide_react = require("lucide-react");
|
|
28
28
|
var import_dropdown_menu = require("./dropdown-menu.js");
|
|
29
29
|
var import_share = require("../utils/share.js");
|
|
30
|
-
function
|
|
30
|
+
function MoreMenu({ explorerHref, shareTitle, onReport }) {
|
|
31
31
|
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
32
32
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenu, { children: [
|
|
33
33
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -69,6 +69,6 @@ function CollectionMoreMenu({ explorerHref, shareTitle, onReport }) {
|
|
|
69
69
|
}
|
|
70
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
71
|
0 && (module.exports = {
|
|
72
|
-
|
|
72
|
+
MoreMenu
|
|
73
73
|
});
|
|
74
|
-
//# sourceMappingURL=
|
|
74
|
+
//# sourceMappingURL=more-menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/more-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from \"lucide-react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { shareOrCopy } from \"../utils/share.js\";\n\nexport function MoreMenu({ explorerHref, shareTitle, onReport }: { explorerHref: string; shareTitle: string; onReport: () => void }) {\n const [copied, setCopied] = useState(false);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label=\"More options\"\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild>\n <a href={explorerHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <ExternalLink />\n View on explorer\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={(e) => {\n e.preventDefault();\n void shareOrCopy(shareTitle).then((result) => {\n if (result !== \"copied\") return;\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n >\n {copied ? <Check className=\"text-emerald-500\" /> : <Share2 />}\n {copied ? \"Link copied\" : \"Share\"}\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onReport}>\n <Flag />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeQ;AAbR,mBAAyB;AACzB,0BAAkE;AAClE,2BAAyF;AACzF,mBAA4B;AAErB,SAAS,SAAS,EAAE,cAAc,YAAY,SAAS,GAAuE;AACnI,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,SACE,6CAAC,qCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,sDAAC,sCAAe,WAAU,WAAU;AAAA;AAAA,IACtC;AAAA,IACA,6CAAC,4CAAoB,OAAM,OACzB;AAAA,kDAAC,yCAAiB,SAAO,MACvB,uDAAC,OAAE,MAAM,cAAc,QAAO,UAAS,KAAI,uBACzC;AAAA,oDAAC,oCAAa;AAAA,QAAE;AAAA,SAElB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,MAAM;AACf,cAAE,eAAe;AACjB,qBAAK,0BAAY,UAAU,EAAE,KAAK,CAAC,WAAW;AAC5C,kBAAI,WAAW,SAAU;AACzB,wBAAU,IAAI;AACd,yBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,YACzC,CAAC;AAAA,UACH;AAAA,UAEC;AAAA,qBAAS,4CAAC,6BAAM,WAAU,oBAAmB,IAAK,4CAAC,8BAAO;AAAA,YAC1D,SAAS,gBAAgB;AAAA;AAAA;AAAA,MAC5B;AAAA,MACA,6CAAC,yCAAiB,UAAU,UAC1B;AAAA,oDAAC,4BAAK;AAAA,QAAE;AAAA,SAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
declare function
|
|
3
|
+
declare function MoreMenu({ explorerHref, shareTitle, onReport }: {
|
|
4
4
|
explorerHref: string;
|
|
5
5
|
shareTitle: string;
|
|
6
6
|
onReport: () => void;
|
|
7
7
|
}): react_jsx_runtime.JSX.Element;
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { MoreMenu };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
declare function
|
|
3
|
+
declare function MoreMenu({ explorerHref, shareTitle, onReport }: {
|
|
4
4
|
explorerHref: string;
|
|
5
5
|
shareTitle: string;
|
|
6
6
|
onReport: () => void;
|
|
7
7
|
}): react_jsx_runtime.JSX.Element;
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { MoreMenu };
|
|
@@ -4,7 +4,7 @@ import { useState } from "react";
|
|
|
4
4
|
import { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from "lucide-react";
|
|
5
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
6
6
|
import { shareOrCopy } from "../utils/share.js";
|
|
7
|
-
function
|
|
7
|
+
function MoreMenu({ explorerHref, shareTitle, onReport }) {
|
|
8
8
|
const [copied, setCopied] = useState(false);
|
|
9
9
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
10
10
|
/* @__PURE__ */ jsx(
|
|
@@ -45,6 +45,6 @@ function CollectionMoreMenu({ explorerHref, shareTitle, onReport }) {
|
|
|
45
45
|
] });
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
MoreMenu
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=
|
|
50
|
+
//# sourceMappingURL=more-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/more-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from \"lucide-react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { shareOrCopy } from \"../utils/share.js\";\n\nexport function MoreMenu({ explorerHref, shareTitle, onReport }: { explorerHref: string; shareTitle: string; onReport: () => void }) {\n const [copied, setCopied] = useState(false);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label=\"More options\"\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild>\n <a href={explorerHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <ExternalLink />\n View on explorer\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={(e) => {\n e.preventDefault();\n void shareOrCopy(shareTitle).then((result) => {\n if (result !== \"copied\") return;\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n >\n {copied ? <Check className=\"text-emerald-500\" /> : <Share2 />}\n {copied ? \"Link copied\" : \"Share\"}\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onReport}>\n <Flag />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";AAeQ,cAIE,YAJF;AAbR,SAAS,gBAAgB;AACzB,SAAS,OAAO,cAAc,MAAM,gBAAgB,cAAc;AAClE,SAAS,cAAc,qBAAqB,kBAAkB,2BAA2B;AACzF,SAAS,mBAAmB;AAErB,SAAS,SAAS,EAAE,cAAc,YAAY,SAAS,GAAuE;AACnI,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,SACE,qBAAC,gBACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,8BAAC,kBAAe,WAAU,WAAU;AAAA;AAAA,IACtC;AAAA,IACA,qBAAC,uBAAoB,OAAM,OACzB;AAAA,0BAAC,oBAAiB,SAAO,MACvB,+BAAC,OAAE,MAAM,cAAc,QAAO,UAAS,KAAI,uBACzC;AAAA,4BAAC,gBAAa;AAAA,QAAE;AAAA,SAElB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,MAAM;AACf,cAAE,eAAe;AACjB,iBAAK,YAAY,UAAU,EAAE,KAAK,CAAC,WAAW;AAC5C,kBAAI,WAAW,SAAU;AACzB,wBAAU,IAAI;AACd,yBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,YACzC,CAAC;AAAA,UACH;AAAA,UAEC;AAAA,qBAAS,oBAAC,SAAM,WAAU,oBAAmB,IAAK,oBAAC,UAAO;AAAA,YAC1D,SAAS,gBAAgB;AAAA;AAAA;AAAA,MAC5B;AAAA,MACA,qBAAC,oBAAiB,UAAU,UAC1B;AAAA,4BAAC,QAAK;AAAA,QAAE;AAAA,SAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 pop_my_events_page_exports = {};
|
|
31
|
+
__export(pop_my_events_page_exports, {
|
|
32
|
+
PopMyEventsPage: () => PopMyEventsPage
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pop_my_events_page_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_lucide_react = require("lucide-react");
|
|
37
|
+
var import_image = __toESM(require("./image.js"), 1);
|
|
38
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
39
|
+
var import_button = require("./button.js");
|
|
40
|
+
var import_skeleton = require("./skeleton.js");
|
|
41
|
+
var import_motion_primitives = require("./motion-primitives.js");
|
|
42
|
+
var import_sign_in_prompt = require("./sign-in-prompt.js");
|
|
43
|
+
var import_medialane_app = require("./medialane-app.js");
|
|
44
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
45
|
+
var import_use_pop = require("../utils/use-pop.js");
|
|
46
|
+
function MyEventCard({ collection }) {
|
|
47
|
+
const imageUrl = (0, import_use_image_url.useImageUrl)()(collection.image, { width: 128 });
|
|
48
|
+
const initial = (collection.name ?? "E").charAt(0).toUpperCase();
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell overflow-hidden flex gap-4 p-4 items-center", children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-16 w-16 rounded-xl overflow-hidden bg-muted shrink-0", children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imageUrl, alt: collection.name ?? "Event", fill: true, className: "object-cover", unoptimized: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-br from-green-500/40 to-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-2xl font-black text-white/20", children: initial }) }) }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0 space-y-0.5", children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-sm truncate", children: collection.name ?? "Unnamed Event" }),
|
|
53
|
+
collection.symbol && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: collection.symbol }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
55
|
+
(collection.totalSupply ?? 0).toLocaleString(),
|
|
56
|
+
" claimed"
|
|
57
|
+
] })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-2 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: `/launchpad/pop/${collection.contractAddress}/manage`, children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Settings, { className: "h-3.5 w-3.5 mr-1" }),
|
|
61
|
+
"Manage"
|
|
62
|
+
] }) }) })
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
function PopMyEventsPage() {
|
|
66
|
+
const { walletAddress, walletLoading } = (0, import_medialane_app.useMedialaneApp)();
|
|
67
|
+
const { events: collections, isLoading } = (0, import_use_pop.useMyPopEvents)(walletAddress);
|
|
68
|
+
if (!walletAddress) {
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mx-auto max-w-lg px-4 pt-24 pb-8", children: walletLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-40 w-full rounded-xl" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sign_in_prompt.SignInPrompt, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-10 w-10 text-muted-foreground/20" }), title: "Sign in to see your events" }) });
|
|
70
|
+
}
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-2xl mx-auto px-4 pt-10 pb-16 space-y-8", children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "pill-badge inline-flex gap-1.5 mb-2", children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-3 w-3" }),
|
|
76
|
+
"POP Protocol"
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-2xl font-bold mt-1", children: "My Events" }),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "Events you've created" })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, size: "sm", className: "bg-green-600 hover:bg-green-700 text-white gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/pop/create", children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5" }),
|
|
83
|
+
"New event"
|
|
84
|
+
] }) })
|
|
85
|
+
] }) }),
|
|
86
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-3", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-24 w-full rounded-xl" }, i)) }) : !collections || collections.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-16 text-center space-y-3", children: [
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "No events yet" }),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, size: "sm", className: "bg-green-600 hover:bg-green-700 text-white gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/pop/create", children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5" }),
|
|
91
|
+
"Create your first event"
|
|
92
|
+
] }) })
|
|
93
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.Stagger, { className: "space-y-3", children: collections.map((col) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.StaggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MyEventCard, { collection: col }) }, col.contractAddress)) })
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
+
0 && (module.exports = {
|
|
98
|
+
PopMyEventsPage
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=pop-my-events-page.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-my-events-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, Plus, Settings } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { SignInPrompt } from \"./sign-in-prompt.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useMyPopEvents } from \"../utils/use-pop.js\";\n\nfunction MyEventCard({ collection }: { collection: ApiCollection }) {\n const imageUrl = useImageUrl()(collection.image, { width: 128 });\n const initial = (collection.name ?? \"E\").charAt(0).toUpperCase();\n\n return (\n <div className=\"bento-cell overflow-hidden flex gap-4 p-4 items-center\">\n <div className=\"relative h-16 w-16 rounded-xl overflow-hidden bg-muted shrink-0\">\n {imageUrl ? (\n <Image src={imageUrl} alt={collection.name ?? \"Event\"} fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-green-500/40 to-green-900/50 flex items-center justify-center\">\n <span className=\"text-2xl font-black text-white/20\">{initial}</span>\n </div>\n )}\n </div>\n <div className=\"flex-1 min-w-0 space-y-0.5\">\n <p className=\"font-bold text-sm truncate\">{collection.name ?? \"Unnamed Event\"}</p>\n {collection.symbol && (\n <p className=\"text-xs text-muted-foreground\">{collection.symbol}</p>\n )}\n <p className=\"text-xs text-muted-foreground\">\n {(collection.totalSupply ?? 0).toLocaleString()} claimed\n </p>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href={`/launchpad/pop/${collection.contractAddress}/manage`}>\n <Settings className=\"h-3.5 w-3.5 mr-1\" />\n Manage\n </Link>\n </Button>\n </div>\n </div>\n );\n}\n\nexport function PopMyEventsPage() {\n const { walletAddress, walletLoading } = useMedialaneApp();\n const { events: collections, isLoading } = useMyPopEvents(walletAddress);\n\n if (!walletAddress) {\n return (\n <div className=\"mx-auto max-w-lg px-4 pt-24 pb-8\">\n {walletLoading ? <Skeleton className=\"h-40 w-full rounded-xl\" /> : (\n <SignInPrompt icon={<Award className=\"h-10 w-10 text-muted-foreground/20\" />} title=\"Sign in to see your events\" />\n )}\n </div>\n );\n }\n\n return (\n <div className=\"max-w-2xl mx-auto px-4 pt-10 pb-16 space-y-8\">\n <FadeIn>\n <div className=\"flex items-center justify-between\">\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n POP Protocol\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">My Events</h1>\n <p className=\"text-sm text-muted-foreground\">Events you've created</p>\n </div>\n <Button asChild size=\"sm\" className=\"bg-green-600 hover:bg-green-700 text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n New event\n </Link>\n </Button>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, i) => (\n <Skeleton key={i} className=\"h-24 w-full rounded-xl\" />\n ))}\n </div>\n ) : !collections || collections.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-16 text-center space-y-3\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-sm text-muted-foreground\">No events yet</p>\n <Button asChild size=\"sm\" className=\"bg-green-600 hover:bg-green-700 text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n Create your first event\n </Link>\n </Button>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"space-y-3\">\n {collections.map((col) => (\n <StaggerItem key={col.contractAddress}>\n <MyEventCard collection={col} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </div>\n );\n}\n"],"mappings":"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","names":["Image","Link"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Award, Plus, Settings } from "lucide-react";
|
|
4
|
+
import Image from "./image.js";
|
|
5
|
+
import Link from "./link.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Skeleton } from "./skeleton.js";
|
|
8
|
+
import { FadeIn, Stagger, StaggerItem } from "./motion-primitives.js";
|
|
9
|
+
import { SignInPrompt } from "./sign-in-prompt.js";
|
|
10
|
+
import { useMedialaneApp } from "./medialane-app.js";
|
|
11
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
12
|
+
import { useMyPopEvents } from "../utils/use-pop.js";
|
|
13
|
+
function MyEventCard({ collection }) {
|
|
14
|
+
const imageUrl = useImageUrl()(collection.image, { width: 128 });
|
|
15
|
+
const initial = (collection.name ?? "E").charAt(0).toUpperCase();
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", { className: "bento-cell overflow-hidden flex gap-4 p-4 items-center", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-16 w-16 rounded-xl overflow-hidden bg-muted shrink-0", children: imageUrl ? /* @__PURE__ */ jsx(Image, { src: imageUrl, alt: collection.name ?? "Event", fill: true, className: "object-cover", unoptimized: true }) : /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-green-500/40 to-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-2xl font-black text-white/20", children: initial }) }) }),
|
|
18
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 space-y-0.5", children: [
|
|
19
|
+
/* @__PURE__ */ jsx("p", { className: "font-bold text-sm truncate", children: collection.name ?? "Unnamed Event" }),
|
|
20
|
+
collection.symbol && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: collection.symbol }),
|
|
21
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
22
|
+
(collection.totalSupply ?? 0).toLocaleString(),
|
|
23
|
+
" claimed"
|
|
24
|
+
] })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: /* @__PURE__ */ jsx(Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsxs(Link, { href: `/launchpad/pop/${collection.contractAddress}/manage`, children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Settings, { className: "h-3.5 w-3.5 mr-1" }),
|
|
28
|
+
"Manage"
|
|
29
|
+
] }) }) })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
function PopMyEventsPage() {
|
|
33
|
+
const { walletAddress, walletLoading } = useMedialaneApp();
|
|
34
|
+
const { events: collections, isLoading } = useMyPopEvents(walletAddress);
|
|
35
|
+
if (!walletAddress) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-lg px-4 pt-24 pb-8", children: walletLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-40 w-full rounded-xl" }) : /* @__PURE__ */ jsx(SignInPrompt, { icon: /* @__PURE__ */ jsx(Award, { className: "h-10 w-10 text-muted-foreground/20" }), title: "Sign in to see your events" }) });
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto px-4 pt-10 pb-16 space-y-8", children: [
|
|
39
|
+
/* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("span", { className: "pill-badge inline-flex gap-1.5 mb-2", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Award, { className: "h-3 w-3" }),
|
|
43
|
+
"POP Protocol"
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mt-1", children: "My Events" }),
|
|
46
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Events you've created" })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, size: "sm", className: "bg-green-600 hover:bg-green-700 text-white gap-1.5", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/pop/create", children: [
|
|
49
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }),
|
|
50
|
+
"New event"
|
|
51
|
+
] }) })
|
|
52
|
+
] }) }),
|
|
53
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "space-y-3", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-24 w-full rounded-xl" }, i)) }) : !collections || collections.length === 0 ? /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "bento-cell border-dashed p-16 text-center space-y-3", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
55
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "No events yet" }),
|
|
56
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, size: "sm", className: "bg-green-600 hover:bg-green-700 text-white gap-1.5", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/pop/create", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }),
|
|
58
|
+
"Create your first event"
|
|
59
|
+
] }) })
|
|
60
|
+
] }) }) : /* @__PURE__ */ jsx(Stagger, { className: "space-y-3", children: collections.map((col) => /* @__PURE__ */ jsx(StaggerItem, { children: /* @__PURE__ */ jsx(MyEventCard, { collection: col }) }, col.contractAddress)) })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
PopMyEventsPage
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=pop-my-events-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-my-events-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, Plus, Settings } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { SignInPrompt } from \"./sign-in-prompt.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useMyPopEvents } from \"../utils/use-pop.js\";\n\nfunction MyEventCard({ collection }: { collection: ApiCollection }) {\n const imageUrl = useImageUrl()(collection.image, { width: 128 });\n const initial = (collection.name ?? \"E\").charAt(0).toUpperCase();\n\n return (\n <div className=\"bento-cell overflow-hidden flex gap-4 p-4 items-center\">\n <div className=\"relative h-16 w-16 rounded-xl overflow-hidden bg-muted shrink-0\">\n {imageUrl ? (\n <Image src={imageUrl} alt={collection.name ?? \"Event\"} fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-green-500/40 to-green-900/50 flex items-center justify-center\">\n <span className=\"text-2xl font-black text-white/20\">{initial}</span>\n </div>\n )}\n </div>\n <div className=\"flex-1 min-w-0 space-y-0.5\">\n <p className=\"font-bold text-sm truncate\">{collection.name ?? \"Unnamed Event\"}</p>\n {collection.symbol && (\n <p className=\"text-xs text-muted-foreground\">{collection.symbol}</p>\n )}\n <p className=\"text-xs text-muted-foreground\">\n {(collection.totalSupply ?? 0).toLocaleString()} claimed\n </p>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href={`/launchpad/pop/${collection.contractAddress}/manage`}>\n <Settings className=\"h-3.5 w-3.5 mr-1\" />\n Manage\n </Link>\n </Button>\n </div>\n </div>\n );\n}\n\nexport function PopMyEventsPage() {\n const { walletAddress, walletLoading } = useMedialaneApp();\n const { events: collections, isLoading } = useMyPopEvents(walletAddress);\n\n if (!walletAddress) {\n return (\n <div className=\"mx-auto max-w-lg px-4 pt-24 pb-8\">\n {walletLoading ? <Skeleton className=\"h-40 w-full rounded-xl\" /> : (\n <SignInPrompt icon={<Award className=\"h-10 w-10 text-muted-foreground/20\" />} title=\"Sign in to see your events\" />\n )}\n </div>\n );\n }\n\n return (\n <div className=\"max-w-2xl mx-auto px-4 pt-10 pb-16 space-y-8\">\n <FadeIn>\n <div className=\"flex items-center justify-between\">\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n POP Protocol\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">My Events</h1>\n <p className=\"text-sm text-muted-foreground\">Events you've created</p>\n </div>\n <Button asChild size=\"sm\" className=\"bg-green-600 hover:bg-green-700 text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n New event\n </Link>\n </Button>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, i) => (\n <Skeleton key={i} className=\"h-24 w-full rounded-xl\" />\n ))}\n </div>\n ) : !collections || collections.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-16 text-center space-y-3\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-sm text-muted-foreground\">No events yet</p>\n <Button asChild size=\"sm\" className=\"bg-green-600 hover:bg-green-700 text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n Create your first event\n </Link>\n </Button>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"space-y-3\">\n {collections.map((col) => (\n <StaggerItem key={col.contractAddress}>\n <MyEventCard collection={col} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </div>\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,154 @@
|
|
|
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 remix_browse_page_exports = {};
|
|
31
|
+
__export(remix_browse_page_exports, {
|
|
32
|
+
RemixBrowsePage: () => RemixBrowsePage
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(remix_browse_page_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
38
|
+
var import_image = __toESM(require("./image.js"), 1);
|
|
39
|
+
var import_service_header = require("./service-header.js");
|
|
40
|
+
var import_back_button = require("./back-button.js");
|
|
41
|
+
var import_motion_primitives = require("./motion-primitives.js");
|
|
42
|
+
var import_skeleton = require("./skeleton.js");
|
|
43
|
+
var import_button = require("./button.js");
|
|
44
|
+
var import_use_medialane_client = require("../utils/use-medialane-client.js");
|
|
45
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
46
|
+
var import_lucide_react = require("lucide-react");
|
|
47
|
+
const PAGE_SIZE = 24;
|
|
48
|
+
function useRemixableTokens() {
|
|
49
|
+
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
50
|
+
const [tokens, setTokens] = (0, import_react.useState)([]);
|
|
51
|
+
const [page, setPage] = (0, import_react.useState)(1);
|
|
52
|
+
const [isLoading, setIsLoading] = (0, import_react.useState)(true);
|
|
53
|
+
const [hasMore, setHasMore] = (0, import_react.useState)(false);
|
|
54
|
+
const [error, setError] = (0, import_react.useState)(false);
|
|
55
|
+
(0, import_react.useEffect)(() => {
|
|
56
|
+
let cancelled = false;
|
|
57
|
+
setIsLoading(true);
|
|
58
|
+
client.api.getTokens({ derivatives: "allowed", limit: PAGE_SIZE, page }).then((json) => {
|
|
59
|
+
if (cancelled) return;
|
|
60
|
+
setTokens((prev) => page === 1 ? json.data : [...prev, ...json.data]);
|
|
61
|
+
setHasMore(page * PAGE_SIZE < (json.meta?.total ?? 0));
|
|
62
|
+
}).catch(() => {
|
|
63
|
+
if (!cancelled) setError(true);
|
|
64
|
+
}).finally(() => {
|
|
65
|
+
if (!cancelled) setIsLoading(false);
|
|
66
|
+
});
|
|
67
|
+
return () => {
|
|
68
|
+
cancelled = true;
|
|
69
|
+
};
|
|
70
|
+
}, [client, page]);
|
|
71
|
+
return { tokens, isLoading, hasMore, error, loadMore: () => setPage((p) => p + 1) };
|
|
72
|
+
}
|
|
73
|
+
function RemixableCard({ token }) {
|
|
74
|
+
const [imgError, setImgError] = (0, import_react.useState)(false);
|
|
75
|
+
const imageUrl = (0, import_use_image_url.useImageUrl)()(token.metadata?.image, { width: 480 });
|
|
76
|
+
const showImage = imageUrl && !imgError;
|
|
77
|
+
const name = token.metadata?.name ?? `#${token.tokenId}`;
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
79
|
+
import_link.default,
|
|
80
|
+
{
|
|
81
|
+
href: `/create/remix/${token.contractAddress}/${token.tokenId}`,
|
|
82
|
+
className: "group flex flex-col rounded-2xl border border-border/60 bg-card overflow-hidden transition-colors sm:hover:border-brand-blue/50 active:scale-[0.99] motion-reduce:transform-none",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative aspect-square bg-muted overflow-hidden", children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
import_image.default,
|
|
86
|
+
{
|
|
87
|
+
src: imageUrl,
|
|
88
|
+
alt: name,
|
|
89
|
+
fill: true,
|
|
90
|
+
className: "object-cover",
|
|
91
|
+
onError: () => setImgError(true),
|
|
92
|
+
unoptimized: true
|
|
93
|
+
}
|
|
94
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImageIcon, { className: "h-8 w-8 text-muted-foreground/30" }) }) }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "p-4 space-y-1", children: [
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold text-sm leading-tight truncate", children: name }),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
98
|
+
"Derivatives: ",
|
|
99
|
+
token.metadata?.derivatives ?? "Allowed"
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs font-semibold pt-1 inline-flex items-center gap-1.5", children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.GitBranch, { className: "h-3 w-3" }),
|
|
103
|
+
"Remix this work"
|
|
104
|
+
] })
|
|
105
|
+
] })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function RemixableCardSkeleton() {
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl border border-border/40 overflow-hidden", children: [
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "aspect-square rounded-none" }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "p-4 space-y-2", children: [
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-32" }),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-3 w-24" })
|
|
116
|
+
] })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
function RemixBrowsePage() {
|
|
120
|
+
const { tokens, isLoading, hasMore, error, loadMore } = useRemixableTokens();
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pb-16", children: [
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "px-4 pt-10 max-w-5xl mx-auto", children: [
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.BackButton, {}),
|
|
124
|
+
/* @__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)(
|
|
125
|
+
import_service_header.ServiceHeader,
|
|
126
|
+
{
|
|
127
|
+
plain: true,
|
|
128
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.GitBranch, { className: "h-4 w-4 text-white" }),
|
|
129
|
+
title: "Remix",
|
|
130
|
+
subtitle: "Pick a work that is open to remixing. Attribution and royalties flow back to the original creator."
|
|
131
|
+
}
|
|
132
|
+
) }) })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 pt-8 max-w-5xl mx-auto space-y-6", children: isLoading && tokens.length === 0 ? /* @__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)(RemixableCardSkeleton, {}, i)) }) : error && tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-10 flex flex-col items-center gap-3 text-center", children: [
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: "Could not load works" }),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "Check your connection and try again." }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", size: "sm", onClick: () => location.reload(), children: "Retry" })
|
|
138
|
+
] }) : tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-10 flex flex-col items-center gap-4 text-center", children: [
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Inbox, { className: "h-10 w-10 text-muted-foreground/30" }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: "No works open to remixing yet" }),
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-1 max-w-sm", children: "Works appear here when their creator sets the license to allow derivatives." })
|
|
143
|
+
] })
|
|
144
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
145
|
+
/* @__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: tokens.map((t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.StaggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RemixableCard, { token: t }) }, `${t.contractAddress}-${t.tokenId}`)) }),
|
|
146
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", onClick: loadMore, disabled: isLoading, children: isLoading ? "Loading\u2026" : "Load more" }) })
|
|
147
|
+
] }) })
|
|
148
|
+
] });
|
|
149
|
+
}
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
RemixBrowsePage
|
|
153
|
+
});
|
|
154
|
+
//# sourceMappingURL=remix-browse-page.cjs.map
|