@medialane/ui 0.394.0 → 0.395.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/README.md +24 -0
- package/dist/components/account-page.cjs +2 -1
- package/dist/components/account-page.cjs.map +1 -1
- package/dist/components/account-page.js +2 -1
- package/dist/components/account-page.js.map +1 -1
- package/dist/components/accounts-page.cjs +30 -47
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +31 -48
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/activities-page.cjs +41 -0
- package/dist/components/activities-page.cjs.map +1 -0
- package/dist/components/activities-page.d.cts +5 -0
- package/dist/components/activities-page.d.ts +5 -0
- package/dist/components/activities-page.js +17 -0
- package/dist/components/activities-page.js.map +1 -0
- package/dist/components/alert.d.cts +1 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/coins-explorer.cjs +18 -17
- package/dist/components/coins-explorer.cjs.map +1 -1
- package/dist/components/coins-explorer.d.cts +2 -1
- package/dist/components/coins-explorer.d.ts +2 -1
- package/dist/components/coins-explorer.js +16 -16
- package/dist/components/coins-explorer.js.map +1 -1
- package/dist/components/collection-settings.cjs +19 -15
- package/dist/components/collection-settings.cjs.map +1 -1
- package/dist/components/collection-settings.js +19 -15
- package/dist/components/collection-settings.js.map +1 -1
- package/dist/components/collections-page.cjs +12 -16
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +12 -16
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/discover-hero.cjs +8 -45
- package/dist/components/discover-hero.cjs.map +1 -1
- package/dist/components/discover-hero.d.cts +1 -2
- package/dist/components/discover-hero.d.ts +1 -2
- package/dist/components/discover-hero.js +8 -45
- package/dist/components/discover-hero.js.map +1 -1
- package/dist/components/discover-page.cjs +2 -3
- package/dist/components/discover-page.cjs.map +1 -1
- package/dist/components/discover-page.d.cts +1 -2
- package/dist/components/discover-page.d.ts +1 -2
- package/dist/components/discover-page.js +2 -3
- package/dist/components/discover-page.js.map +1 -1
- package/dist/components/drop/drop-detail-page.cjs +37 -0
- package/dist/components/drop/drop-detail-page.cjs.map +1 -0
- package/dist/components/drop/drop-detail-page.d.cts +7 -0
- package/dist/components/drop/drop-detail-page.d.ts +7 -0
- package/dist/components/drop/drop-detail-page.js +13 -0
- package/dist/components/drop/drop-detail-page.js.map +1 -0
- package/dist/components/drop/my-drops-page.cjs +41 -0
- package/dist/components/drop/my-drops-page.cjs.map +1 -0
- package/dist/components/drop/my-drops-page.d.cts +5 -0
- package/dist/components/drop/my-drops-page.d.ts +5 -0
- package/dist/components/drop/my-drops-page.js +17 -0
- package/dist/components/drop/my-drops-page.js.map +1 -0
- package/dist/components/drops-page.cjs +14 -16
- package/dist/components/drops-page.cjs.map +1 -1
- package/dist/components/drops-page.js +14 -16
- package/dist/components/drops-page.js.map +1 -1
- package/dist/components/editions-page.cjs +24 -26
- package/dist/components/editions-page.cjs.map +1 -1
- package/dist/components/editions-page.js +24 -26
- package/dist/components/editions-page.js.map +1 -1
- package/dist/components/ip-type-page.cjs +117 -117
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +118 -118
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/journey-content.cjs +16 -25
- package/dist/components/journey-content.cjs.map +1 -1
- package/dist/components/journey-content.js +18 -27
- package/dist/components/journey-content.js.map +1 -1
- package/dist/components/launchpad/remix-mint.cjs +17 -15
- package/dist/components/launchpad/remix-mint.cjs.map +1 -1
- package/dist/components/launchpad/remix-mint.js +17 -15
- package/dist/components/launchpad/remix-mint.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +4 -2
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +4 -2
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad-page.cjs +8 -7
- package/dist/components/launchpad-page.cjs.map +1 -1
- package/dist/components/launchpad-page.js +8 -7
- package/dist/components/launchpad-page.js.map +1 -1
- package/dist/components/launchpad-services.cjs +2 -4
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.js +2 -4
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/components/license-request-page.cjs +18 -16
- package/dist/components/license-request-page.cjs.map +1 -1
- package/dist/components/license-request-page.js +18 -16
- package/dist/components/license-request-page.js.map +1 -1
- package/dist/components/page-container.cjs +1 -1
- package/dist/components/page-container.cjs.map +1 -1
- package/dist/components/page-container.js +1 -1
- package/dist/components/page-container.js.map +1 -1
- package/dist/components/page-header.cjs +56 -0
- package/dist/components/page-header.cjs.map +1 -0
- package/dist/components/page-header.d.cts +19 -0
- package/dist/components/page-header.d.ts +19 -0
- package/dist/components/page-header.js +31 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/page-skeletons.cjs +11 -40
- package/dist/components/page-skeletons.cjs.map +1 -1
- package/dist/components/page-skeletons.js +11 -40
- package/dist/components/page-skeletons.js.map +1 -1
- package/dist/components/pop-manage-page.cjs +17 -15
- package/dist/components/pop-manage-page.cjs.map +1 -1
- package/dist/components/pop-manage-page.js +17 -15
- package/dist/components/pop-manage-page.js.map +1 -1
- package/dist/components/pop-my-events-page.cjs +15 -15
- package/dist/components/pop-my-events-page.cjs.map +1 -1
- package/dist/components/pop-my-events-page.js +15 -15
- package/dist/components/pop-my-events-page.js.map +1 -1
- package/dist/components/pop-page.cjs +177 -0
- package/dist/components/pop-page.cjs.map +1 -0
- package/dist/components/pop-page.d.cts +5 -0
- package/dist/components/pop-page.d.ts +5 -0
- package/dist/components/pop-page.js +143 -0
- package/dist/components/pop-page.js.map +1 -0
- package/dist/components/portfolio-collections.cjs +8 -11
- package/dist/components/portfolio-collections.cjs.map +1 -1
- package/dist/components/portfolio-collections.js +8 -11
- package/dist/components/portfolio-collections.js.map +1 -1
- package/dist/components/portfolio-header.cjs +13 -16
- package/dist/components/portfolio-header.cjs.map +1 -1
- package/dist/components/portfolio-header.js +13 -16
- package/dist/components/portfolio-header.js.map +1 -1
- package/dist/components/portfolio-shell.cjs +2 -1
- package/dist/components/portfolio-shell.cjs.map +1 -1
- package/dist/components/portfolio-shell.js +2 -1
- package/dist/components/portfolio-shell.js.map +1 -1
- package/dist/components/portfolio-sponsorships.cjs +6 -8
- package/dist/components/portfolio-sponsorships.cjs.map +1 -1
- package/dist/components/portfolio-sponsorships.js +6 -8
- package/dist/components/portfolio-sponsorships.js.map +1 -1
- package/dist/components/remix-browse-page.cjs +13 -15
- package/dist/components/remix-browse-page.cjs.map +1 -1
- package/dist/components/remix-browse-page.js +13 -15
- package/dist/components/remix-browse-page.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +20 -30
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +21 -31
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/components/rewards-page.cjs +1 -1
- package/dist/components/rewards-page.cjs.map +1 -1
- package/dist/components/rewards-page.js +1 -1
- package/dist/components/rewards-page.js.map +1 -1
- package/dist/components/search-page.cjs +5 -12
- package/dist/components/search-page.cjs.map +1 -1
- package/dist/components/search-page.js +5 -12
- package/dist/components/search-page.js.map +1 -1
- package/dist/components/section-heading.cjs +6 -6
- package/dist/components/section-heading.cjs.map +1 -1
- package/dist/components/section-heading.d.cts +7 -4
- package/dist/components/section-heading.d.ts +7 -4
- package/dist/components/section-heading.js +6 -6
- package/dist/components/section-heading.js.map +1 -1
- package/dist/components/service-collections-page.cjs +7 -13
- package/dist/components/service-collections-page.cjs.map +1 -1
- package/dist/components/service-collections-page.d.cts +0 -2
- package/dist/components/service-collections-page.d.ts +0 -2
- package/dist/components/service-collections-page.js +8 -14
- package/dist/components/service-collections-page.js.map +1 -1
- package/dist/components/service-form-shell.cjs +12 -15
- package/dist/components/service-form-shell.cjs.map +1 -1
- package/dist/components/service-form-shell.js +12 -15
- package/dist/components/service-form-shell.js.map +1 -1
- package/dist/components/sponsorship-offer-page.cjs +13 -5
- package/dist/components/sponsorship-offer-page.cjs.map +1 -1
- package/dist/components/sponsorship-offer-page.js +13 -5
- package/dist/components/sponsorship-offer-page.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +17 -21
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +17 -21
- package/dist/components/sponsorship-offers-page.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +13 -6
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +13 -6
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/index.cjs +22 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/service-header.cjs +0 -47
- package/dist/components/service-header.cjs.map +0 -1
- package/dist/components/service-header.d.cts +0 -15
- package/dist/components/service-header.d.ts +0 -15
- package/dist/components/service-header.js +0 -23
- package/dist/components/service-header.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/page-skeletons.tsx"],"sourcesContent":["import { Skeleton } from \"./skeleton.js\";\nimport { TokenCardSkeleton } from \"./token-card.js\";\nimport { AssetCardSkeleton } from \"./asset-card.js\";\nimport { CollectionCardSkeleton } from \"./collection-card.js\";\nimport { ListingCardSkeleton } from \"./listing-card.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { CreatorHeader } from \"./creator-header.js\";\nimport { ActivityListSkeleton } from \"./activity-row.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nexport function AccountLoading() {\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8 min-h-screen\">\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"min-w-0 space-y-2\">\n <Skeleton className=\"h-3 w-16\" />\n <Skeleton className=\"h-8 w-64 sm:h-9 sm:w-80\" />\n </div>\n <div className=\"ml-auto flex shrink-0 items-center gap-2\">\n <Skeleton className=\"h-7 w-20 rounded-full\" />\n <Skeleton className=\"h-9 w-9 rounded-full\" />\n </div>\n </div>\n\n <div className=\"flex items-center gap-1.5 overflow-hidden\">\n {[104, 132, 112, 84].map((w, i) => (\n <Skeleton key={i} className=\"h-9 shrink-0 rounded-full\" style={{ width: w }} />\n ))}\n </div>\n\n <div className={GRID}>\n {Array.from({ length: 8 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n </div>\n );\n}\n\nexport function CreatorLoading() {\n return (\n <div className=\"min-h-screen pb-20\">\n <div className=\"px-6 pt-20 pb-6\">\n <CreatorHeader creator={null} image={null} stats={[]} loading />\n </div>\n <div className=\"mt-4 flex items-center gap-0.5 px-6\">\n {[64, 92, 72, 68].map((w, i) => (\n <div key={i} className=\"px-4 py-3\">\n <Skeleton className=\"h-4\" style={{ width: w }} />\n </div>\n ))}\n </div>\n <div className={`mt-6 px-6 ${GRID}`}>\n {Array.from({ length: 8 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n </div>\n );\n}\n\nexport function ActivitiesLoading() {\n return (\n <PageContainer className=\"box-border max-w-full pt-14 pb-8 space-y-8\">\n <div className=\"space-y-2 pt-8\">\n <Skeleton className=\"h-9 w-64\" />\n </div>\n <div className=\"space-y-5\">\n <Skeleton className=\"h-5 w-36\" />\n <div className=\"flex flex-wrap gap-2\">\n {[44, 64, 62, 78, 70, 88, 90].map((w, i) => (\n <Skeleton key={i} className=\"h-7 rounded-full\" style={{ width: w }} />\n ))}\n </div>\n <ActivityListSkeleton />\n </div>\n </PageContainer>\n );\n}\n\nexport function CollectionsLoading() {\n return (\n <PageContainer className=\"box-border max-w-full pt-14 pb-8 space-y-8\">\n <div className=\"space-y-2 pt-8\">\n <Skeleton className=\"h-9 w-72\" />\n <div className=\"flex flex-wrap items-center gap-2 mt-1\">\n <Skeleton className=\"h-8 w-36 rounded-full\" />\n <Skeleton className=\"h-8 w-40 rounded-full\" />\n </div>\n </div>\n <div className=\"grid grid-cols-2 lg:grid-cols-5 gap-4 sm:gap-5\">\n {Array.from({ length: 10 }).map((_, i) => (\n <CollectionCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function MarketplaceLoading() {\n return (\n <PageContainer className=\"box-border max-w-full pt-14 pb-8 space-y-8\">\n <div className=\"space-y-2 pt-8\">\n <Skeleton className=\"h-9 w-64\" />\n <div className=\"flex flex-wrap items-center gap-2 mt-1\">\n <Skeleton className=\"h-8 w-28 rounded-full\" />\n <Skeleton className=\"h-8 w-24 rounded-full\" />\n </div>\n </div>\n <Skeleton className=\"h-10 w-full rounded-full\" />\n <div className=\"flex items-center gap-2\">\n <Skeleton className=\"h-10 flex-1 rounded-full\" />\n <Skeleton className=\"h-10 w-24 rounded-full shrink-0\" />\n </div>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\">\n {Array.from({ length: 15 }).map((_, i) => (\n <ListingCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function CollectionLoading() {\n return (\n <div className=\"relative z-0 min-h-screen\">\n <div className=\"px-4 sm:px-6 pt-20 pb-6\">\n <div className=\"flex flex-col sm:flex-row gap-6 lg:gap-8 items-start lg:max-w-5xl lg:mx-auto\">\n <Skeleton className=\"w-full sm:w-44 lg:w-56 shrink-0 rounded-2xl aspect-square\" />\n <div className=\"flex-1 w-full space-y-4\">\n <Skeleton className=\"h-6 w-40\" />\n <Skeleton className=\"h-10 w-2/3\" />\n <Skeleton className=\"h-16 w-full\" />\n <div className=\"flex gap-6\">\n {Array.from({ length: 4 }).map((_, i) => (\n <div key={i} className=\"space-y-1.5\">\n <Skeleton className=\"h-3 w-12\" />\n <Skeleton className=\"h-5 w-16\" />\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n <div className=\"px-4 sm:px-6 pb-12 space-y-4\">\n <div className=\"flex items-center gap-2 pt-3\">\n <Skeleton className=\"h-10 w-72 max-w-full rounded-2xl\" />\n <Skeleton className=\"ml-auto h-9 w-9 rounded-full\" />\n </div>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\">\n {Array.from({ length: 10 }).map((_, i) => (\n <AssetCardSkeleton key={i} />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nexport function IpTypeLoading() {\n return (\n <PageContainer className=\"box-border max-w-full pt-20 pb-16 space-y-8\">\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-4\">\n <Skeleton className=\"h-14 w-14 rounded-2xl shrink-0\" />\n <div className=\"space-y-2\">\n <Skeleton className=\"h-9 w-56\" />\n <Skeleton className=\"h-4 w-72 max-w-full\" />\n </div>\n </div>\n <Skeleton className=\"h-9 w-12 rounded-full\" />\n </div>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4\">\n {Array.from({ length: 10 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function PortfolioLoading() {\n return (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n );\n}\n"],"mappings":"AAeQ,SACE,KADF;AAfR,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AAErC,MAAM,OAAO;AAEN,SAAS,iBAAiB;AAC/B,SACE,qBAAC,SAAI,WAAU,0DACb;AA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AAS,WAAU,uBAAsB;AAAA,WAC5C;AAAA,SACF;AAAA,MACA,oBAAC,YAAS,WAAU,yBAAwB;AAAA,OAC9C;AAAA,IACA,oBAAC,SAAI,WAAU,uEACZ,gBAAM,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,MAClC,oBAAC,uBAAuB,CAAG,CAC5B,GACH;AAAA,KACF;AAEJ;AAEO,SAAS,mBAAmB;AACjC,SACE,oBAAC,SAAI,WAAW,MACb,gBAAM,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,MAClC,oBAAC,uBAAuB,CAAG,CAC5B,GACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/page-skeletons.tsx"],"sourcesContent":["import { Skeleton } from \"./skeleton.js\";\nimport { TokenCardSkeleton } from \"./token-card.js\";\nimport { AssetCardSkeleton } from \"./asset-card.js\";\nimport { CollectionCardSkeleton } from \"./collection-card.js\";\nimport { ListingCardSkeleton } from \"./listing-card.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeaderSkeleton } from \"./page-header.js\";\nimport { CreatorHeader } from \"./creator-header.js\";\nimport { ActivityListSkeleton } from \"./activity-row.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nexport function AccountLoading() {\n return (\n <PageContainer className=\"min-h-screen space-y-8\">\n <PageHeaderSkeleton />\n\n <div className=\"flex items-center gap-1.5 overflow-hidden\">\n {[104, 132, 112, 84].map((w, i) => (\n <Skeleton key={i} className=\"h-9 shrink-0 rounded-full\" style={{ width: w }} />\n ))}\n </div>\n\n <div className={GRID}>\n {Array.from({ length: 8 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function CreatorLoading() {\n return (\n <div className=\"min-h-screen pb-20\">\n <div className=\"px-6 pt-20 pb-6\">\n <CreatorHeader creator={null} image={null} stats={[]} loading />\n </div>\n <div className=\"mt-4 flex items-center gap-0.5 px-6\">\n {[64, 92, 72, 68].map((w, i) => (\n <div key={i} className=\"px-4 py-3\">\n <Skeleton className=\"h-4\" style={{ width: w }} />\n </div>\n ))}\n </div>\n <div className={`mt-6 px-6 ${GRID}`}>\n {Array.from({ length: 8 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n </div>\n );\n}\n\nexport function ActivitiesLoading() {\n return (\n <PageContainer className=\"space-y-8\">\n <PageHeaderSkeleton />\n <div className=\"space-y-5\">\n <Skeleton className=\"h-5 w-36\" />\n <div className=\"flex flex-wrap gap-2\">\n {[44, 64, 62, 78, 70, 88, 90].map((w, i) => (\n <Skeleton key={i} className=\"h-7 rounded-full\" style={{ width: w }} />\n ))}\n </div>\n <ActivityListSkeleton />\n </div>\n </PageContainer>\n );\n}\n\nexport function CollectionsLoading() {\n return (\n <PageContainer className=\"space-y-8\">\n <PageHeaderSkeleton stats={2} />\n <div className=\"grid grid-cols-2 lg:grid-cols-5 gap-4 sm:gap-5\">\n {Array.from({ length: 10 }).map((_, i) => (\n <CollectionCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function MarketplaceLoading() {\n return (\n <PageContainer className=\"space-y-8\">\n <PageHeaderSkeleton stats={2} />\n <Skeleton className=\"h-10 w-full rounded-full\" />\n <div className=\"flex items-center gap-2\">\n <Skeleton className=\"h-10 flex-1 rounded-full\" />\n <Skeleton className=\"h-10 w-24 rounded-full shrink-0\" />\n </div>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\">\n {Array.from({ length: 15 }).map((_, i) => (\n <ListingCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function CollectionLoading() {\n return (\n <div className=\"relative z-0 min-h-screen\">\n <div className=\"px-4 sm:px-6 pt-20 pb-6\">\n <div className=\"flex flex-col sm:flex-row gap-6 lg:gap-8 items-start lg:max-w-5xl lg:mx-auto\">\n <Skeleton className=\"w-full sm:w-44 lg:w-56 shrink-0 rounded-2xl aspect-square\" />\n <div className=\"flex-1 w-full space-y-4\">\n <Skeleton className=\"h-6 w-40\" />\n <Skeleton className=\"h-10 w-2/3\" />\n <Skeleton className=\"h-16 w-full\" />\n <div className=\"flex gap-6\">\n {Array.from({ length: 4 }).map((_, i) => (\n <div key={i} className=\"space-y-1.5\">\n <Skeleton className=\"h-3 w-12\" />\n <Skeleton className=\"h-5 w-16\" />\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n <div className=\"px-4 sm:px-6 pb-12 space-y-4\">\n <div className=\"flex items-center gap-2 pt-3\">\n <Skeleton className=\"h-10 w-72 max-w-full rounded-2xl\" />\n <Skeleton className=\"ml-auto h-9 w-9 rounded-full\" />\n </div>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\">\n {Array.from({ length: 10 }).map((_, i) => (\n <AssetCardSkeleton key={i} />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nexport function IpTypeLoading() {\n return (\n <PageContainer className=\"space-y-8\">\n <PageHeaderSkeleton stats={1} />\n <div className=\"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4\">\n {Array.from({ length: 10 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n </PageContainer>\n );\n}\n\nexport function PortfolioLoading() {\n return (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <TokenCardSkeleton key={i} />\n ))}\n </div>\n );\n}\n"],"mappings":"AAcI,SACE,KADF;AAdJ,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AAErC,MAAM,OAA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U,YAAW;AAAA,UAC/B,oBAAC,YAAS,WAAU,YAAW;AAAA,aAFvB,CAGV,CACD,GACH;AAAA,SACF;AAAA,OACF,GACF;AAAA,IACA,qBAAC,SAAI,WAAU,gCACb;AAAA,2BAAC,SAAI,WAAU,gCACb;AAAA,4BAAC,YAAS,WAAU,oCAAmC;AAAA,QACvD,oBAAC,YAAS,WAAU,gCAA+B;AAAA,SACrD;AAAA,MACA,oBAAC,SAAI,WAAU,gFACZ,gBAAM,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,MAClC,oBAAC,uBAAuB,CAAG,CAC5B,GACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEO,SAAS,gBAAgB;AAC9B,SACE,qBAAC,iBAAc,WAAU,aACvB;AAAA,wBAAC,sBAAmB,OAAO,GAAG;AAAA,IAC9B,oBAAC,SAAI,WAAU,uEACZ,gBAAM,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,MAClC,oBAAC,uBAAuB,CAAG,CAC5B,GACH;AAAA,KACF;AAEJ;AAEO,SAAS,mBAAmB;AACjC,SACE,oBAAC,SAAI,WAAW,MACb,gBAAM,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,MAClC,oBAAC,uBAAuB,CAAG,CAC5B,GACH;AAEJ;","names":[]}
|
|
@@ -33,6 +33,8 @@ __export(pop_manage_page_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(pop_manage_page_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_page_container = require("./page-container.js");
|
|
37
|
+
var import_page_header = require("./page-header.js");
|
|
36
38
|
var import_react = require("react");
|
|
37
39
|
var import_sdk = require("@medialane/sdk");
|
|
38
40
|
var import_starknet = require("@medialane/sdk/starknet");
|
|
@@ -181,8 +183,8 @@ function PopManagePage({ contract }) {
|
|
|
181
183
|
if (ok) setLinks((0, import_starknet.popClaimLinks)(window.location.origin, contract, list));
|
|
182
184
|
});
|
|
183
185
|
};
|
|
184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { icon: import_lucide_react.Award, title: t("Connect your wallet"), description: t("Connect to manage your event."), children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("
|
|
185
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { icon: import_lucide_react.Award, title: t("Connect your wallet"), description: t("Connect to manage your event."), children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { variant: "narrow", className: "max-w-xl space-y-8", children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_page_header.PageHeaderSkeleton, {}),
|
|
186
188
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full rounded-2xl" }),
|
|
187
189
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-64 w-full rounded-2xl" })
|
|
188
190
|
] }) : !collection ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
@@ -193,20 +195,20 @@ function PopManagePage({ contract }) {
|
|
|
193
195
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
194
196
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: t("You are not the organizer of this event.") }),
|
|
195
197
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "soft", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/launchpad/pop", children: t("\u2190 Back to events") }) })
|
|
196
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("
|
|
198
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { variant: "narrow", className: "max-w-xl space-y-8", children: [
|
|
197
199
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: t("Manage event"), workingLabel: "Updating your event\u2026", firstStepLabel: "Prepare", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_success.TransactionSuccess, { name: collection.name ?? "Event", title: done.title, description: done.description, txHash: tx.txHash, actions: [{ label: t("Done"), onClick: tx.reset }] }) }),
|
|
198
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
201
|
+
import_page_header.PageHeader,
|
|
202
|
+
{
|
|
203
|
+
back: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "ghost", size: "sm", className: "-ml-2 w-fit", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/pop", children: [
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowLeft, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
205
|
+
t("All events")
|
|
206
|
+
] }) }),
|
|
207
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, {}),
|
|
208
|
+
title: t("Manage event"),
|
|
209
|
+
subtitle: collection.name ?? contract
|
|
210
|
+
}
|
|
211
|
+
),
|
|
210
212
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { delay: 0.08, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel relative overflow-hidden p-4 flex items-center gap-3", children: [
|
|
211
213
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-4 w-4 text-brand-blue shrink-0" }),
|
|
212
214
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: t.rich("Only the {strong} can claim.", { strong: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { className: "text-foreground", children: t("published list") }) }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Issue directly\")}</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Send a certificate to one wallet.\")}\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"soft\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Issue certificate\")}\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Participants\")}</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {t.plural(\"{count} address\", \"{count} addresses\", parsed.length)}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Publishing replaces the previous list and its links.\")}\n </p>\n <Textarea\n placeholder={t(\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\")}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-brand-blue hover:bg-brand-blue text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n {t(\"Publishing…\")}\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Publish\")} {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : t(\"participants\")}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Download claim links (CSV)\")}\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const t = useT();\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.certificateIssued(t));\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }, t));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title={t(\"Connect your wallet\")} description={t(\"Connect to manage your event.\")}>\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"Collection not found.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back\")}</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"You are not the organizer of this event.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back to events\")}</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title={t(\"Manage event\")} workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"All events\")}\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n {t(\"Organizer\")}\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">{t(\"Manage event\")}</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"panel relative overflow-hidden p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-brand-blue shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">{t.rich(\"Only the {strong} can claim.\", { strong: <strong className=\"text-foreground\">{t(\"published list\")}</strong> })}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDM;AA/CN,mBAAyB;AACzB,iBAAiC;AACjC,sBAAsF;AACtF,0BAA4F;AAC5F,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,+BAAuB;AACvB,sBAAyB;AACzB,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,6BAA+B;AAC/B,8BAA+B;AAC/B,8BAAgC;AAChC,6BAA8B;AAC9B,6BAA+B;AAC/B,sBAAqB;AAErB,SAAS,eAAe,KAAuB;AAC7C,SAAO,IACJ,MA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use client\";\n\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader, PageHeaderSkeleton } from \"./page-header.js\";\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Issue directly\")}</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Send a certificate to one wallet.\")}\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"soft\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Issue certificate\")}\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Participants\")}</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {t.plural(\"{count} address\", \"{count} addresses\", parsed.length)}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Publishing replaces the previous list and its links.\")}\n </p>\n <Textarea\n placeholder={t(\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\")}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-brand-blue hover:bg-brand-blue text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n {t(\"Publishing…\")}\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Publish\")} {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : t(\"participants\")}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Download claim links (CSV)\")}\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const t = useT();\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.certificateIssued(t));\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }, t));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title={t(\"Connect your wallet\")} description={t(\"Connect to manage your event.\")}>\n {isLoading ? (\n <PageContainer variant=\"narrow\" className=\"max-w-xl space-y-8\">\n <PageHeaderSkeleton />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </PageContainer>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"Collection not found.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back\")}</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"You are not the organizer of this event.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back to events\")}</Link>\n </Button>\n </div>\n ) : (\n <PageContainer variant=\"narrow\" className=\"max-w-xl space-y-8\">\n <TransactionDialog tx={tx} title={t(\"Manage event\")} workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n\n <PageHeader\n back={\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2 w-fit\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"All events\")}\n </Link>\n </Button>\n }\n icon={<Award />}\n title={t(\"Manage event\")}\n subtitle={collection.name ?? contract}\n />\n\n <FadeIn delay={0.08}>\n <div className=\"panel relative overflow-hidden p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-brand-blue shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">{t.rich(\"Only the {strong} can claim.\", { strong: <strong className=\"text-foreground\">{t(\"published list\")}</strong> })}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </PageContainer>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDM;AAjDN,4BAA8B;AAC9B,yBAA+C;AAC/C,mBAAyB;AACzB,iBAAiC;AACjC,sBAAsF;AACtF,0BAA4F;AAC5F,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,+BAAuB;AACvB,sBAAyB;AACzB,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,6BAA+B;AAC/B,8BAA+B;AAC/B,8BAAgC;AAChC,6BAA8B;AAC9B,6BAA+B;AAC/B,sBAAqB;AAErB,SAAS,eAAe,KAAuB;AAC7C,SAAO,IACJ,MAAM,UAAU,EAChB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,mBAAmB,KAAK,CAAC,CAAC;AAC7C;AAEA,SAAS,YAAY,OAAuB;AAC1C,QAAM,OAAO,IAAI,gBAAgB,IAAI,KAAK,KAAC,kCAAiB,KAAK,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC,CAAC;AAC1F,QAAM,SAAS,OAAO,OAAO,SAAS,cAAc,GAAG,GAAG,EAAE,MAAM,UAAU,kBAAkB,CAAC;AAC/F,SAAO,MAAM;AACb,MAAI,gBAAgB,IAAI;AAC1B;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGG;AACD,QAAM,QAAI,sBAAK;AACf,QAAM,CAAC,KAAK,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M,4CAAC,6BAAM;AAAA,QACb,OAAO,EAAE,cAAc;AAAA,QACvB,UAAU,WAAW,QAAQ;AAAA;AAAA,IAC/B;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,uDAAC,SAAI,WAAU,8DACb;AAAA,kDAAC,6BAAM,WAAU,oCAAmC;AAAA,MACpD,4CAAC,OAAE,WAAU,iCAAiC,YAAE,KAAK,gCAAgC,EAAE,QAAQ,4CAAC,YAAO,WAAU,mBAAmB,YAAE,gBAAgB,GAAE,EAAU,CAAC,GAAE;AAAA,OACvK,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":["Link"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { PageContainer } from "./page-container.js";
|
|
4
|
+
import { PageHeader, PageHeaderSkeleton } from "./page-header.js";
|
|
3
5
|
import { useState } from "react";
|
|
4
6
|
import { normalizeAddress } from "@medialane/sdk";
|
|
5
7
|
import { buildPopAllowlist, popClaimLinks, popClaimLinksCsv } from "@medialane/sdk/starknet";
|
|
@@ -148,8 +150,8 @@ function PopManagePage({ contract }) {
|
|
|
148
150
|
if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));
|
|
149
151
|
});
|
|
150
152
|
};
|
|
151
|
-
return /* @__PURE__ */ jsx(WalletRequired, { icon: Award, title: t("Connect your wallet"), description: t("Connect to manage your event."), children: isLoading ? /* @__PURE__ */ jsxs("
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
153
|
+
return /* @__PURE__ */ jsx(WalletRequired, { icon: Award, title: t("Connect your wallet"), description: t("Connect to manage your event."), children: isLoading ? /* @__PURE__ */ jsxs(PageContainer, { variant: "narrow", className: "max-w-xl space-y-8", children: [
|
|
154
|
+
/* @__PURE__ */ jsx(PageHeaderSkeleton, {}),
|
|
153
155
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full rounded-2xl" }),
|
|
154
156
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full rounded-2xl" })
|
|
155
157
|
] }) : !collection ? /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
@@ -160,20 +162,20 @@ function PopManagePage({ contract }) {
|
|
|
160
162
|
/* @__PURE__ */ jsx(Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
161
163
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("You are not the organizer of this event.") }),
|
|
162
164
|
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "soft", size: "sm", children: /* @__PURE__ */ jsx(Link, { href: "/launchpad/pop", children: t("\u2190 Back to events") }) })
|
|
163
|
-
] }) : /* @__PURE__ */ jsxs("
|
|
165
|
+
] }) : /* @__PURE__ */ jsxs(PageContainer, { variant: "narrow", className: "max-w-xl space-y-8", children: [
|
|
164
166
|
/* @__PURE__ */ jsx(TransactionDialog, { tx, title: t("Manage event"), workingLabel: "Updating your event\u2026", firstStepLabel: "Prepare", children: /* @__PURE__ */ jsx(TransactionSuccess, { name: collection.name ?? "Event", title: done.title, description: done.description, txHash: tx.txHash, actions: [{ label: t("Done"), onClick: tx.reset }] }) }),
|
|
165
|
-
/* @__PURE__ */ jsx(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
PageHeader,
|
|
169
|
+
{
|
|
170
|
+
back: /* @__PURE__ */ jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "-ml-2 w-fit", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/pop", children: [
|
|
171
|
+
/* @__PURE__ */ jsx(ArrowLeft, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
172
|
+
t("All events")
|
|
173
|
+
] }) }),
|
|
174
|
+
icon: /* @__PURE__ */ jsx(Award, {}),
|
|
175
|
+
title: t("Manage event"),
|
|
176
|
+
subtitle: collection.name ?? contract
|
|
177
|
+
}
|
|
178
|
+
),
|
|
177
179
|
/* @__PURE__ */ jsx(FadeIn, { delay: 0.08, children: /* @__PURE__ */ jsxs("div", { className: "panel relative overflow-hidden p-4 flex items-center gap-3", children: [
|
|
178
180
|
/* @__PURE__ */ jsx(Award, { className: "h-4 w-4 text-brand-blue shrink-0" }),
|
|
179
181
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t.rich("Only the {strong} can claim.", { strong: /* @__PURE__ */ jsx("strong", { className: "text-foreground", children: t("published list") }) }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Issue directly\")}</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Send a certificate to one wallet.\")}\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"soft\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Issue certificate\")}\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Participants\")}</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {t.plural(\"{count} address\", \"{count} addresses\", parsed.length)}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Publishing replaces the previous list and its links.\")}\n </p>\n <Textarea\n placeholder={t(\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\")}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-brand-blue hover:bg-brand-blue text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n {t(\"Publishing…\")}\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Publish\")} {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : t(\"participants\")}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Download claim links (CSV)\")}\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const t = useT();\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.certificateIssued(t));\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }, t));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title={t(\"Connect your wallet\")} description={t(\"Connect to manage your event.\")}>\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"Collection not found.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back\")}</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"You are not the organizer of this event.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back to events\")}</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title={t(\"Manage event\")} workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"All events\")}\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n {t(\"Organizer\")}\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">{t(\"Manage event\")}</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"panel relative overflow-hidden p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-brand-blue shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">{t.rich(\"Only the {strong} can claim.\", { strong: <strong className=\"text-foreground\">{t(\"published list\")}</strong> })}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";AAiDM,SAwEI,UAvEF,KADF;AA/CN,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB,eAAe,wBAA2C;AACtF,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GAAE,EAAU,CAAC,GAAE;AAAA,OACvK,GACF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader, PageHeaderSkeleton } from \"./page-header.js\";\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Issue directly\")}</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Send a certificate to one wallet.\")}\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"soft\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Issue certificate\")}\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"panel relative overflow-hidden p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-brand-blue\" />\n <span className=\"font-semibold text-sm\">{t(\"Participants\")}</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {t.plural(\"{count} address\", \"{count} addresses\", parsed.length)}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Publishing replaces the previous list and its links.\")}\n </p>\n <Textarea\n placeholder={t(\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\")}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-brand-blue hover:bg-brand-blue text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n {t(\"Publishing…\")}\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Publish\")} {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : t(\"participants\")}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Download claim links (CSV)\")}\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const t = useT();\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.certificateIssued(t));\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }, t));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title={t(\"Connect your wallet\")} description={t(\"Connect to manage your event.\")}>\n {isLoading ? (\n <PageContainer variant=\"narrow\" className=\"max-w-xl space-y-8\">\n <PageHeaderSkeleton />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </PageContainer>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"Collection not found.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back\")}</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"You are not the organizer of this event.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back to events\")}</Link>\n </Button>\n </div>\n ) : (\n <PageContainer variant=\"narrow\" className=\"max-w-xl space-y-8\">\n <TransactionDialog tx={tx} title={t(\"Manage event\")} workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n\n <PageHeader\n back={\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2 w-fit\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"All events\")}\n </Link>\n </Button>\n }\n icon={<Award />}\n title={t(\"Manage event\")}\n subtitle={collection.name ?? contract}\n />\n\n <FadeIn delay={0.08}>\n <div className=\"panel relative overflow-hidden p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-brand-blue shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">{t.rich(\"Only the {strong} can claim.\", { strong: <strong className=\"text-foreground\">{t(\"published list\")}</strong> })}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </PageContainer>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";AAmDM,SAwEI,UAvEF,KADF;AAjDN,SAAS,qBAAqB;AAC9B,SAAS,YAAY,0BAA0B;AAC/C,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB,eAAe,wBAA2C;AACtF,SAAS,WAAW,OAAO,aAAa,cAAc,UAAU,SAAS,MAAM,aAAa;AAC5F,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAErB,SAAS,eAAe,KAAuB;AAC7C,SAAO,IACJ,MAAM,UAAU,EAChB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,O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OAAO,aAAa,KAAK,aAAa,QAAQ,GAAG,QAAQ,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG,GACjL;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MACE,oBAAC,UAAO,SAAO,MAAC,SAAQ,SAAQ,MAAK,MAAK,WAAU,eAClD,+BAAC,QAAK,MAAK,kBACT;AAAA,8BAAC,aAAU,WAAU,sBAAqB;AAAA,UACzC,EAAE,YAAY;AAAA,WACjB,GACF;AAAA,QAEF,MAAM,oBAAC,SAAM;AAAA,QACb,OAAO,EAAE,cAAc;AAAA,QACvB,UAAU,WAAW,QAAQ;AAAA;AAAA,IAC/B;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,+BAAC,SAAI,WAAU,8DACb;AAAA,0BAAC,SAAM,WAAU,oCAAmC;AAAA,MACpD,oBAAC,OAAE,WAAU,iCAAiC,YAAE,KAAK,gCAAgC,EAAE,QAAQ,oBAAC,YAAO,WAAU,mBAAmB,YAAE,gBAAgB,GAAE,EAAU,CAAC,GAAE;AAAA,OACvK,GACF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":[]}
|
|
@@ -33,6 +33,8 @@ __export(pop_my_events_page_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(pop_my_events_page_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_page_container = require("./page-container.js");
|
|
37
|
+
var import_page_header = require("./page-header.js");
|
|
36
38
|
var import_lucide_react = require("lucide-react");
|
|
37
39
|
var import_image = __toESM(require("./image.js"), 1);
|
|
38
40
|
var import_link = __toESM(require("./link.js"), 1);
|
|
@@ -74,21 +76,19 @@ function PopMyEventsPage() {
|
|
|
74
76
|
if (!walletAddress) {
|
|
75
77
|
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: t("Sign in to see your events") }) });
|
|
76
78
|
}
|
|
77
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("
|
|
78
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
] }) })
|
|
91
|
-
] }) }),
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { variant: "narrow", className: "max-w-2xl space-y-8", children: [
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_page_header.PageHeader,
|
|
82
|
+
{
|
|
83
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, {}),
|
|
84
|
+
title: t("My events"),
|
|
85
|
+
subtitle: t("Events you've created"),
|
|
86
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, size: "sm", className: "bg-brand-blue hover:bg-brand-blue text-white gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/pop/create", children: [
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5" }),
|
|
88
|
+
t("New event")
|
|
89
|
+
] }) })
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
92
|
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: "panel relative overflow-hidden p-16 text-center space-y-3", children: [
|
|
93
93
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
94
94
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t("No events yet") }),
|
|
@@ -1 +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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction MyEventCard({ collection }: { collection: ApiCollection }) {\n const intl = useFormat();\n const t = useT();\n const imageUrl = useImageUrl()(collection.image, { width: 128 });\n const initial = (collection.name ?? \"E\").charAt(0).toUpperCase();\n\n return (\n <div className=\"panel relative 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 ?? t(\"Event\")} fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 bg-brand-blue/30 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 ?? t(\"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 {intl.number((collection.totalSupply ?? 0))} {t(\"claimed\")}\n </p>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href={`/launchpad/pop/${collection.contractAddress}/manage`}>\n <Settings className=\"h-3.5 w-3.5 mr-1\" />\n {t(\"Manage\")}\n </Link>\n </Button>\n </div>\n </div>\n );\n}\n\nexport function PopMyEventsPage() {\n const t = useT();\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={t(\"Sign in to see your events\")} />\n )}\n </div>\n );\n }\n\n return (\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-my-events-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader } from \"./page-header.js\";\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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction MyEventCard({ collection }: { collection: ApiCollection }) {\n const intl = useFormat();\n const t = useT();\n const imageUrl = useImageUrl()(collection.image, { width: 128 });\n const initial = (collection.name ?? \"E\").charAt(0).toUpperCase();\n\n return (\n <div className=\"panel relative 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 ?? t(\"Event\")} fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 bg-brand-blue/30 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 ?? t(\"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 {intl.number((collection.totalSupply ?? 0))} {t(\"claimed\")}\n </p>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href={`/launchpad/pop/${collection.contractAddress}/manage`}>\n <Settings className=\"h-3.5 w-3.5 mr-1\" />\n {t(\"Manage\")}\n </Link>\n </Button>\n </div>\n </div>\n );\n}\n\nexport function PopMyEventsPage() {\n const t = useT();\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={t(\"Sign in to see your events\")} />\n )}\n </div>\n );\n }\n\n return (\n <PageContainer variant=\"narrow\" className=\"max-w-2xl space-y-8\">\n <PageHeader\n icon={<Award />}\n title={t(\"My events\")}\n subtitle={t(\"Events you've created\")}\n action={\n <Button asChild size=\"sm\" className=\"bg-brand-blue hover:bg-brand-blue text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n {t(\"New event\")}\n </Link>\n </Button>\n }\n />\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=\"panel relative overflow-hidden 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\">{t(\"No events yet\")}</p>\n <Button asChild size=\"sm\" className=\"bg-brand-blue hover:bg-brand-blue text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n {t(\"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 </PageContainer>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BU;AA1BV,4BAA8B;AAC9B,yBAA2B;AAC3B,0BAAsC;AAEtC,mBAAkB;AAClB,kBAAiB;AACjB,oBAAuB;AACvB,sBAAyB;AACzB,+BAA6C;AAC7C,4BAA6B;AAC7B,2BAAgC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ACH;AAAA,KAEJ;AAEJ;","names":["Image","Link"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { PageContainer } from "./page-container.js";
|
|
4
|
+
import { PageHeader } from "./page-header.js";
|
|
3
5
|
import { Award, Plus, Settings } from "lucide-react";
|
|
4
6
|
import Image from "./image.js";
|
|
5
7
|
import Link from "./link.js";
|
|
@@ -41,21 +43,19 @@ function PopMyEventsPage() {
|
|
|
41
43
|
if (!walletAddress) {
|
|
42
44
|
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: t("Sign in to see your events") }) });
|
|
43
45
|
}
|
|
44
|
-
return /* @__PURE__ */ jsxs("
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */ jsx("
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
] }) })
|
|
58
|
-
] }) }),
|
|
46
|
+
return /* @__PURE__ */ jsxs(PageContainer, { variant: "narrow", className: "max-w-2xl space-y-8", children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
PageHeader,
|
|
49
|
+
{
|
|
50
|
+
icon: /* @__PURE__ */ jsx(Award, {}),
|
|
51
|
+
title: t("My events"),
|
|
52
|
+
subtitle: t("Events you've created"),
|
|
53
|
+
action: /* @__PURE__ */ jsx(Button, { asChild: true, size: "sm", className: "bg-brand-blue hover:bg-brand-blue text-white gap-1.5", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/pop/create", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }),
|
|
55
|
+
t("New event")
|
|
56
|
+
] }) })
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
59
|
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: "panel relative overflow-hidden p-16 text-center space-y-3", children: [
|
|
60
60
|
/* @__PURE__ */ jsx(Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
61
61
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("No events yet") }),
|
|
@@ -1 +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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction MyEventCard({ collection }: { collection: ApiCollection }) {\n const intl = useFormat();\n const t = useT();\n const imageUrl = useImageUrl()(collection.image, { width: 128 });\n const initial = (collection.name ?? \"E\").charAt(0).toUpperCase();\n\n return (\n <div className=\"panel relative 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 ?? t(\"Event\")} fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 bg-brand-blue/30 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 ?? t(\"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 {intl.number((collection.totalSupply ?? 0))} {t(\"claimed\")}\n </p>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href={`/launchpad/pop/${collection.contractAddress}/manage`}>\n <Settings className=\"h-3.5 w-3.5 mr-1\" />\n {t(\"Manage\")}\n </Link>\n </Button>\n </div>\n </div>\n );\n}\n\nexport function PopMyEventsPage() {\n const t = useT();\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={t(\"Sign in to see your events\")} />\n )}\n </div>\n );\n }\n\n return (\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-my-events-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader } from \"./page-header.js\";\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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction MyEventCard({ collection }: { collection: ApiCollection }) {\n const intl = useFormat();\n const t = useT();\n const imageUrl = useImageUrl()(collection.image, { width: 128 });\n const initial = (collection.name ?? \"E\").charAt(0).toUpperCase();\n\n return (\n <div className=\"panel relative 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 ?? t(\"Event\")} fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 bg-brand-blue/30 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 ?? t(\"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 {intl.number((collection.totalSupply ?? 0))} {t(\"claimed\")}\n </p>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href={`/launchpad/pop/${collection.contractAddress}/manage`}>\n <Settings className=\"h-3.5 w-3.5 mr-1\" />\n {t(\"Manage\")}\n </Link>\n </Button>\n </div>\n </div>\n );\n}\n\nexport function PopMyEventsPage() {\n const t = useT();\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={t(\"Sign in to see your events\")} />\n )}\n </div>\n );\n }\n\n return (\n <PageContainer variant=\"narrow\" className=\"max-w-2xl space-y-8\">\n <PageHeader\n icon={<Award />}\n title={t(\"My events\")}\n subtitle={t(\"Events you've created\")}\n action={\n <Button asChild size=\"sm\" className=\"bg-brand-blue hover:bg-brand-blue text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n {t(\"New event\")}\n </Link>\n </Button>\n }\n />\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=\"panel relative overflow-hidden 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\">{t(\"No events yet\")}</p>\n <Button asChild size=\"sm\" className=\"bg-brand-blue hover:bg-brand-blue text-white gap-1.5\">\n <Link href=\"/launchpad/pop/create\">\n <Plus className=\"h-3.5 w-3.5\" />\n {t(\"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 </PageContainer>\n );\n}\n"],"mappings":";AA4BU,cAYF,YAZE;AA1BV,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,OAAO,MAAM,gBAAgB;AAEtC,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,QAAQ,SAAS,mBAAmB;AAC7C,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,S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