From 4de5adb874ed44aa686c83076f4f55df0a12a0e8 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Fri, 12 Sep 2025 14:49:10 -0700 Subject: [PATCH] Move /payments to /payments/offers-and-items --- .../create-group-dialog.tsx | 2 +- .../{ => offers-and-items}/dummy-data.tsx | 0 .../included-item-dialog.tsx | 0 .../{ => offers-and-items}/item-dialog.tsx | 0 .../payments/{ => offers-and-items}/layout.tsx | 2 +- .../{ => offers-and-items}/list-section.tsx | 0 .../{ => offers-and-items}/offer-dialog.tsx | 0 .../{ => offers-and-items}/page-client.tsx | 6 +++--- .../payments/offers-and-items/page.tsx | 15 +++++++++++++++ .../{ => offers-and-items}/price-dialog.tsx | 0 .../projects/[projectId]/payments/page.tsx | 16 +++------------- .../projects/[projectId]/sidebar-layout.tsx | 10 +++++----- 12 files changed, 28 insertions(+), 23 deletions(-) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/create-group-dialog.tsx (97%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/dummy-data.tsx (100%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/included-item-dialog.tsx (100%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/item-dialog.tsx (100%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/layout.tsx (99%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/list-section.tsx (100%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/offer-dialog.tsx (100%) rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/page-client.tsx (99%) create mode 100644 apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page.tsx rename apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/{ => offers-and-items}/price-dialog.tsx (100%) diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/create-group-dialog.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/create-group-dialog.tsx similarity index 97% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/create-group-dialog.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/create-group-dialog.tsx index 2e517a017..2d6ebf9fb 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/create-group-dialog.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/create-group-dialog.tsx @@ -1,6 +1,6 @@ "use client"; -import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, Typography, SimpleTooltip } from "@stackframe/stack-ui"; +import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, SimpleTooltip, Typography } from "@stackframe/stack-ui"; import { useState } from "react"; type CreateGroupDialogProps = { diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/dummy-data.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/dummy-data.tsx similarity index 100% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/dummy-data.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/dummy-data.tsx diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/included-item-dialog.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/included-item-dialog.tsx similarity index 100% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/included-item-dialog.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/included-item-dialog.tsx diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/item-dialog.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/item-dialog.tsx similarity index 100% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/item-dialog.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/item-dialog.tsx diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/layout.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/layout.tsx similarity index 99% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/layout.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/layout.tsx index 1a0a889d7..24a773f6d 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/layout.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/layout.tsx @@ -11,7 +11,7 @@ import { ConnectNotificationBanner } from "@stripe/react-connect-js"; import { ArrowRight, BarChart3, Repeat, Shield, Wallet, Webhook } from "lucide-react"; import { useState } from "react"; import * as yup from "yup"; -import { useAdminApp } from "../use-admin-app"; +import { useAdminApp } from "../../use-admin-app"; export default function PaymentsLayout({ children }: { children: React.ReactNode }) { const [bannerHasItems, setBannerHasItems] = useState(false); diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/list-section.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/list-section.tsx similarity index 100% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/list-section.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/list-section.tsx diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offer-dialog.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/offer-dialog.tsx similarity index 100% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offer-dialog.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/offer-dialog.tsx diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page-client.tsx similarity index 99% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page-client.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page-client.tsx index 20949e6f9..df0028989 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page-client.tsx @@ -9,9 +9,9 @@ import { stringCompare } from "@stackframe/stack-shared/dist/utils/strings"; import { Button, Card, CardContent, Checkbox, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, toast } from "@stackframe/stack-ui"; import { MoreVertical, Plus } from "lucide-react"; import React, { ReactNode, useEffect, useMemo, useRef, useState } from "react"; -import { IllustratedInfo } from "../../../../../../components/illustrated-info"; -import { PageLayout } from "../page-layout"; -import { useAdminApp } from "../use-admin-app"; +import { IllustratedInfo } from "../../../../../../../components/illustrated-info"; +import { PageLayout } from "../../page-layout"; +import { useAdminApp } from "../../use-admin-app"; import { DUMMY_PAYMENTS_CONFIG } from "./dummy-data"; import { ItemDialog } from "./item-dialog"; import { ListSection } from "./list-section"; diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page.tsx new file mode 100644 index 000000000..27ccbd4f8 --- /dev/null +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/page.tsx @@ -0,0 +1,15 @@ +import PageClient from "./page-client"; + +export const metadata = { + title: "Payments", +}; + +type Params = { + projectId: string, +}; + +export default async function Page({ params }: { params: Promise }) { + return ( + + ); +} diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/price-dialog.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/price-dialog.tsx similarity index 100% rename from apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/price-dialog.tsx rename to apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers-and-items/price-dialog.tsx diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page.tsx index 27ccbd4f8..7fb320401 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/page.tsx @@ -1,15 +1,5 @@ -import PageClient from "./page-client"; +import { redirect } from "next/navigation"; -export const metadata = { - title: "Payments", -}; - -type Params = { - projectId: string, -}; - -export default async function Page({ params }: { params: Promise }) { - return ( - - ); +export default function Page() { + redirect("./payments/offers-and-items"); } diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/sidebar-layout.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/sidebar-layout.tsx index 6c2c90a62..56a856447 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/sidebar-layout.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/sidebar-layout.tsx @@ -24,6 +24,7 @@ import { } from "@stackframe/stack-ui"; import { Book, + CreditCard, FilePen, Globe, KeyRound, @@ -240,18 +241,17 @@ const navigationItems: (Label | Item | Hidden)[] = [ regex: /^\/projects\/[^\/]+\/email-themes\/[^\/]+$/, type: 'hidden', }, - /* { name: "Payments", type: 'label', }, { - name: "Payments", - href: "/payments", - regex: /^\/projects\/[^\/]+\/payments$/, + name: "Offers & Items", + href: "/payments/offers-and-items", + regex: /^\/projects\/[^\/]+\/payments\/offers-and-items$/, icon: CreditCard, type: 'item', - },*/ + }, { name: "Configuration", type: 'label'