-
Notifications
You must be signed in to change notification settings - Fork 618
[MNY-139] Dashboard, Portal, Playground: Add Bridge Product #7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
graphite-app
merged 1 commit into
main
from
09-04-dashboard_portal_playground_add_bridge_product
Sep 5, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { BringToFrontIcon as BridgeIcon } from "lucide-react"; |
71 changes: 71 additions & 0 deletions
71
...c/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/QuickstartSection.client.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| "use client"; | ||
|
|
||
| import { | ||
| ArrowRightLeftIcon, | ||
| BadgeDollarSignIcon, | ||
| WebhookIcon, | ||
| } from "lucide-react"; | ||
| import { FeatureCard } from "../payments/components/FeatureCard.client"; | ||
|
|
||
| export function QuickStartSection(props: { | ||
| teamSlug: string; | ||
| projectSlug: string; | ||
| clientId: string; | ||
| teamId: string; | ||
| }) { | ||
| return ( | ||
| <section> | ||
| <div className="mb-4"> | ||
| <h2 className="font-semibold text-xl tracking-tight">Get Started</h2> | ||
| <p className="text-muted-foreground text-sm"> | ||
| Integrate bridge into your project and enable seamless cross-chain | ||
| swaps | ||
| </p> | ||
| </div> | ||
| <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6"> | ||
| <FeatureCard | ||
| title="Cross-chain Swap Tokens" | ||
| icon={ArrowRightLeftIcon} | ||
| setupTime={5} | ||
| id="swap_tokens" | ||
| features={["Swap any token", "Cross-chain swaps"]} | ||
| description="Swap tokens cross-chain with dedicated swapping endpoints." | ||
| link={{ | ||
| href: `https://portal.thirdweb.com/payments/swap`, | ||
| label: "Setup Swaps", | ||
| }} | ||
| /> | ||
|
|
||
| <FeatureCard | ||
| title="Earn Fees" | ||
| description="Setup fees to earn any time a user swaps or bridges funds." | ||
| icon={BadgeDollarSignIcon} | ||
| id="fees" | ||
| setupTime={1} | ||
| features={[ | ||
| "Fees on every purchase", | ||
| "Custom percentage", | ||
| "Directly to your wallet", | ||
| ]} | ||
| link={{ | ||
| href: `/team/${props.teamSlug}/${props.projectSlug}/settings/payments`, | ||
| label: "Configure Fees", | ||
| }} | ||
| /> | ||
|
|
||
| <FeatureCard | ||
| title="Webhooks" | ||
| description="Create Webhooks to get notified on each purchase or transaction." | ||
| icon={WebhookIcon} | ||
| setupTime={5} | ||
| id="webhooks" | ||
| features={["Instant events", "Transaction verification"]} | ||
| link={{ | ||
| href: `/team/${props.teamSlug}/${props.projectSlug}/webhooks/payments`, | ||
| label: "Setup Webhooks", | ||
| }} | ||
| /> | ||
| </div> | ||
| </section> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
161 changes: 161 additions & 0 deletions
161
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/bridge/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| import { WebhookIcon } from "lucide-react"; | ||
| import { redirect } from "next/navigation"; | ||
| import { ResponsiveSearchParamsProvider } from "responsive-rsc"; | ||
| 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"; | ||
| import { BridgeIcon } from "@/icons/BridgeIcon"; | ||
| import { loginRedirect } from "@/utils/redirects"; | ||
| import { PayAnalytics } from "../payments/components/PayAnalytics"; | ||
| import { getUniversalBridgeFiltersFromSearchParams } from "../payments/components/time"; | ||
| import { QuickStartSection } from "./QuickstartSection.client"; | ||
| import { RouteDiscovery } from "./RouteDiscovery"; | ||
|
|
||
| export default async function Page(props: { | ||
| params: Promise<{ | ||
| team_slug: string; | ||
| project_slug: string; | ||
| }>; | ||
| searchParams: Promise<{ | ||
| from?: string | undefined | string[]; | ||
| to?: string | undefined | string[]; | ||
| interval?: string | undefined | string[]; | ||
| }>; | ||
| }) { | ||
| const [params, authToken] = await Promise.all([props.params, getAuthToken()]); | ||
|
|
||
| const project = await getProject(params.team_slug, params.project_slug); | ||
|
|
||
| if (!authToken) { | ||
| loginRedirect(`/team/${params.team_slug}/${params.project_slug}/bridge`); | ||
| } | ||
|
|
||
| if (!project) { | ||
| redirect(`/team/${params.team_slug}`); | ||
| } | ||
|
|
||
| const searchParams = await props.searchParams; | ||
|
|
||
| const { range, interval } = getUniversalBridgeFiltersFromSearchParams({ | ||
| defaultRange: "last-30", | ||
| from: searchParams.from, | ||
| interval: searchParams.interval, | ||
| to: searchParams.to, | ||
| }); | ||
|
|
||
| const client = getClientThirdwebClient({ | ||
| jwt: authToken, | ||
| teamId: project.teamId, | ||
| }); | ||
|
|
||
| return ( | ||
| <ProjectPage | ||
| header={{ | ||
| client, | ||
| title: "Bridge", | ||
| icon: BridgeIcon, | ||
| description: ( | ||
| <> | ||
| Bridge lets developers swap and transfer any token across any chain | ||
| instantly | ||
| </> | ||
| ), | ||
| actions: { | ||
| secondary: { | ||
| href: `/team/${params.team_slug}/${params.project_slug}/webhooks/payments`, | ||
| label: "Webhooks", | ||
| icon: <WebhookIcon className="size-3.5 text-muted-foreground" />, | ||
| }, | ||
| }, | ||
| links: [ | ||
| // TODO - add docs when bridge docs are added in portal | ||
| // { | ||
| // type: "docs", | ||
| // href: "https://portal.thirdweb.com/payments", | ||
| // }, | ||
| { | ||
| type: "api", | ||
| href: "https://api.thirdweb.com/reference#tag/bridge", | ||
| }, | ||
| ], | ||
| }} | ||
| footer={{ | ||
| center: { | ||
| links: [ | ||
| { | ||
| href: "https://playground.thirdweb.com/payments/ui-components", | ||
| label: "UI Component", | ||
| }, | ||
| { | ||
| href: "https://playground.thirdweb.com/connect/payments/fund-wallet", | ||
| label: "Buy Crypto", | ||
| }, | ||
| { | ||
| href: "https://playground.thirdweb.com/connect/payments/commerce", | ||
| label: "Checkout", | ||
| }, | ||
| { | ||
| href: "https://playground.thirdweb.com/connect/payments/transactions", | ||
| label: "Transactions", | ||
| }, | ||
| ], | ||
| title: "Demos", | ||
| }, | ||
| left: { | ||
| links: [ | ||
| { | ||
| href: "https://portal.thirdweb.com/payments", | ||
| label: "Overview", | ||
| }, | ||
| { | ||
| href: "https://portal.thirdweb.com/typescript/v5/convertCryptoToFiat", | ||
| label: "TypeScript", | ||
| }, | ||
| { | ||
| href: "https://portal.thirdweb.com/react/v5/pay/fund-wallets", | ||
| label: "React", | ||
| }, | ||
| { | ||
| href: "https://portal.thirdweb.com/dotnet/universal-bridge/quickstart", | ||
| label: ".NET", | ||
| }, | ||
| ], | ||
| title: "Documentation", | ||
| }, | ||
| right: { | ||
| links: [ | ||
| { | ||
| href: "https://www.youtube.com/watch?v=aBu175-VsNY", | ||
| label: "Implement cross-chain payments in any app", | ||
| }, | ||
| ], | ||
| title: "Tutorials", | ||
| }, | ||
| }} | ||
| > | ||
| <div className="flex flex-col gap-12"> | ||
| <ResponsiveSearchParamsProvider value={searchParams}> | ||
| <PayAnalytics | ||
| client={client} | ||
| interval={interval} | ||
| projectClientId={project.publishableKey} | ||
| projectId={project.id} | ||
| range={range} | ||
| teamId={project.teamId} | ||
| authToken={authToken} | ||
| /> | ||
| </ResponsiveSearchParamsProvider> | ||
|
|
||
| <RouteDiscovery client={client} project={project} /> | ||
|
|
||
| <QuickStartSection | ||
| projectSlug={params.project_slug} | ||
| teamSlug={params.team_slug} | ||
| clientId={project.publishableKey} | ||
| teamId={project.teamId} | ||
| /> | ||
| </div> | ||
| </ProjectPage> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.