@medialane/ui 0.217.0 → 0.219.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/empty-or-error.cjs +3 -1
- package/dist/components/empty-or-error.cjs.map +1 -1
- package/dist/components/empty-or-error.d.cts +2 -1
- package/dist/components/empty-or-error.d.ts +2 -1
- package/dist/components/empty-or-error.js +3 -1
- package/dist/components/empty-or-error.js.map +1 -1
- package/dist/components/new-collection-menu.cjs +96 -0
- package/dist/components/new-collection-menu.cjs.map +1 -0
- package/dist/components/new-collection-menu.d.cts +15 -0
- package/dist/components/new-collection-menu.d.ts +15 -0
- package/dist/components/new-collection-menu.js +60 -0
- package/dist/components/new-collection-menu.js.map +1 -0
- package/dist/components/portfolio-shell.cjs +22 -12
- package/dist/components/portfolio-shell.cjs.map +1 -1
- package/dist/components/portfolio-shell.d.cts +6 -1
- package/dist/components/portfolio-shell.d.ts +6 -1
- package/dist/components/portfolio-shell.js +22 -12
- package/dist/components/portfolio-shell.js.map +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/portfolio-counts.cjs +2 -1
- package/dist/utils/portfolio-counts.cjs.map +1 -1
- package/dist/utils/portfolio-counts.d.cts +1 -0
- package/dist/utils/portfolio-counts.d.ts +1 -0
- package/dist/utils/portfolio-counts.js +2 -1
- package/dist/utils/portfolio-counts.js.map +1 -1
- package/dist/utils/portfolio-tabs.cjs +33 -0
- package/dist/utils/portfolio-tabs.cjs.map +1 -0
- package/dist/utils/portfolio-tabs.d.cts +8 -0
- package/dist/utils/portfolio-tabs.d.ts +8 -0
- package/dist/utils/portfolio-tabs.js +9 -0
- package/dist/utils/portfolio-tabs.js.map +1 -0
- package/dist/utils/use-sponsorship.cjs +10 -8
- package/dist/utils/use-sponsorship.cjs.map +1 -1
- package/dist/utils/use-sponsorship.d.cts +1 -0
- package/dist/utils/use-sponsorship.d.ts +1 -0
- package/dist/utils/use-sponsorship.js +10 -8
- package/dist/utils/use-sponsorship.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@ function EmptyOrError({
|
|
|
45
45
|
emptyTitle,
|
|
46
46
|
emptyDescription,
|
|
47
47
|
emptyCta,
|
|
48
|
+
emptyActions,
|
|
48
49
|
emptyIcon,
|
|
49
50
|
skeletonCount = 4,
|
|
50
51
|
skeletonNode,
|
|
@@ -76,7 +77,8 @@ function EmptyOrError({
|
|
|
76
77
|
"Refresh"
|
|
77
78
|
] }),
|
|
78
79
|
emptyCta && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { size: "sm", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: emptyCta.href, children: emptyCta.label }) })
|
|
79
|
-
] })
|
|
80
|
+
] }),
|
|
81
|
+
emptyActions
|
|
80
82
|
] });
|
|
81
83
|
}
|
|
82
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/empty-or-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { RefreshCw, AlertCircle } from \"lucide-react\";\nimport { ReactNode } from \"react\";\n\ninterface EmptyOrErrorProps {\n isLoading: boolean;\n error?: unknown;\n isEmpty: boolean;\n onRetry?: () => void;\n emptyTitle: string;\n emptyDescription?: string;\n emptyCta?: { label: string; href: string };\n emptyIcon?: ReactNode;\n skeletonCount?: number;\n\n skeletonNode?: ReactNode;\n children?: ReactNode;\n}\n\nexport function EmptyOrError({\n isLoading,\n error,\n isEmpty,\n onRetry,\n emptyTitle,\n emptyDescription,\n emptyCta,\n emptyIcon,\n skeletonCount = 4,\n skeletonNode,\n children,\n}: EmptyOrErrorProps) {\n if (isLoading) {\n if (skeletonNode) return <>{skeletonNode}</>;\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: skeletonCount }).map((_, i) => (\n <Skeleton key={i} className=\"h-20 w-full rounded-xl\" />\n ))}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n <div className=\"h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto\">\n <AlertCircle className=\"h-7 w-7 text-destructive\" />\n </div>\n <p className=\"font-semibold text-lg\">Something went wrong</p>\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">\n {error instanceof Error ? error.message : \"Failed to load data. Please try again.\"}\n </p>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Try again\n </Button>\n )}\n </div>\n );\n }\n\n if (isEmpty) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n {emptyIcon && (\n <div className=\"h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto\">\n {emptyIcon}\n </div>\n )}\n <p className=\"font-semibold text-lg\">{emptyTitle}</p>\n {emptyDescription && (\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">{emptyDescription}</p>\n )}\n <div className=\"flex items-center justify-center gap-3\">\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Refresh\n </Button>\n )}\n {emptyCta && (\n <Button size=\"sm\" asChild>\n <Link href={emptyCta.href}>{emptyCta.label}</Link>\n </Button>\n )}\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/empty-or-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { RefreshCw, AlertCircle } from \"lucide-react\";\nimport { ReactNode } from \"react\";\n\ninterface EmptyOrErrorProps {\n isLoading: boolean;\n error?: unknown;\n isEmpty: boolean;\n onRetry?: () => void;\n emptyTitle: string;\n emptyDescription?: string;\n emptyCta?: { label: string; href: string };\n emptyActions?: ReactNode;\n emptyIcon?: ReactNode;\n skeletonCount?: number;\n\n skeletonNode?: ReactNode;\n children?: ReactNode;\n}\n\nexport function EmptyOrError({\n isLoading,\n error,\n isEmpty,\n onRetry,\n emptyTitle,\n emptyDescription,\n emptyCta,\n emptyActions,\n emptyIcon,\n skeletonCount = 4,\n skeletonNode,\n children,\n}: EmptyOrErrorProps) {\n if (isLoading) {\n if (skeletonNode) return <>{skeletonNode}</>;\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: skeletonCount }).map((_, i) => (\n <Skeleton key={i} className=\"h-20 w-full rounded-xl\" />\n ))}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n <div className=\"h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto\">\n <AlertCircle className=\"h-7 w-7 text-destructive\" />\n </div>\n <p className=\"font-semibold text-lg\">Something went wrong</p>\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">\n {error instanceof Error ? error.message : \"Failed to load data. Please try again.\"}\n </p>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Try again\n </Button>\n )}\n </div>\n );\n }\n\n if (isEmpty) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n {emptyIcon && (\n <div className=\"h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto\">\n {emptyIcon}\n </div>\n )}\n <p className=\"font-semibold text-lg\">{emptyTitle}</p>\n {emptyDescription && (\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">{emptyDescription}</p>\n )}\n <div className=\"flex items-center justify-center gap-3\">\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Refresh\n </Button>\n )}\n {emptyCta && (\n <Button size=\"sm\" asChild>\n <Link href={emptyCta.href}>{emptyCta.label}</Link>\n </Button>\n )}\n </div>\n {emptyActions}\n </div>\n );\n }\n\n return <>{children}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuC6B;AArC7B,sBAAyB;AACzB,oBAAuB;AACvB,kBAAiB;AACjB,0BAAuC;AAmBhC,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AACF,GAAsB;AACpB,MAAI,WAAW;AACb,QAAI,aAAc,QAAO,2EAAG,wBAAa;AACzC,WACE,4CAAC,SAAI,WAAU,aACZ,gBAAM,KAAK,EAAE,QAAQ,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG,MAC7C,4CAAC,4BAAiB,WAAU,4BAAb,CAAsC,CACtD,GACH;AAAA,EAEJ;AAEA,MAAI,OAAO;AACT,WACE,6CAAC,SAAI,WAAU,+BACb;AAAA,kDAAC,SAAI,WAAU,mFACb,sDAAC,mCAAY,WAAU,4BAA2B,GACpD;AAAA,MACA,4CAAC,OAAE,WAAU,yBAAwB,kCAAoB;AAAA,MACzD,4CAAC,OAAE,WAAU,kDACV,2BAAiB,QAAQ,MAAM,UAAU,0CAC5C;AAAA,MACC,WACC,6CAAC,wBAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,oDAAC,iCAAU,WAAU,sBAAqB;AAAA,QAAE;AAAA,SAE9C;AAAA,OAEJ;AAAA,EAEJ;AAEA,MAAI,SAAS;AACX,WACE,6CAAC,SAAI,WAAU,+BACZ;AAAA,mBACC,4CAAC,SAAI,WAAU,0EACZ,qBACH;AAAA,MAEF,4CAAC,OAAE,WAAU,yBAAyB,sBAAW;AAAA,MAChD,oBACC,4CAAC,OAAE,WAAU,kDAAkD,4BAAiB;AAAA,MAElF,6CAAC,SAAI,WAAU,0CACZ;AAAA,mBACC,6CAAC,wBAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,sDAAC,iCAAU,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE9C;AAAA,QAED,YACC,4CAAC,wBAAO,MAAK,MAAK,SAAO,MACvB,sDAAC,YAAAA,SAAA,EAAK,MAAM,SAAS,MAAO,mBAAS,OAAM,GAC7C;AAAA,SAEJ;AAAA,MACC;AAAA,OACH;AAAA,EAEJ;AAEA,SAAO,2EAAG,UAAS;AACrB;","names":["Link"]}
|
|
@@ -12,11 +12,12 @@ interface EmptyOrErrorProps {
|
|
|
12
12
|
label: string;
|
|
13
13
|
href: string;
|
|
14
14
|
};
|
|
15
|
+
emptyActions?: ReactNode;
|
|
15
16
|
emptyIcon?: ReactNode;
|
|
16
17
|
skeletonCount?: number;
|
|
17
18
|
skeletonNode?: ReactNode;
|
|
18
19
|
children?: ReactNode;
|
|
19
20
|
}
|
|
20
|
-
declare function EmptyOrError({ isLoading, error, isEmpty, onRetry, emptyTitle, emptyDescription, emptyCta, emptyIcon, skeletonCount, skeletonNode, children, }: EmptyOrErrorProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function EmptyOrError({ isLoading, error, isEmpty, onRetry, emptyTitle, emptyDescription, emptyCta, emptyActions, emptyIcon, skeletonCount, skeletonNode, children, }: EmptyOrErrorProps): react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
export { EmptyOrError };
|
|
@@ -12,11 +12,12 @@ interface EmptyOrErrorProps {
|
|
|
12
12
|
label: string;
|
|
13
13
|
href: string;
|
|
14
14
|
};
|
|
15
|
+
emptyActions?: ReactNode;
|
|
15
16
|
emptyIcon?: ReactNode;
|
|
16
17
|
skeletonCount?: number;
|
|
17
18
|
skeletonNode?: ReactNode;
|
|
18
19
|
children?: ReactNode;
|
|
19
20
|
}
|
|
20
|
-
declare function EmptyOrError({ isLoading, error, isEmpty, onRetry, emptyTitle, emptyDescription, emptyCta, emptyIcon, skeletonCount, skeletonNode, children, }: EmptyOrErrorProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function EmptyOrError({ isLoading, error, isEmpty, onRetry, emptyTitle, emptyDescription, emptyCta, emptyActions, emptyIcon, skeletonCount, skeletonNode, children, }: EmptyOrErrorProps): react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
export { EmptyOrError };
|
|
@@ -12,6 +12,7 @@ function EmptyOrError({
|
|
|
12
12
|
emptyTitle,
|
|
13
13
|
emptyDescription,
|
|
14
14
|
emptyCta,
|
|
15
|
+
emptyActions,
|
|
15
16
|
emptyIcon,
|
|
16
17
|
skeletonCount = 4,
|
|
17
18
|
skeletonNode,
|
|
@@ -43,7 +44,8 @@ function EmptyOrError({
|
|
|
43
44
|
"Refresh"
|
|
44
45
|
] }),
|
|
45
46
|
emptyCta && /* @__PURE__ */ jsx(Button, { size: "sm", asChild: true, children: /* @__PURE__ */ jsx(Link, { href: emptyCta.href, children: emptyCta.label }) })
|
|
46
|
-
] })
|
|
47
|
+
] }),
|
|
48
|
+
emptyActions
|
|
47
49
|
] });
|
|
48
50
|
}
|
|
49
51
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/empty-or-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { RefreshCw, AlertCircle } from \"lucide-react\";\nimport { ReactNode } from \"react\";\n\ninterface EmptyOrErrorProps {\n isLoading: boolean;\n error?: unknown;\n isEmpty: boolean;\n onRetry?: () => void;\n emptyTitle: string;\n emptyDescription?: string;\n emptyCta?: { label: string; href: string };\n emptyIcon?: ReactNode;\n skeletonCount?: number;\n\n skeletonNode?: ReactNode;\n children?: ReactNode;\n}\n\nexport function EmptyOrError({\n isLoading,\n error,\n isEmpty,\n onRetry,\n emptyTitle,\n emptyDescription,\n emptyCta,\n emptyIcon,\n skeletonCount = 4,\n skeletonNode,\n children,\n}: EmptyOrErrorProps) {\n if (isLoading) {\n if (skeletonNode) return <>{skeletonNode}</>;\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: skeletonCount }).map((_, i) => (\n <Skeleton key={i} className=\"h-20 w-full rounded-xl\" />\n ))}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n <div className=\"h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto\">\n <AlertCircle className=\"h-7 w-7 text-destructive\" />\n </div>\n <p className=\"font-semibold text-lg\">Something went wrong</p>\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">\n {error instanceof Error ? error.message : \"Failed to load data. Please try again.\"}\n </p>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Try again\n </Button>\n )}\n </div>\n );\n }\n\n if (isEmpty) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n {emptyIcon && (\n <div className=\"h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto\">\n {emptyIcon}\n </div>\n )}\n <p className=\"font-semibold text-lg\">{emptyTitle}</p>\n {emptyDescription && (\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">{emptyDescription}</p>\n )}\n <div className=\"flex items-center justify-center gap-3\">\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Refresh\n </Button>\n )}\n {emptyCta && (\n <Button size=\"sm\" asChild>\n <Link href={emptyCta.href}>{emptyCta.label}</Link>\n </Button>\n )}\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/components/empty-or-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { RefreshCw, AlertCircle } from \"lucide-react\";\nimport { ReactNode } from \"react\";\n\ninterface EmptyOrErrorProps {\n isLoading: boolean;\n error?: unknown;\n isEmpty: boolean;\n onRetry?: () => void;\n emptyTitle: string;\n emptyDescription?: string;\n emptyCta?: { label: string; href: string };\n emptyActions?: ReactNode;\n emptyIcon?: ReactNode;\n skeletonCount?: number;\n\n skeletonNode?: ReactNode;\n children?: ReactNode;\n}\n\nexport function EmptyOrError({\n isLoading,\n error,\n isEmpty,\n onRetry,\n emptyTitle,\n emptyDescription,\n emptyCta,\n emptyActions,\n emptyIcon,\n skeletonCount = 4,\n skeletonNode,\n children,\n}: EmptyOrErrorProps) {\n if (isLoading) {\n if (skeletonNode) return <>{skeletonNode}</>;\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: skeletonCount }).map((_, i) => (\n <Skeleton key={i} className=\"h-20 w-full rounded-xl\" />\n ))}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n <div className=\"h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto\">\n <AlertCircle className=\"h-7 w-7 text-destructive\" />\n </div>\n <p className=\"font-semibold text-lg\">Something went wrong</p>\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">\n {error instanceof Error ? error.message : \"Failed to load data. Please try again.\"}\n </p>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Try again\n </Button>\n )}\n </div>\n );\n }\n\n if (isEmpty) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n {emptyIcon && (\n <div className=\"h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto\">\n {emptyIcon}\n </div>\n )}\n <p className=\"font-semibold text-lg\">{emptyTitle}</p>\n {emptyDescription && (\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">{emptyDescription}</p>\n )}\n <div className=\"flex items-center justify-center gap-3\">\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Refresh\n </Button>\n )}\n {emptyCta && (\n <Button size=\"sm\" asChild>\n <Link href={emptyCta.href}>{emptyCta.label}</Link>\n </Button>\n )}\n </div>\n {emptyActions}\n </div>\n );\n }\n\n return <>{children}</>;\n}\n"],"mappings":";AAuC6B,wBAqBnB,YArBmB;AArC7B,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,WAAW,mBAAmB;AAmBhC,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AACF,GAAsB;AACpB,MAAI,WAAW;AACb,QAAI,aAAc,QAAO,gCAAG,wBAAa;AACzC,WACE,oBAAC,SAAI,WAAU,aACZ,gBAAM,KAAK,EAAE,QAAQ,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG,MAC7C,oBAAC,YAAiB,WAAU,4BAAb,CAAsC,CACtD,GACH;AAAA,EAEJ;AAEA,MAAI,OAAO;AACT,WACE,qBAAC,SAAI,WAAU,+BACb;AAAA,0BAAC,SAAI,WAAU,mFACb,8BAAC,eAAY,WAAU,4BAA2B,GACpD;AAAA,MACA,oBAAC,OAAE,WAAU,yBAAwB,kCAAoB;AAAA,MACzD,oBAAC,OAAE,WAAU,kDACV,2BAAiB,QAAQ,MAAM,UAAU,0CAC5C;AAAA,MACC,WACC,qBAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,4BAAC,aAAU,WAAU,sBAAqB;AAAA,QAAE;AAAA,SAE9C;AAAA,OAEJ;AAAA,EAEJ;AAEA,MAAI,SAAS;AACX,WACE,qBAAC,SAAI,WAAU,+BACZ;AAAA,mBACC,oBAAC,SAAI,WAAU,0EACZ,qBACH;AAAA,MAEF,oBAAC,OAAE,WAAU,yBAAyB,sBAAW;AAAA,MAChD,oBACC,oBAAC,OAAE,WAAU,kDAAkD,4BAAiB;AAAA,MAElF,qBAAC,SAAI,WAAU,0CACZ;AAAA,mBACC,qBAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,8BAAC,aAAU,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE9C;AAAA,QAED,YACC,oBAAC,UAAO,MAAK,MAAK,SAAO,MACvB,8BAAC,QAAK,MAAM,SAAS,MAAO,mBAAS,OAAM,GAC7C;AAAA,SAEJ;AAAA,MACC;AAAA,OACH;AAAA,EAEJ;AAEA,SAAO,gCAAG,UAAS;AACrB;","names":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 new_collection_menu_exports = {};
|
|
31
|
+
__export(new_collection_menu_exports, {
|
|
32
|
+
COLLECTION_TYPES: () => COLLECTION_TYPES,
|
|
33
|
+
CollectionTypeChoices: () => CollectionTypeChoices,
|
|
34
|
+
NewCollectionMenu: () => NewCollectionMenu
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(new_collection_menu_exports);
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
40
|
+
var import_button = require("./button.js");
|
|
41
|
+
var import_dropdown_menu = require("./dropdown-menu.js");
|
|
42
|
+
const COLLECTION_TYPES = [
|
|
43
|
+
{
|
|
44
|
+
id: "single",
|
|
45
|
+
label: "Single edition",
|
|
46
|
+
description: "Each piece is one of a kind",
|
|
47
|
+
href: "/launchpad/single-editions/collection",
|
|
48
|
+
Icon: import_lucide_react.Sparkles
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "multi",
|
|
52
|
+
label: "Multi edition",
|
|
53
|
+
description: "Each piece can have many copies",
|
|
54
|
+
href: "/launchpad/nfteditions/create",
|
|
55
|
+
Icon: import_lucide_react.Layers
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
function NewCollectionMenu() {
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenu, { children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { size: "sm", children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
62
|
+
"New collection"
|
|
63
|
+
] }) }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuContent, { align: "end", className: "w-64", children: COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href, className: "flex items-start gap-3 p-2", children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex flex-col", children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-medium", children: label }),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground", children: description })
|
|
69
|
+
] })
|
|
70
|
+
] }) }, id)) })
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
function CollectionTypeChoices() {
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-3 sm:grid-cols-2 max-w-xl mx-auto text-left", children: COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
75
|
+
import_link.default,
|
|
76
|
+
{
|
|
77
|
+
href,
|
|
78
|
+
className: "flex items-start gap-3 rounded-xl border border-border p-4 transition-colors hover:bg-muted",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5 mt-0.5 text-muted-foreground" }),
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex flex-col", children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold", children: label }),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground", children: description })
|
|
84
|
+
] })
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
id
|
|
88
|
+
)) });
|
|
89
|
+
}
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
COLLECTION_TYPES,
|
|
93
|
+
CollectionTypeChoices,
|
|
94
|
+
NewCollectionMenu
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=new-collection-menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/new-collection-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { Layers, Plus, Sparkles, type LucideIcon } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\n\ninterface CollectionType {\n id: \"single\" | \"multi\";\n label: string;\n description: string;\n href: string;\n Icon: LucideIcon;\n}\n\nexport const COLLECTION_TYPES: readonly CollectionType[] = [\n {\n id: \"single\",\n label: \"Single edition\",\n description: \"Each piece is one of a kind\",\n href: \"/launchpad/single-editions/collection\",\n Icon: Sparkles,\n },\n {\n id: \"multi\",\n label: \"Multi edition\",\n description: \"Each piece can have many copies\",\n href: \"/launchpad/nfteditions/create\",\n Icon: Layers,\n },\n];\n\nexport function NewCollectionMenu() {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button size=\"sm\">\n <Plus className=\"h-3.5 w-3.5 mr-1.5\" />\n New collection\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-64\">\n {COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => (\n <DropdownMenuItem key={id} asChild>\n <Link href={href} className=\"flex items-start gap-3 p-2\">\n <Icon className=\"h-4 w-4 mt-0.5 text-muted-foreground\" />\n <span className=\"flex flex-col\">\n <span className=\"text-sm font-medium\">{label}</span>\n <span className=\"text-xs text-muted-foreground\">{description}</span>\n </span>\n </Link>\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nexport function CollectionTypeChoices() {\n return (\n <div className=\"grid gap-3 sm:grid-cols-2 max-w-xl mx-auto text-left\">\n {COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => (\n <Link\n key={id}\n href={href}\n className=\"flex items-start gap-3 rounded-xl border border-border p-4 transition-colors hover:bg-muted\"\n >\n <Icon className=\"h-5 w-5 mt-0.5 text-muted-foreground\" />\n <span className=\"flex flex-col\">\n <span className=\"text-sm font-semibold\">{label}</span>\n <span className=\"text-xs text-muted-foreground\">{description}</span>\n </span>\n </Link>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCQ;AAlCR,0BAAwD;AACxD,kBAAiB;AACjB,oBAAuB;AACvB,2BAAyF;AAUlF,MAAM,mBAA8C;AAAA,EACzD;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;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'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface CollectionType {
|
|
5
|
+
id: "single" | "multi";
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
href: string;
|
|
9
|
+
Icon: LucideIcon;
|
|
10
|
+
}
|
|
11
|
+
declare const COLLECTION_TYPES: readonly CollectionType[];
|
|
12
|
+
declare function NewCollectionMenu(): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function CollectionTypeChoices(): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { COLLECTION_TYPES, CollectionTypeChoices, NewCollectionMenu };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface CollectionType {
|
|
5
|
+
id: "single" | "multi";
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
href: string;
|
|
9
|
+
Icon: LucideIcon;
|
|
10
|
+
}
|
|
11
|
+
declare const COLLECTION_TYPES: readonly CollectionType[];
|
|
12
|
+
declare function NewCollectionMenu(): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function CollectionTypeChoices(): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { COLLECTION_TYPES, CollectionTypeChoices, NewCollectionMenu };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Layers, Plus, Sparkles } from "lucide-react";
|
|
4
|
+
import Link from "./link.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
7
|
+
const COLLECTION_TYPES = [
|
|
8
|
+
{
|
|
9
|
+
id: "single",
|
|
10
|
+
label: "Single edition",
|
|
11
|
+
description: "Each piece is one of a kind",
|
|
12
|
+
href: "/launchpad/single-editions/collection",
|
|
13
|
+
Icon: Sparkles
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "multi",
|
|
17
|
+
label: "Multi edition",
|
|
18
|
+
description: "Each piece can have many copies",
|
|
19
|
+
href: "/launchpad/nfteditions/create",
|
|
20
|
+
Icon: Layers
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
function NewCollectionMenu() {
|
|
24
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { size: "sm", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
27
|
+
"New collection"
|
|
28
|
+
] }) }),
|
|
29
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "w-64", children: COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs(Link, { href, className: "flex items-start gap-3 p-2", children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
31
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-col", children: [
|
|
32
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: label }),
|
|
33
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: description })
|
|
34
|
+
] })
|
|
35
|
+
] }) }, id)) })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
function CollectionTypeChoices() {
|
|
39
|
+
return /* @__PURE__ */ jsx("div", { className: "grid gap-3 sm:grid-cols-2 max-w-xl mx-auto text-left", children: COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => /* @__PURE__ */ jsxs(
|
|
40
|
+
Link,
|
|
41
|
+
{
|
|
42
|
+
href,
|
|
43
|
+
className: "flex items-start gap-3 rounded-xl border border-border p-4 transition-colors hover:bg-muted",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-5 w-5 mt-0.5 text-muted-foreground" }),
|
|
46
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-col", children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: label }),
|
|
48
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: description })
|
|
49
|
+
] })
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
id
|
|
53
|
+
)) });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
COLLECTION_TYPES,
|
|
57
|
+
CollectionTypeChoices,
|
|
58
|
+
NewCollectionMenu
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=new-collection-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/new-collection-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { Layers, Plus, Sparkles, type LucideIcon } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\n\ninterface CollectionType {\n id: \"single\" | \"multi\";\n label: string;\n description: string;\n href: string;\n Icon: LucideIcon;\n}\n\nexport const COLLECTION_TYPES: readonly CollectionType[] = [\n {\n id: \"single\",\n label: \"Single edition\",\n description: \"Each piece is one of a kind\",\n href: \"/launchpad/single-editions/collection\",\n Icon: Sparkles,\n },\n {\n id: \"multi\",\n label: \"Multi edition\",\n description: \"Each piece can have many copies\",\n href: \"/launchpad/nfteditions/create\",\n Icon: Layers,\n },\n];\n\nexport function NewCollectionMenu() {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button size=\"sm\">\n <Plus className=\"h-3.5 w-3.5 mr-1.5\" />\n New collection\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-64\">\n {COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => (\n <DropdownMenuItem key={id} asChild>\n <Link href={href} className=\"flex items-start gap-3 p-2\">\n <Icon className=\"h-4 w-4 mt-0.5 text-muted-foreground\" />\n <span className=\"flex flex-col\">\n <span className=\"text-sm font-medium\">{label}</span>\n <span className=\"text-xs text-muted-foreground\">{description}</span>\n </span>\n </Link>\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nexport function CollectionTypeChoices() {\n return (\n <div className=\"grid gap-3 sm:grid-cols-2 max-w-xl mx-auto text-left\">\n {COLLECTION_TYPES.map(({ id, label, description, href, Icon }) => (\n <Link\n key={id}\n href={href}\n className=\"flex items-start gap-3 rounded-xl border border-border p-4 transition-colors hover:bg-muted\"\n >\n <Icon className=\"h-5 w-5 mt-0.5 text-muted-foreground\" />\n <span className=\"flex flex-col\">\n <span className=\"text-sm font-semibold\">{label}</span>\n <span className=\"text-xs text-muted-foreground\">{description}</span>\n </span>\n </Link>\n ))}\n </div>\n );\n}\n"],"mappings":";AAoCQ,SACE,KADF;AAlCR,SAAS,QAAQ,MAAM,gBAAiC;AACxD,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,cAAc,qBAAqB,kBAAkB,2BAA2B;AAUlF,MAAM,mBAA8C;AAAA,EACzD;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAEO,SAAS,oBAAoB;AAClC,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B,+BAAC,UAAO,MAAK,MACX;AAAA,0BAAC,QAAK,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAEzC,GACF;AAAA,IACA,oBAAC,uBAAoB,OAAM,OAAM,WAAU,QACxC,2BAAiB,IAAI,CAAC,EAAE,IAAI,OAAO,aAAa,MAAM,KAAK,MAC1D,oBAAC,oBAA0B,SAAO,MAChC,+BAAC,QAAK,MAAY,WAAU,8BAC1B;AAAA,0BAAC,QAAK,WAAU,wCAAuC;AAAA,MACvD,qBAAC,UAAK,WAAU,iBACd;AAAA,4BAAC,UAAK,WAAU,uBAAuB,iBAAM;AAAA,QAC7C,oBAAC,UAAK,WAAU,iCAAiC,uBAAY;AAAA,SAC/D;AAAA,OACF,KAPqB,EAQvB,CACD,GACH;AAAA,KACF;AAEJ;AAEO,SAAS,wBAAwB;AACtC,SACE,oBAAC,SAAI,WAAU,wDACZ,2BAAiB,IAAI,CAAC,EAAE,IAAI,OAAO,aAAa,MAAM,KAAK,MAC1D;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACA,WAAU;AAAA,MAEV;AAAA,4BAAC,QAAK,WAAU,wCAAuC;AAAA,QACvD,qBAAC,UAAK,WAAU,iBACd;AAAA,8BAAC,UAAK,WAAU,yBAAyB,iBAAM;AAAA,UAC/C,oBAAC,UAAK,WAAU,iCAAiC,uBAAY;AAAA,WAC/D;AAAA;AAAA;AAAA,IARK;AAAA,EASP,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -33,6 +33,7 @@ var import_portfolio_header = require("./portfolio-header.js");
|
|
|
33
33
|
var import_portfolio_chip_filter = require("./portfolio-chip-filter.js");
|
|
34
34
|
var import_medialane_app = require("./medialane-app.js");
|
|
35
35
|
var import_portfolio_counts = require("../utils/portfolio-counts.js");
|
|
36
|
+
var import_portfolio_tabs = require("../utils/portfolio-tabs.js");
|
|
36
37
|
var import_seen_offers = require("../utils/seen-offers.js");
|
|
37
38
|
var import_use_orders = require("../utils/use-orders.js");
|
|
38
39
|
var import_use_rewards = require("../utils/use-rewards.js");
|
|
@@ -40,12 +41,12 @@ var import_use_sponsorship = require("../utils/use-sponsorship.js");
|
|
|
40
41
|
const PORTFOLIO_TABS = [
|
|
41
42
|
{ key: "assets", label: "Assets", href: "/portfolio/assets" },
|
|
42
43
|
{ key: "collections", label: "Collections", href: "/portfolio/collections" },
|
|
43
|
-
{ key: "listings", label: "Listings", href: "/portfolio/listings" },
|
|
44
|
-
{ key: "received", label: "Offers received", href: "/portfolio/received" },
|
|
45
|
-
{ key: "offers", label: "Offers sent", href: "/portfolio/offers" },
|
|
46
|
-
{ key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers" },
|
|
47
|
-
{ key: "licensing", label: "Licensing", href: "/portfolio/licensing" },
|
|
48
|
-
{ key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships" },
|
|
44
|
+
{ key: "listings", label: "Listings", href: "/portfolio/listings", hideWhenEmpty: true },
|
|
45
|
+
{ key: "received", label: "Offers received", href: "/portfolio/received", hideWhenEmpty: true },
|
|
46
|
+
{ key: "offers", label: "Offers sent", href: "/portfolio/offers", hideWhenEmpty: true },
|
|
47
|
+
{ key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers", hideWhenEmpty: true },
|
|
48
|
+
{ key: "licensing", label: "Licensing", href: "/portfolio/licensing", hideWhenEmpty: true },
|
|
49
|
+
{ key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships", hideWhenEmpty: true },
|
|
49
50
|
{ key: "activity", label: "Activity", href: "/portfolio/activity" }
|
|
50
51
|
];
|
|
51
52
|
function SignedOut() {
|
|
@@ -64,19 +65,28 @@ function Loading() {
|
|
|
64
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "mx-auto h-4 w-72" })
|
|
65
66
|
] });
|
|
66
67
|
}
|
|
67
|
-
function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
|
|
68
|
+
function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, licensing, children }) {
|
|
68
69
|
const { walletAddress: address, walletLoading } = (0, import_medialane_app.useMedialaneApp)();
|
|
69
70
|
const pathname = (0, import_router.usePathname)();
|
|
70
|
-
const { orders } = (0, import_use_orders.useUserOrders)(address);
|
|
71
|
-
const { orders: receivedOffers } = (0, import_use_orders.useReceivedOffers)(address);
|
|
71
|
+
const { orders, isLoading: ordersLoading } = (0, import_use_orders.useUserOrders)(address);
|
|
72
|
+
const { orders: receivedOffers, isLoading: receivedLoading } = (0, import_use_orders.useReceivedOffers)(address);
|
|
72
73
|
const { data: rewards } = (0, import_use_rewards.useRewards)(address);
|
|
73
|
-
const
|
|
74
|
+
const sponsorship = (0, import_use_sponsorship.useMySponsorshipDealCounts)(address);
|
|
74
75
|
(0, import_react.useEffect)(() => {
|
|
75
76
|
if (receivedOffers.length > 0) (0, import_seen_offers.markOffersAsSeen)(receivedOffers.map((o) => o.orderHash));
|
|
76
77
|
}, [receivedOffers]);
|
|
77
78
|
if (!address) return walletLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignedOut, {});
|
|
78
|
-
const counts = (0, import_portfolio_counts.derivePortfolioCounts)({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });
|
|
79
|
+
const counts = (0, import_portfolio_counts.derivePortfolioCounts)({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: sponsorship.pendingCount });
|
|
79
80
|
const countFor = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };
|
|
81
|
+
const present = {
|
|
82
|
+
listings: ordersLoading ? void 0 : counts.listings > 0,
|
|
83
|
+
offers: ordersLoading ? void 0 : counts.offers > 0,
|
|
84
|
+
counter: ordersLoading ? void 0 : counts.counter > 0,
|
|
85
|
+
received: receivedLoading ? void 0 : counts.received > 0,
|
|
86
|
+
licensing: licensing ? licensing.isLoading ? void 0 : licensing.present : true,
|
|
87
|
+
sponsorship: sponsorship.isLoading ? void 0 : sponsorship.hasAny
|
|
88
|
+
};
|
|
89
|
+
const shownTabs = (0, import_portfolio_tabs.visiblePortfolioTabs)(tabs, present, pathname ?? "");
|
|
80
90
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8", children: [
|
|
81
91
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
92
|
import_portfolio_header.PortfolioHeader,
|
|
@@ -88,7 +98,7 @@ function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
|
|
|
88
98
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
99
|
import_portfolio_chip_filter.PortfolioChipFilter,
|
|
90
100
|
{
|
|
91
|
-
options:
|
|
101
|
+
options: shownTabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label })),
|
|
92
102
|
value: pathname ?? "",
|
|
93
103
|
onChange: () => {
|
|
94
104
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\" },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\" },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\" },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\" },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\" },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\" },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders } = useUserOrders(address);\n const { orders: receivedOffers } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { visiblePortfolioTabs } from \"../utils/portfolio-tabs.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n hideWhenEmpty?: boolean;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\", hideWhenEmpty: true },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\", hideWhenEmpty: true },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\", hideWhenEmpty: true },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\", hideWhenEmpty: true },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\", hideWhenEmpty: true },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\", hideWhenEmpty: true },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, licensing, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n licensing?: { present: boolean; isLoading: boolean };\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders, isLoading: ordersLoading } = useUserOrders(address);\n const { orders: receivedOffers, isLoading: receivedLoading } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const sponsorship = useMySponsorshipDealCounts(address);\n\n useEffect(() => {\n if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));\n }, [receivedOffers]);\n\n if (!address) return walletLoading ? <Loading /> : <SignedOut />;\n\n const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: sponsorship.pendingCount });\n const countFor: Record<string, number> = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };\n const present: Record<string, boolean | undefined> = {\n listings: ordersLoading ? undefined : counts.listings > 0,\n offers: ordersLoading ? undefined : counts.offers > 0,\n counter: ordersLoading ? undefined : counts.counter > 0,\n received: receivedLoading ? undefined : counts.received > 0,\n licensing: licensing ? (licensing.isLoading ? undefined : licensing.present) : true,\n sponsorship: sponsorship.isLoading ? undefined : sponsorship.hasAny,\n };\n const shownTabs = visiblePortfolioTabs(tabs, present, pathname ?? \"\");\n\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8\">\n <PortfolioHeader\n address={address}\n score={rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: \"/rewards\" } : null}\n />\n <PortfolioChipFilter\n options={shownTabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label }))}\n value={pathname ?? \"\"}\n onChange={() => {}}\n showAll={false}\n />\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCI;AArCJ,mBAA0C;AAC1C,0BAAuB;AACvB,oBAA4B;AAC5B,oBAAuB;AACvB,sBAAyB;AACzB,8BAAgC;AAChC,mCAAoC;AACpC,2BAAgC;AAChC,8BAAsC;AACtC,4BAAqC;AACrC,yBAAiC;AACjC,wBAAiD;AACjD,yBAA2B;AAC3B,6BAA2C;AASpC,MAAM,iBAAiC;AAAA,EAC5C,EAAE,KAAK,UAAU,OAAO,UAAU,MAAM,oBAAoB;AAAA,EAC5D,EAAE,KAAK,eAAe,OAAO,eAAe,MAAM,yBAAyB;AAAA,EAC3E,EAAE,KAAK,YAAY,OAAO,YAAY,MAAM,uBAAuB,eAAe,KAAK;AAAA,EACvF,EAAE,KAAK,YAAY,OAAO,mBAAmB,MAAM,uBAAuB,eAAe,KAAK;AAAA,EAC9F,EAAE,KAAK,UAAU,OAAO,eAAe,MAAM,qBAAqB,eAAe,KAAK;AAAA,EACtF,EAAE,KAAK,WAAW,OAAO,kBAAkB,MAAM,6BAA6B,eAAe,KAAK;AAAA,EAClG,EAAE,KAAK,aAAa,OAAO,aAAa,MAAM,wBAAwB,eAAe,KAAK;AAAA,EAC1F,EAAE,KAAK,eAAe,OAAO,gBAAgB,MAAM,2BAA2B,eAAe,KAAK;AAAA,EAClG,EAAE,KAAK,YAAY,OAAO,YAAY,MAAM,sBAAsB;AACpE;AAEA,SAAS,YAAY;AACnB,QAAM,EAAE,iBAAiB,aAAa,QAAI,sCAAgB;AAC1D,SACE,6CAAC,S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Y,OAAO,WAAW;AAAA,IACxD,QAAQ,gBAAgB,SAAY,OAAO,SAAS;AAAA,IACpD,SAAS,gBAAgB,SAAY,OAAO,UAAU;AAAA,IACtD,UAAU,kBAAkB,SAAY,OAAO,WAAW;AAAA,IAC1D,WAAW,YAAa,UAAU,YAAY,SAAY,UAAU,UAAW;AAAA,IAC/E,aAAa,YAAY,YAAY,SAAY,YAAY;AAAA,EAC/D;AACA,QAAM,gBAAY,4CAAqB,MAAM,SAAS,YAAY,EAAE;AAEpE,SACE,6CAAC,SAAI,WAAU,6CACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,UAAU,EAAE,WAAW,QAAQ,kBAAkB,SAAS,QAAQ,SAAS,MAAM,WAAW,IAAI;AAAA;AAAA,IACzG;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,UAAU,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,OAAO,SAAS,EAAE,GAAG,IAAI,GAAG,EAAE,KAAK,KAAK,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE;AAAA,QAClI,OAAO,YAAY;AAAA,QACnB,UAAU,MAAM;AAAA,QAAC;AAAA,QACjB,SAAS;AAAA;AAAA,IACX;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -5,13 +5,18 @@ interface PortfolioTab {
|
|
|
5
5
|
key: string;
|
|
6
6
|
label: string;
|
|
7
7
|
href: string;
|
|
8
|
+
hideWhenEmpty?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const PORTFOLIO_TABS: PortfolioTab[];
|
|
10
|
-
declare function PortfolioShell({ tabs, remixOffers, children }: {
|
|
11
|
+
declare function PortfolioShell({ tabs, remixOffers, licensing, children }: {
|
|
11
12
|
tabs?: PortfolioTab[];
|
|
12
13
|
remixOffers?: ReadonlyArray<{
|
|
13
14
|
status: string;
|
|
14
15
|
}>;
|
|
16
|
+
licensing?: {
|
|
17
|
+
present: boolean;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
};
|
|
15
20
|
children: ReactNode;
|
|
16
21
|
}): react_jsx_runtime.JSX.Element;
|
|
17
22
|
|
|
@@ -5,13 +5,18 @@ interface PortfolioTab {
|
|
|
5
5
|
key: string;
|
|
6
6
|
label: string;
|
|
7
7
|
href: string;
|
|
8
|
+
hideWhenEmpty?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const PORTFOLIO_TABS: PortfolioTab[];
|
|
10
|
-
declare function PortfolioShell({ tabs, remixOffers, children }: {
|
|
11
|
+
declare function PortfolioShell({ tabs, remixOffers, licensing, children }: {
|
|
11
12
|
tabs?: PortfolioTab[];
|
|
12
13
|
remixOffers?: ReadonlyArray<{
|
|
13
14
|
status: string;
|
|
14
15
|
}>;
|
|
16
|
+
licensing?: {
|
|
17
|
+
present: boolean;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
};
|
|
15
20
|
children: ReactNode;
|
|
16
21
|
}): react_jsx_runtime.JSX.Element;
|
|
17
22
|
|
|
@@ -9,6 +9,7 @@ import { PortfolioHeader } from "./portfolio-header.js";
|
|
|
9
9
|
import { PortfolioChipFilter } from "./portfolio-chip-filter.js";
|
|
10
10
|
import { useMedialaneApp } from "./medialane-app.js";
|
|
11
11
|
import { derivePortfolioCounts } from "../utils/portfolio-counts.js";
|
|
12
|
+
import { visiblePortfolioTabs } from "../utils/portfolio-tabs.js";
|
|
12
13
|
import { markOffersAsSeen } from "../utils/seen-offers.js";
|
|
13
14
|
import { useReceivedOffers, useUserOrders } from "../utils/use-orders.js";
|
|
14
15
|
import { useRewards } from "../utils/use-rewards.js";
|
|
@@ -16,12 +17,12 @@ import { useMySponsorshipDealCounts } from "../utils/use-sponsorship.js";
|
|
|
16
17
|
const PORTFOLIO_TABS = [
|
|
17
18
|
{ key: "assets", label: "Assets", href: "/portfolio/assets" },
|
|
18
19
|
{ key: "collections", label: "Collections", href: "/portfolio/collections" },
|
|
19
|
-
{ key: "listings", label: "Listings", href: "/portfolio/listings" },
|
|
20
|
-
{ key: "received", label: "Offers received", href: "/portfolio/received" },
|
|
21
|
-
{ key: "offers", label: "Offers sent", href: "/portfolio/offers" },
|
|
22
|
-
{ key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers" },
|
|
23
|
-
{ key: "licensing", label: "Licensing", href: "/portfolio/licensing" },
|
|
24
|
-
{ key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships" },
|
|
20
|
+
{ key: "listings", label: "Listings", href: "/portfolio/listings", hideWhenEmpty: true },
|
|
21
|
+
{ key: "received", label: "Offers received", href: "/portfolio/received", hideWhenEmpty: true },
|
|
22
|
+
{ key: "offers", label: "Offers sent", href: "/portfolio/offers", hideWhenEmpty: true },
|
|
23
|
+
{ key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers", hideWhenEmpty: true },
|
|
24
|
+
{ key: "licensing", label: "Licensing", href: "/portfolio/licensing", hideWhenEmpty: true },
|
|
25
|
+
{ key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships", hideWhenEmpty: true },
|
|
25
26
|
{ key: "activity", label: "Activity", href: "/portfolio/activity" }
|
|
26
27
|
];
|
|
27
28
|
function SignedOut() {
|
|
@@ -40,19 +41,28 @@ function Loading() {
|
|
|
40
41
|
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-4 w-72" })
|
|
41
42
|
] });
|
|
42
43
|
}
|
|
43
|
-
function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
|
|
44
|
+
function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, licensing, children }) {
|
|
44
45
|
const { walletAddress: address, walletLoading } = useMedialaneApp();
|
|
45
46
|
const pathname = usePathname();
|
|
46
|
-
const { orders } = useUserOrders(address);
|
|
47
|
-
const { orders: receivedOffers } = useReceivedOffers(address);
|
|
47
|
+
const { orders, isLoading: ordersLoading } = useUserOrders(address);
|
|
48
|
+
const { orders: receivedOffers, isLoading: receivedLoading } = useReceivedOffers(address);
|
|
48
49
|
const { data: rewards } = useRewards(address);
|
|
49
|
-
const
|
|
50
|
+
const sponsorship = useMySponsorshipDealCounts(address);
|
|
50
51
|
useEffect(() => {
|
|
51
52
|
if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));
|
|
52
53
|
}, [receivedOffers]);
|
|
53
54
|
if (!address) return walletLoading ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(SignedOut, {});
|
|
54
|
-
const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });
|
|
55
|
+
const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: sponsorship.pendingCount });
|
|
55
56
|
const countFor = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };
|
|
57
|
+
const present = {
|
|
58
|
+
listings: ordersLoading ? void 0 : counts.listings > 0,
|
|
59
|
+
offers: ordersLoading ? void 0 : counts.offers > 0,
|
|
60
|
+
counter: ordersLoading ? void 0 : counts.counter > 0,
|
|
61
|
+
received: receivedLoading ? void 0 : counts.received > 0,
|
|
62
|
+
licensing: licensing ? licensing.isLoading ? void 0 : licensing.present : true,
|
|
63
|
+
sponsorship: sponsorship.isLoading ? void 0 : sponsorship.hasAny
|
|
64
|
+
};
|
|
65
|
+
const shownTabs = visiblePortfolioTabs(tabs, present, pathname ?? "");
|
|
56
66
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8", children: [
|
|
57
67
|
/* @__PURE__ */ jsx(
|
|
58
68
|
PortfolioHeader,
|
|
@@ -64,7 +74,7 @@ function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
|
|
|
64
74
|
/* @__PURE__ */ jsx(
|
|
65
75
|
PortfolioChipFilter,
|
|
66
76
|
{
|
|
67
|
-
options:
|
|
77
|
+
options: shownTabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label })),
|
|
68
78
|
value: pathname ?? "",
|
|
69
79
|
onChange: () => {
|
|
70
80
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\" },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\" },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\" },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\" },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\" },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\" },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders } = useUserOrders(address);\n const { orders: receivedOffers } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { visiblePortfolioTabs } from \"../utils/portfolio-tabs.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n hideWhenEmpty?: boolean;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\", hideWhenEmpty: true },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\", hideWhenEmpty: true },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\", hideWhenEmpty: true },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\", hideWhenEmpty: true },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\", hideWhenEmpty: true },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\", hideWhenEmpty: true },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, licensing, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n licensing?: { present: boolean; isLoading: boolean };\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders, isLoading: ordersLoading } = useUserOrders(address);\n const { orders: receivedOffers, isLoading: receivedLoading } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const sponsorship = useMySponsorshipDealCounts(address);\n\n useEffect(() => {\n if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));\n }, [receivedOffers]);\n\n if (!address) return walletLoading ? <Loading /> : <SignedOut />;\n\n const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: sponsorship.pendingCount });\n const countFor: Record<string, number> = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };\n const present: Record<string, boolean | undefined> = {\n listings: ordersLoading ? undefined : counts.listings > 0,\n offers: ordersLoading ? undefined : counts.offers > 0,\n counter: ordersLoading ? undefined : counts.counter > 0,\n received: receivedLoading ? undefined : counts.received > 0,\n licensing: licensing ? (licensing.isLoading ? undefined : licensing.present) : true,\n sponsorship: sponsorship.isLoading ? undefined : sponsorship.hasAny,\n };\n const shownTabs = visiblePortfolioTabs(tabs, present, pathname ?? \"\");\n\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8\">\n <PortfolioHeader\n address={address}\n score={rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: \"/rewards\" } : null}\n />\n <PortfolioChipFilter\n options={shownTabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label }))}\n value={pathname ?? \"\"}\n onChange={() => {}}\n showAll={false}\n />\n {children}\n </div>\n );\n}\n"],"mappings":";AAuCI,SACE,KADF;AArCJ,SAAS,iBAAiC;AAC1C,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,4BA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