-
Notifications
You must be signed in to change notification settings - Fork 620
[Dashboard] New Project > Wallets product grouping and subsections #8359
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 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
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
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
164 changes: 6 additions & 158 deletions
164
...oard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/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 |
|---|---|---|
| @@ -1,163 +1,11 @@ | ||
| import type { Metadata } from "next"; | ||
| import { notFound, redirect } from "next/navigation"; | ||
| import type { SearchParams } from "nuqs/server"; | ||
| import { getUserOpUsage } from "@/api/analytics"; | ||
| import { getAuthToken } from "@/api/auth-token"; | ||
| import { getProject } from "@/api/project/projects"; | ||
| import { getTeamBySlug } from "@/api/team/get-team"; | ||
| import { | ||
| getLastNDaysRange, | ||
| type Range, | ||
| } from "@/components/analytics/date-range-selector"; | ||
| import { ProjectPage } from "@/components/blocks/project-page/project-page"; | ||
| import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; | ||
| import { SmartAccountIcon } from "@/icons/SmartAccountIcon"; | ||
| import { getAbsoluteUrl } from "@/utils/vercel"; | ||
| import { AccountAbstractionSummary } from "./AccountAbstractionAnalytics/AccountAbstractionSummary"; | ||
| import { SmartWalletsBillingAlert } from "./Alerts"; | ||
| import { AccountAbstractionAnalytics } from "./aa-analytics"; | ||
| import { searchParamLoader } from "./search-params"; | ||
|
|
||
| interface PageParams { | ||
| team_slug: string; | ||
| project_slug: string; | ||
| } | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| // Redirect old Account Abstraction page to new Sponsored Gas Overview | ||
| export default async function Page(props: { | ||
| params: Promise<PageParams>; | ||
| searchParams: Promise<SearchParams>; | ||
| children: React.ReactNode; | ||
| params: Promise<{ team_slug: string; project_slug: string }>; | ||
| }) { | ||
| const [params, searchParams, authToken] = await Promise.all([ | ||
| props.params, | ||
| searchParamLoader(props.searchParams), | ||
| getAuthToken(), | ||
| ]); | ||
|
|
||
| if (!authToken) { | ||
| notFound(); | ||
| } | ||
|
|
||
| const [team, project] = await Promise.all([ | ||
| getTeamBySlug(params.team_slug), | ||
| getProject(params.team_slug, params.project_slug), | ||
| ]); | ||
|
|
||
| if (!team) { | ||
| redirect("/team"); | ||
| } | ||
|
|
||
| if (!project) { | ||
| redirect(`/team/${params.team_slug}`); | ||
| } | ||
|
|
||
| const interval = searchParams.interval ?? "week"; | ||
| const rangeType = searchParams.range || "last-120"; | ||
|
|
||
| const range: Range = { | ||
| from: | ||
| rangeType === "custom" | ||
| ? searchParams.from | ||
| : getLastNDaysRange(rangeType).from, | ||
| to: | ||
| rangeType === "custom" | ||
| ? searchParams.to | ||
| : getLastNDaysRange(rangeType).to, | ||
| type: rangeType, | ||
| }; | ||
|
|
||
| const userOpStats = await getUserOpUsage( | ||
| { | ||
| from: range.from, | ||
| period: interval, | ||
| projectId: project.id, | ||
| teamId: project.teamId, | ||
| to: range.to, | ||
| }, | ||
| authToken, | ||
| ); | ||
|
|
||
| const client = getClientThirdwebClient({ | ||
| jwt: authToken, | ||
| teamId: project.teamId, | ||
| }); | ||
|
|
||
| const isBundlerServiceEnabled = !!project.services.find( | ||
| (s) => s.name === "bundler", | ||
| ); | ||
|
|
||
| const hasSmartWalletsWithoutBilling = | ||
| isBundlerServiceEnabled && | ||
| team.billingStatus !== "validPayment" && | ||
| team.billingStatus !== "pastDue"; | ||
|
|
||
| return ( | ||
| <ProjectPage | ||
| header={{ | ||
| icon: SmartAccountIcon, | ||
| client, | ||
| title: "Account Abstraction", | ||
| description: | ||
| "Integrate EIP-7702 and EIP-4337 compliant smart accounts for gasless sponsorships and more.", | ||
| actions: null, | ||
| settings: { | ||
| href: `/team/${params.team_slug}/${params.project_slug}/settings/account-abstraction`, | ||
| }, | ||
| links: [ | ||
| { | ||
| type: "docs", | ||
| href: "https://portal.thirdweb.com/transactions/sponsor", | ||
| }, | ||
| { | ||
| type: "playground", | ||
| href: "https://playground.thirdweb.com/account-abstraction/eip-7702", | ||
| }, | ||
| ], | ||
| }} | ||
| > | ||
| {hasSmartWalletsWithoutBilling && ( | ||
| <> | ||
| <SmartWalletsBillingAlert teamSlug={params.team_slug} /> | ||
| <div className="h-10" /> | ||
| </> | ||
| )} | ||
| <div className="flex grow flex-col gap-10"> | ||
| <AccountAbstractionSummary | ||
| projectId={project.id} | ||
| teamId={project.teamId} | ||
| authToken={authToken} | ||
| /> | ||
|
|
||
| <AccountAbstractionAnalytics | ||
| client={client} | ||
| projectId={project.id} | ||
| teamId={project.teamId} | ||
| teamSlug={params.team_slug} | ||
| userOpStats={userOpStats} | ||
| /> | ||
| </div> | ||
| </ProjectPage> | ||
| const params = await props.params; | ||
| redirect( | ||
| `/team/${params.team_slug}/${params.project_slug}/wallets/sponsored-gas`, | ||
| ); | ||
| } | ||
|
|
||
| const seo = { | ||
| desc: "Add account abstraction to your web3 app & unlock powerful features for seamless onboarding, customizable transactions, & maximum security. Get started.", | ||
| title: "The Complete Account Abstraction Toolkit | thirdweb", | ||
| }; | ||
|
|
||
| export const metadata: Metadata = { | ||
| description: seo.desc, | ||
| openGraph: { | ||
| description: seo.desc, | ||
| images: [ | ||
| { | ||
| alt: seo.title, | ||
| height: 630, | ||
| url: `${getAbsoluteUrl()}/assets/og-image/dashboard-wallets-smart-wallet.png`, | ||
| width: 1200, | ||
| }, | ||
| ], | ||
| title: seo.title, | ||
| }, | ||
| title: seo.title, | ||
| }; |
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.