Skip to content

Commit f3525c7

Browse files
committed
[PRO-123] Dashboard: Move project webhooks (#8500)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR primarily focuses on refactoring and reorganizing the `webhooks` feature within the application, including changes to routing and component structure, as well as the introduction of a `bridge` section for webhooks. ### Detailed summary - Deleted multiple files related to `webhooks` under the previous structure. - Updated routing paths from `/webhooks/payments` to `/bridge/webhooks`. - Refactored components to align with the new `bridge` structure. - Adjusted imports to reflect new file locations. - Removed unused `WebhookIcon` and streamlined sidebar links. - Introduced new layout and page components under `tokens/(general)/webhooks`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Navigation & Organization** - Webhooks functionality relocated to the Bridge section for improved contextual organization - Updated navigation paths and sidebar structure accordingly * **UI Improvements** - Redesigned empty state for webhooks with enhanced visual styling and icon display <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent e516b4d commit f3525c7

File tree

27 files changed

+147
-168
lines changed

27 files changed

+147
-168
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/QuickstartSection.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function QuickStartSection(props: {
6060
id="webhooks"
6161
features={["Instant events", "Transaction verification"]}
6262
link={{
63-
href: `/team/${props.teamSlug}/${props.projectSlug}/webhooks/payments`,
63+
href: `/team/${props.teamSlug}/${props.projectSlug}/bridge/webhooks`,
6464
label: "Setup Webhooks",
6565
}}
6666
/>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/layout.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { WebhookIcon } from "lucide-react";
21
import { redirect } from "next/navigation";
32
import { getAuthToken } from "@/api/auth-token";
43
import { getProject } from "@/api/project/projects";
@@ -43,13 +42,7 @@ export default async function Layout(props: {
4342
instantly
4443
</>
4544
),
46-
actions: {
47-
secondary: {
48-
href: `/team/${params.team_slug}/${params.project_slug}/webhooks/payments`,
49-
label: "Webhooks",
50-
icon: <WebhookIcon className="size-3.5 text-muted-foreground" />,
51-
},
52-
},
45+
actions: null,
5346
links: [
5447
{
5548
type: "docs",
@@ -75,6 +68,10 @@ export default async function Layout(props: {
7568
name: "Configuration",
7669
path: `/team/${params.team_slug}/${params.project_slug}/bridge/configuration`,
7770
},
71+
{
72+
name: "Webhooks",
73+
path: `/team/${params.team_slug}/${params.project_slug}/bridge/webhooks`,
74+
},
7875
]}
7976
>
8077
{props.children}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/WebhookSendsUI.stories.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/WebhookSendsUI.stories.tsx

File renamed without changes.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/page.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default async function Page(props: {
4646
<BreadcrumbItem>
4747
<BreadcrumbLink asChild>
4848
<Link
49-
href={`/team/${params.team_slug}/${params.project_slug}/webhooks/payments`}
49+
href={`/team/${params.team_slug}/${params.project_slug}/bridge/webhooks`}
5050
>
5151
Webhooks
5252
</Link>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/[id]/webhook-sends.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/[id]/webhook-sends.tsx

File renamed without changes.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/components/webhooks.client.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
PlusIcon,
1313
TrashIcon,
1414
WebhookIcon,
15+
XIcon,
1516
} from "lucide-react";
1617
import Link from "next/link";
1718
import { type PropsWithChildren, useMemo, useState } from "react";
@@ -95,9 +96,14 @@ export function PayWebhooksPage(props: PayWebhooksPageProps) {
9596
if (!webhooksQuery.data?.length) {
9697
return (
9798
<div className="flex flex-col items-center gap-6 rounded-lg border border-border bg-card p-8 text-center">
98-
<div className="flex flex-col gap-2">
99-
<h2 className="font-semibold text-xl">No webhooks configured</h2>
100-
<p className="text-sm text-muted-foreground">
99+
<div className="flex flex-col items-center">
100+
<div className="rounded-full p-2 border bg-background inline-flex mb-3">
101+
<XIcon className="size-4 text-muted-foreground" />
102+
</div>
103+
<h2 className="font-semibold text-base mb-1">
104+
No webhooks configured
105+
</h2>
106+
<p className="text-muted-foreground text-sm">
101107
Create a webhook to receive notifications for bridge, swap or onramp
102108
events.
103109
</p>
@@ -126,7 +132,7 @@ export function PayWebhooksPage(props: PayWebhooksPageProps) {
126132
webhook={webhook}
127133
clientId={props.clientId}
128134
teamId={props.teamId}
129-
layoutPath={`/team/${props.teamSlug}/${props.projectSlug}/webhooks/payments`}
135+
layoutPath={`/team/${props.teamSlug}/${props.projectSlug}/bridge/webhooks`}
130136
/>
131137
))}
132138
</div>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/webhooks/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { notFound } from "next/navigation";
22
import { getAuthToken } from "@/api/auth-token";
33
import { getProject } from "@/api/project/projects";
4-
import { PayWebhooksPage } from "../../payments/webhooks/components/webhooks.client";
4+
import { PayWebhooksPage } from "./components/webhooks.client";
55

66
export default async function Page(props: {
77
params: Promise<{

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
DoorOpenIcon,
77
HomeIcon,
88
Settings2Icon,
9-
WebhookIcon,
109
} from "lucide-react";
1110
import {
1211
FullWidthSidebarLayout,
@@ -136,14 +135,6 @@ export function ProjectSidebarLayout(props: {
136135
{
137136
separator: true,
138137
},
139-
{
140-
href: `${props.layoutPath}/webhooks/contracts`,
141-
icon: WebhookIcon,
142-
isActive: (pathname) => {
143-
return pathname.startsWith(`${props.layoutPath}/webhooks`);
144-
},
145-
label: "Webhooks",
146-
},
147138
{
148139
href: `${props.layoutPath}/settings`,
149140
icon: Settings2Icon,

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/AdvancedSection.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function AdvancedSection({
3939
id="webhooks"
4040
features={["Instant events", "Transaction verification"]}
4141
link={{
42-
href: `/team/${teamSlug}/${projectSlug}/webhooks/payments`,
42+
href: `/team/${teamSlug}/${projectSlug}/bridge/webhooks`,
4343
label: "Setup Webhooks",
4444
}}
4545
/>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default async function Page(props: {
6666
),
6767
},
6868
secondary: {
69-
href: `/team/${params.team_slug}/${params.project_slug}/webhooks/payments`,
69+
href: `/team/${params.team_slug}/${params.project_slug}/bridge/webhooks`,
7070
label: "Webhooks",
7171
icon: <WebhookIcon className="size-3.5 text-muted-foreground" />,
7272
},

0 commit comments

Comments
 (0)