Skip to content

Commit 98e0cbd

Browse files
committed
[TOOL-4373] Dashboard: replace /team/~/~ with /team/<team-slug>/~ wherever possible (#6946)
<!-- ## 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 focuses on enhancing the billing components in the dashboard by adding `teamSlug` as a prop to various components, allowing for better integration of team-specific billing information. ### Detailed summary - Added `teamSlug` prop to `<CreditsInfoCard />` in `Billing/index.tsx`. - Updated `<SmartWalletsBillingAlert />` to receive `teamSlug` in `AccountAbstractionPage.tsx`. - Modified `CreditsInfoCard` to use `teamSlug` prop. - Enhanced `SmartWalletsBillingAlert` to accept `teamSlug` as a prop. - Passed `teamSlug` to the `href` in `SmartWalletsBillingAlert`. - Included `teamSlug` in `CreditsItem` component. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 1bc036c commit 98e0cbd

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/connect/account-abstraction/AccountAbstractionPage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export function AccountAbstractionLayout(props: {
4747
</TrackedUnderlineLink>
4848
</p>
4949
</div>
50-
{props.hasSmartWalletsWithoutBilling && <SmartWalletsBillingAlert />}
50+
{props.hasSmartWalletsWithoutBilling && (
51+
<SmartWalletsBillingAlert teamSlug={props.teamSlug} />
52+
)}
5153
<GasCreditAlert
5254
teamSlug={props.teamSlug}
5355
projectId={props.projectId}

apps/dashboard/src/components/settings/Account/Billing/CreditsItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface CreditsItemProps {
1717
onClickApply?: () => void;
1818
twAccount: Account;
1919
client: ThirdwebClient;
20+
teamSlug: string;
2021
}
2122

2223
export const CreditsItem: React.FC<CreditsItemProps> = ({
@@ -25,6 +26,7 @@ export const CreditsItem: React.FC<CreditsItemProps> = ({
2526
onClickApply,
2627
twAccount,
2728
client,
29+
teamSlug,
2830
}) => {
2931
const trackEvent = useTrack();
3032

@@ -130,7 +132,7 @@ export const CreditsItem: React.FC<CreditsItemProps> = ({
130132
<div className="mt-2 flex justify-end border-t px-4 py-4 lg:px-6">
131133
<Button asChild size="sm" variant="outline">
132134
<Link
133-
href="/team/~/~/settings/credits"
135+
href={`/team/${teamSlug}/~/settings/credits`}
134136
onClick={() => {
135137
trackEvent({
136138
category: "op-sponsorship",

apps/dashboard/src/components/settings/Account/Billing/PlanCard.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { CreditsItem } from "./CreditsItem";
1212
export const CreditsInfoCard = (props: {
1313
twAccount: Account;
1414
client: ThirdwebClient;
15+
teamSlug: string;
1516
}) => {
1617
const { data: credits } = useAccountCredits();
1718

@@ -29,13 +30,15 @@ export const CreditsInfoCard = (props: {
2930
isOpCreditDefault={true}
3031
twAccount={props.twAccount}
3132
client={props.client}
33+
teamSlug={props.teamSlug}
3234
/>
3335
{restCredits?.map((credit) => (
3436
<CreditsItem
3537
key={credit.couponId}
3638
credit={credit}
3739
twAccount={props.twAccount}
3840
client={props.client}
41+
teamSlug={props.teamSlug}
3942
/>
4043
))}
4144
</section>

apps/dashboard/src/components/settings/Account/Billing/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ export const Billing: React.FC<BillingProps> = ({
3030
<PlanInfoCardClient team={team} subscriptions={subscriptions} />
3131
</div>
3232

33-
<CreditsInfoCard twAccount={twAccount} client={client} />
33+
<CreditsInfoCard
34+
twAccount={twAccount}
35+
client={client}
36+
teamSlug={team.slug}
37+
/>
3438
<Coupons teamId={team.id} isPaymentSetup={validPayment} />
3539
</div>
3640
);

apps/dashboard/src/components/settings/ApiKeys/Alerts.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
22
import { TrackedUnderlineLink } from "@/components/ui/tracked-link";
33
import { CircleAlertIcon } from "lucide-react";
44

5-
export const SmartWalletsBillingAlert = () => {
5+
export const SmartWalletsBillingAlert = (props: {
6+
teamSlug: string;
7+
}) => {
68
return (
79
<Alert variant="warning">
810
<CircleAlertIcon className="size-5" />
911
<AlertTitle>Account Abstraction on Mainnet</AlertTitle>
1012
<AlertDescription>
1113
To enable AA on mainnet chains,{" "}
1214
<TrackedUnderlineLink
13-
href="/team/~/~/settings/billing"
15+
href={`/team/${props.teamSlug}/~/settings/billing`}
1416
category="api_keys"
1517
label="smart_wallets_missing_billing"
1618
>

0 commit comments

Comments
 (0)