diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/QuickstartSection.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/QuickstartSection.client.tsx index def36b12060..5b41ddca294 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/QuickstartSection.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/QuickstartSection.client.tsx @@ -60,7 +60,7 @@ export function QuickStartSection(props: { id="webhooks" features={["Instant events", "Transaction verification"]} link={{ - href: `/team/${props.teamSlug}/${props.projectSlug}/webhooks/payments`, + href: `/team/${props.teamSlug}/${props.projectSlug}/bridge/webhooks`, label: "Setup Webhooks", }} /> diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/layout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/layout.tsx index 1a6b877f362..6ff33c85b73 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/layout.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/layout.tsx @@ -1,4 +1,3 @@ -import { WebhookIcon } from "lucide-react"; import { redirect } from "next/navigation"; import { getAuthToken } from "@/api/auth-token"; import { getProject } from "@/api/project/projects"; @@ -43,13 +42,7 @@ export default async function Layout(props: { instantly ), - actions: { - secondary: { - href: `/team/${params.team_slug}/${params.project_slug}/webhooks/payments`, - label: "Webhooks", - icon: , - }, - }, + actions: null, links: [ { type: "docs", @@ -75,6 +68,10 @@ export default async function Layout(props: { name: "Configuration", path: `/team/${params.team_slug}/${params.project_slug}/bridge/configuration`, }, + { + name: "Webhooks", + path: `/team/${params.team_slug}/${params.project_slug}/bridge/webhooks`, + }, ]} > {props.children} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/WebhookSendsUI.stories.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/WebhookSendsUI.stories.tsx similarity index 100% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/WebhookSendsUI.stories.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/WebhookSendsUI.stories.tsx diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/page.tsx similarity index 98% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/page.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/page.tsx index a0f1bee8fba..0835ae25d0f 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/page.tsx @@ -46,7 +46,7 @@ export default async function Page(props: { Webhooks diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/webhook-sends.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/webhook-sends.tsx similarity index 100% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/webhook-sends.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/webhook-sends.tsx diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/components/webhooks.client.tsx similarity index 97% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/components/webhooks.client.tsx index d6d7a719de5..8d9a15ea2e8 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/components/webhooks.client.tsx @@ -12,6 +12,7 @@ import { PlusIcon, TrashIcon, WebhookIcon, + XIcon, } from "lucide-react"; import Link from "next/link"; import { type PropsWithChildren, useMemo, useState } from "react"; @@ -95,9 +96,14 @@ export function PayWebhooksPage(props: PayWebhooksPageProps) { if (!webhooksQuery.data?.length) { return (
-
-

No webhooks configured

-

+

+
+ +
+

+ No webhooks configured +

+

Create a webhook to receive notifications for bridge, swap or onramp events.

@@ -126,7 +132,7 @@ export function PayWebhooksPage(props: PayWebhooksPageProps) { webhook={webhook} clientId={props.clientId} teamId={props.teamId} - layoutPath={`/team/${props.teamSlug}/${props.projectSlug}/webhooks/payments`} + layoutPath={`/team/${props.teamSlug}/${props.projectSlug}/bridge/webhooks`} /> ))}
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/page.tsx similarity index 89% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/page.tsx index b0ecd211974..0851c2a0e3f 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/page.tsx @@ -1,7 +1,7 @@ import { notFound } from "next/navigation"; import { getAuthToken } from "@/api/auth-token"; import { getProject } from "@/api/project/projects"; -import { PayWebhooksPage } from "../../payments/webhooks/components/webhooks.client"; +import { PayWebhooksPage } from "./components/webhooks.client"; export default async function Page(props: { params: Promise<{ diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx index 520d4b83e80..e0eefd78b12 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx @@ -6,7 +6,6 @@ import { DoorOpenIcon, HomeIcon, Settings2Icon, - WebhookIcon, } from "lucide-react"; import { FullWidthSidebarLayout, @@ -136,14 +135,6 @@ export function ProjectSidebarLayout(props: { { separator: true, }, - { - href: `${props.layoutPath}/webhooks/contracts`, - icon: WebhookIcon, - isActive: (pathname) => { - return pathname.startsWith(`${props.layoutPath}/webhooks`); - }, - label: "Webhooks", - }, { href: `${props.layoutPath}/settings`, icon: Settings2Icon, diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/AdvancedSection.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/AdvancedSection.client.tsx index bb49a35f4fb..e6067b8ea9f 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/AdvancedSection.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/AdvancedSection.client.tsx @@ -39,7 +39,7 @@ export function AdvancedSection({ id="webhooks" features={["Instant events", "Transaction verification"]} link={{ - href: `/team/${teamSlug}/${projectSlug}/webhooks/payments`, + href: `/team/${teamSlug}/${projectSlug}/bridge/webhooks`, label: "Setup Webhooks", }} /> diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx index 0fb87e68d04..36403f27fbe 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx @@ -66,7 +66,7 @@ export default async function Page(props: { ), }, secondary: { - href: `/team/${params.team_slug}/${params.project_slug}/webhooks/payments`, + href: `/team/${params.team_slug}/${params.project_slug}/bridge/webhooks`, label: "Webhooks", icon: , }, diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/layout.tsx similarity index 66% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/page.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/layout.tsx index 8c544180824..67591300e21 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/layout.tsx @@ -1,16 +1,10 @@ import { Button } from "@workspace/ui/components/button"; import { PlusIcon } from "lucide-react"; import { redirect } from "next/navigation"; -import { Suspense } from "react"; -import type { ThirdwebClient } from "thirdweb"; import { getAuthToken } from "@/api/auth-token"; -import { getFilteredProjectContracts } from "@/api/project/getSortedDeployedContracts"; import { getProject } from "@/api/project/projects"; import { getTeamBySlug } from "@/api/team/get-team"; -import { ClientOnly } from "@/components/blocks/client-only"; import { ProjectPage } from "@/components/blocks/project-page/project-page"; -import { GenericLoadingPage } from "@/components/blocks/skeletons/GenericLoadingPage"; -import { ContractTable } from "@/components/contract-components/tables/contract-table"; import { Dialog, DialogContent, @@ -21,10 +15,11 @@ import { import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; import { TokenIcon } from "@/icons/TokenIcon"; import { loginRedirect } from "@/utils/redirects"; -import { Cards, ImportTokenButton } from "./cards"; +import { Cards, ImportTokenButton } from "../cards"; -export default async function Page(props: { +export default async function Layout(props: { params: Promise<{ team_slug: string; project_slug: string }>; + children: React.ReactNode; }) { const params = await props.params; @@ -110,48 +105,19 @@ export default async function Page(props: { }, ], }} + tabs={[ + { + name: "Overview", + path: `/team/${params.team_slug}/${params.project_slug}/tokens`, + exactMatch: true, + }, + { + name: "Webhooks", + path: `/team/${params.team_slug}/${params.project_slug}/tokens/webhooks`, + }, + ]} > - }> - - + {props.children} ); } - -async function AssetsPageAsync(props: { - teamId: string; - projectId: string; - authToken: string; - client: ThirdwebClient; - teamSlug: string; - projectSlug: string; -}) { - const deployedContracts = await getFilteredProjectContracts({ - authToken: props.authToken, - type: "token-contracts", - projectId: props.projectId, - teamId: props.teamId, - }); - - return ( - }> - - - ); -} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/page.tsx new file mode 100644 index 00000000000..00b816be548 --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/page.tsx @@ -0,0 +1,84 @@ +import { redirect } from "next/navigation"; +import { Suspense } from "react"; +import type { ThirdwebClient } from "thirdweb"; +import { getAuthToken } from "@/api/auth-token"; +import { getFilteredProjectContracts } from "@/api/project/getSortedDeployedContracts"; +import { getProject } from "@/api/project/projects"; +import { getTeamBySlug } from "@/api/team/get-team"; +import { ClientOnly } from "@/components/blocks/client-only"; +import { GenericLoadingPage } from "@/components/blocks/skeletons/GenericLoadingPage"; +import { ContractTable } from "@/components/contract-components/tables/contract-table"; +import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; +import { loginRedirect } from "@/utils/redirects"; + +export default async function Page(props: { + params: Promise<{ team_slug: string; project_slug: string }>; +}) { + const params = await props.params; + + const [authToken, team, project] = await Promise.all([ + getAuthToken(), + getTeamBySlug(params.team_slug), + getProject(params.team_slug, params.project_slug), + ]); + if (!authToken) { + loginRedirect(`/team/${params.team_slug}/${params.project_slug}/tokens`); + } + + if (!team) { + redirect("/team"); + } + + if (!project) { + redirect(`/team/${params.team_slug}`); + } + + const client = getClientThirdwebClient({ + jwt: authToken, + teamId: team.id, + }); + + return ( + }> + + + ); +} + +async function AssetsPageAsync(props: { + teamId: string; + projectId: string; + authToken: string; + client: ThirdwebClient; + teamSlug: string; + projectSlug: string; +}) { + const deployedContracts = await getFilteredProjectContracts({ + authToken: props.authToken, + type: "token-contracts", + projectId: props.projectId, + teamId: props.teamId, + }); + + return ( + }> + + + ); +} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/BasicInfoStep.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/BasicInfoStep.tsx similarity index 99% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/BasicInfoStep.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/BasicInfoStep.tsx index 872c8802c68..6597796b082 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/BasicInfoStep.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/BasicInfoStep.tsx @@ -13,7 +13,7 @@ import { import { Input } from "@/components/ui/input"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { cn } from "@/lib/utils"; -import type { WebhookFormValues } from "../utils/webhookTypes"; +import type { WebhookFormValues } from "./utils/webhookTypes"; interface BasicInfoStepProps { form: UseFormReturn; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/CreateWebhookModal.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/CreateWebhookModal.tsx similarity index 96% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/CreateWebhookModal.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/CreateWebhookModal.tsx index 4493537a97d..5c057f05f2d 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/CreateWebhookModal.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/CreateWebhookModal.tsx @@ -16,26 +16,26 @@ import { } from "@/components/ui/dialog"; import { Form } from "@/components/ui/form"; import { useDashboardRouter } from "@/lib/DashboardRouter"; -import { useAbiMultiFetch } from "../hooks/useAbiProcessing"; -import { useTestWebhook } from "../hooks/useTestWebhook"; +import BasicInfoStep from "./BasicInfoStep"; +import { FilterDetailsStep } from "./FilterDetailsStep"; +import ReviewStep from "./ReviewStep"; +import { useAbiMultiFetch } from "./useAbiProcessing"; +import { useTestWebhook } from "./useTestWebhook"; import { extractEventSignatures, extractFunctionSignatures, -} from "../utils/abiUtils"; -import type { WebhookPayload } from "../utils/webhookPayloadUtils"; +} from "./utils/abiUtils"; +import type { WebhookPayload } from "./utils/webhookPayloadUtils"; import { buildEventWebhookPayload, buildTransactionWebhookPayload, -} from "../utils/webhookPayloadUtils"; +} from "./utils/webhookPayloadUtils"; import { type WebhookFormStep, WebhookFormSteps, type WebhookFormValues, webhookFormSchema, -} from "../utils/webhookTypes"; -import BasicInfoStep from "./BasicInfoStep"; -import { FilterDetailsStep } from "./FilterDetailsStep"; -import ReviewStep from "./ReviewStep"; +} from "./utils/webhookTypes"; interface CreateWebhookModalProps { projectClientId: string; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/FilterDetailsStep.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/FilterDetailsStep.tsx similarity index 99% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/FilterDetailsStep.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/FilterDetailsStep.tsx index 739771bd852..ed3e42b9871 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/FilterDetailsStep.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/FilterDetailsStep.tsx @@ -17,13 +17,13 @@ import { import { Input } from "@/components/ui/input"; import { Spinner } from "@/components/ui/Spinner"; import { Textarea } from "@/components/ui/textarea"; -import { truncateMiddle } from "../utils/abiUtils"; +import { truncateMiddle } from "./utils/abiUtils"; import type { AbiData, EventSignature, FunctionSignature, WebhookFormValues, -} from "../utils/webhookTypes"; +} from "./utils/webhookTypes"; interface FilterDetailsStepProps { form: UseFormReturn; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/RelativeTime.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/RelativeTime.tsx similarity index 100% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/RelativeTime.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/RelativeTime.tsx diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/ReviewStep.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/ReviewStep.tsx similarity index 98% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/ReviewStep.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/ReviewStep.tsx index f8a0240f9dc..3d49cefc382 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/ReviewStep.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/ReviewStep.tsx @@ -3,8 +3,8 @@ import { CheckIcon, PlayIcon, XIcon } from "lucide-react"; import type { UseFormReturn } from "react-hook-form"; import { Button } from "@/components/ui/button"; import { Spinner } from "@/components/ui/Spinner"; -import { truncateMiddle } from "../utils/abiUtils"; -import type { WebhookFormValues } from "../utils/webhookTypes"; +import { truncateMiddle } from "./utils/abiUtils"; +import type { WebhookFormValues } from "./utils/webhookTypes"; interface WebhookTestResult { status: string; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/WebhooksTable.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/WebhooksTable.tsx similarity index 99% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/WebhooksTable.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/WebhooksTable.tsx index 6031591c363..397531ec4d8 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/WebhooksTable.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/WebhooksTable.tsx @@ -17,9 +17,9 @@ import { Button } from "@/components/ui/button"; import { CopyTextButton } from "@/components/ui/CopyTextButton"; import { Spinner } from "@/components/ui/Spinner"; import { useDashboardRouter } from "@/lib/DashboardRouter"; -import { useTestWebhook } from "../hooks/useTestWebhook"; import { CreateContractWebhookButton } from "./CreateWebhookModal"; import { RelativeTime } from "./RelativeTime"; +import { useTestWebhook } from "./useTestWebhook"; function getEventType(filters: WebhookFilters): string { if (!filters || typeof filters !== "object") { diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/contract-webhooks/contract-webhooks-page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/contract-webhooks-page.tsx similarity index 77% rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/contract-webhooks/contract-webhooks-page.tsx rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/contract-webhooks-page.tsx index 9f9bdd48ad8..ff098e4146c 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/contract-webhooks/contract-webhooks-page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/webhooks/components/contract-webhooks-page.tsx @@ -1,8 +1,9 @@ +import { XIcon } from "lucide-react"; import { getWebhooks, type WebhookResponse } from "@/api/insight/webhooks"; import type { Project } from "@/api/project/projects"; import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; -import { CreateContractWebhookButton } from "../components/CreateWebhookModal"; -import { ContractsWebhooksTable } from "../components/WebhooksTable"; +import { CreateContractWebhookButton } from "./CreateWebhookModal"; +import { ContractsWebhooksTable } from "./WebhooksTable"; export async function ContractsWebhooksPageContent(props: { project: Project; @@ -50,11 +51,14 @@ export async function ContractsWebhooksPageContent(props: { webhooks={webhooks} /> ) : ( -
+
-

No webhooks found

-

- Create a webhook to get started. +

+ +
+

No webhooks found

+

+ Create a webhook to get started

; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/layout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/layout.tsx deleted file mode 100644 index 55667d0c90c..00000000000 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/layout.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { WebhookIcon } from "lucide-react"; -import { notFound } from "next/navigation"; -import { getAuthToken } from "@/api/auth-token"; -import { getProject } from "@/api/project/projects"; -import { ProjectPage } from "@/components/blocks/project-page/project-page"; -import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; - -export default async function Layout(props: { - params: Promise<{ - team_slug: string; - project_slug: string; - }>; - children: React.ReactNode; -}) { - const [authToken, params] = await Promise.all([getAuthToken(), props.params]); - - const project = await getProject(params.team_slug, params.project_slug); - - if (!project || !authToken) { - notFound(); - } - - const client = getClientThirdwebClient({ - jwt: authToken, - teamId: project.teamId, - }); - - return ( - - {props.children} - - ); -} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/page.tsx deleted file mode 100644 index 7e27f5cdeb9..00000000000 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/page.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { redirect } from "next/navigation"; - -export default async function WebhooksPage(props: { - params: Promise<{ team_slug: string; project_slug: string }>; -}) { - const params = await props.params; - - // for the moment redirect to the "/contracts webhooks" - redirect( - `/team/${params.team_slug}/${params.project_slug}/webhooks/contracts`, - ); -}