-
Notifications
You must be signed in to change notification settings - Fork 619
Feature: New Payments Overview Page #7691
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
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
156 changes: 156 additions & 0 deletions
156
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/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,156 @@ | ||
| import { | ||
| ArrowLeftRightIcon, | ||
| ArrowUpRightIcon, | ||
| BadgeDollarSignIcon, | ||
| BellDotIcon, | ||
| CoinsIcon, | ||
| HammerIcon, | ||
| LinkIcon, | ||
| } from "lucide-react"; | ||
| import Link from "next/link"; | ||
| import { redirect } from "next/navigation"; | ||
| import { ResponsiveSearchParamsProvider } from "responsive-rsc"; | ||
| import { getAuthToken } from "@/api/auth-token"; | ||
| import { getProject } from "@/api/projects"; | ||
| import { Button } from "@/components/ui/button"; | ||
| import { Card } from "@/components/ui/card"; | ||
| import { loginRedirect } from "@/utils/redirects"; | ||
|
|
||
| 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}/universal-bridge`, | ||
| ); | ||
| } | ||
|
|
||
| if (!project) { | ||
| redirect(`/team/${params.team_slug}`); | ||
| } | ||
|
|
||
| const searchParams = await props.searchParams; | ||
|
|
||
| return ( | ||
| <ResponsiveSearchParamsProvider value={searchParams}> | ||
| <div> | ||
| <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6"> | ||
| <FeatureCard | ||
| title="Earn Fees" | ||
| description="Setup fees to earn any time a user swaps or bridges funds." | ||
| icon={<BadgeDollarSignIcon className="size-5" />} | ||
| link={{ | ||
| href: `/team/${params.team_slug}/${params.project_slug}/payments/settings`, | ||
| label: "Configure", | ||
| }} | ||
| /> | ||
| <FeatureCard | ||
| title="Create Payment Links" | ||
| description="Create shareable URLs to receive any token in seconds." | ||
| icon={<LinkIcon className="size-5" />} | ||
| link={{ | ||
| href: `/pay`, | ||
| label: "Create", | ||
| }} | ||
| /> | ||
| <FeatureCard | ||
| title="Sell Your Token" | ||
| description="Allow users to swap from any token to your token from your app." | ||
| icon={<ArrowLeftRightIcon className="size-5" />} | ||
| link={{ | ||
| href: `/team/${params.team_slug}/${params.project_slug}/tokens`, | ||
| label: "Launch Token", | ||
| }} | ||
| /> | ||
| <FeatureCard | ||
| title="Get Notified" | ||
| description="Create Webhooks to get notified on each purchase or transaction." | ||
| icon={<BellDotIcon className="size-5" />} | ||
| link={{ | ||
| href: `/team/${params.team_slug}/${params.project_slug}/payments/webhooks`, | ||
| label: "Setup", | ||
| }} | ||
| /> | ||
| <FeatureCard | ||
| title="Sell Products" | ||
| description="Sell physical or digital products with an easy-to-configure component." | ||
| icon={<CoinsIcon className="size-5" />} | ||
| link={{ | ||
| href: "https://portal.thirdweb.com/payments/products", | ||
| label: "Get Started", | ||
| target: "_blank", | ||
| }} | ||
| /> | ||
| <FeatureCard | ||
| title="Customize Your Experience" | ||
| description="Fully customizable backend API to create your own branded flows." | ||
| icon={<HammerIcon className="size-5" />} | ||
| link={{ | ||
| href: "https://payments.thirdweb.com/reference", | ||
| label: "Docs", | ||
| target: "_blank", | ||
| }} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="h-10" /> | ||
| <div className="relative overflow-hidden rounded-lg border-2 border-green-500/20 bg-gradient-to-br from-card/80 to-card/50 p-4 shadow-[inset_0_1px_2px_0_rgba(0,0,0,0.02)]"> | ||
| <div className="absolute inset-0 bg-gradient-to-br from-green-500/5 to-transparent" /> | ||
| <div className="relative flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"> | ||
| <div className="flex flex-col gap-1"> | ||
| <h3 className="font-medium text-lg">Get Started with Payments</h3> | ||
| <p className="text-muted-foreground text-sm"> | ||
| Simple, instant, and secure payments across any token and chain. | ||
| </p> | ||
| </div> | ||
| <a | ||
| className="inline-flex items-center gap-2 rounded-md bg-green-600 px-4 py-2 font-medium text-sm text-white transition-all hover:bg-green-600/90 hover:shadow-sm" | ||
| href="https://portal.thirdweb.com/payments" | ||
| rel="noopener noreferrer" | ||
| target="_blank" | ||
| > | ||
| Learn More | ||
| <ArrowUpRightIcon className="size-4" /> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </ResponsiveSearchParamsProvider> | ||
| ); | ||
| } | ||
|
|
||
| function FeatureCard(props: { | ||
| title: string; | ||
| description: string; | ||
| icon: React.ReactNode; | ||
| link: { href: string; label: string; target?: string }; | ||
| }) { | ||
| return ( | ||
| <Card className="p-4 flex flex-col items-start gap-4"> | ||
| <div className="text-muted-foreground rounded-full border bg-background size-12 flex items-center justify-center"> | ||
| {props.icon} | ||
| </div> | ||
| <div className="flex flex-col gap-0.5"> | ||
| <h3 className="font-semibold">{props.title}</h3> | ||
| <p className="text-muted-foreground text-sm">{props.description}</p> | ||
| </div> | ||
| <Button size="sm" variant="default" className="h-8" asChild> | ||
| <Link href={props.link.href} target={props.link.target}> | ||
| {props.link.label} | ||
| </Link> | ||
| </Button> | ||
| </Card> | ||
| ); | ||
| } | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.