Skip to content

Commit 9c75c35

Browse files
committed
Improved payments onboarding
1 parent e2ecad4 commit 9c75c35

4 files changed

Lines changed: 813 additions & 156 deletions

File tree

apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/layout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ function PaymentsLayoutInner({ children }: { children: React.ReactNode }) {
3333
const paymentsConfig = project.useConfig().payments;
3434
const updateConfig = useUpdateConfig();
3535

36-
// Hide banners on the new product page for a cleaner creation experience
36+
// Hide banners on the new product page and product-lines onboarding for a cleaner experience
3737
const isNewProductPage = pathname.endsWith('/products/new');
38+
const hasAnyProductsOrItems = Object.keys(paymentsConfig.products).length > 0 || Object.keys(paymentsConfig.items).length > 0;
39+
const isProductLinesOnboarding = pathname.endsWith('/product-lines') && !hasAnyProductsOrItems;
3840

3941
const setupPayments = async () => {
4042
const { url } = await stackAdminApp.setupPayments();
@@ -97,8 +99,8 @@ function PaymentsLayoutInner({ children }: { children: React.ReactNode }) {
9799
);
98100
}
99101

100-
// On the new product page, skip all banners for a cleaner experience
101-
if (isNewProductPage) {
102+
// On the new product page and product-lines onboarding, skip all banners for a cleaner experience
103+
if (isNewProductPage || isProductLinesOnboarding) {
102104
return (
103105
<StripeConnectProvider>
104106
{children}

0 commit comments

Comments
 (0)