Skip to content

Commit ac4ade6

Browse files
committed
chore: remove Team from confirmEmail response (#7200)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on removing references to `Team` in various components related to email verification and onboarding, simplifying the data structure passed around. ### Detailed summary - Removed `teamStub` import and related references in `VerifyEmail.stories.tsx`. - Eliminated `Team` type imports in `useApi.ts`, `VerifyEmail.tsx`, and `account-onboarding-ui.tsx`. - Updated `onEmailConfirmed` and `verifyEmail` props to only handle `account` in `VerifyEmail.tsx` and `account-onboarding-ui.tsx`. - Adjusted the `onComplete` prop in `AccountOnboardingProps` to reflect the removal of `team`. > ✨ 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 - **Refactor** - Simplified onboarding and email verification flows by removing the requirement for team-related data. All relevant callbacks and functions now operate solely with account information. - **Type Updates** - Updated type signatures for onboarding and verification handlers to exclude the team property, streamlining integration for end-users and developers. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 819ce86 commit ac4ade6

File tree

4 files changed

+7
-30
lines changed

4 files changed

+7
-30
lines changed

apps/dashboard/src/@3rdweb-sdk/react/hooks/useApi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { apiServerProxy } from "@/actions/proxies";
22
import type { Project } from "@/api/projects";
3-
import type { Team } from "@/api/team";
43
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
54
import { useActiveAccount } from "thirdweb/react";
65
import { accountKeys, authorizedWallets } from "../cache-keys";
@@ -188,7 +187,7 @@ export function useUpdateNotifications() {
188187
export const verifyEmailClient = async (input: ConfirmEmailInput) => {
189188
type Result = {
190189
error?: { message: string };
191-
data: { team: Team; account: Account };
190+
data: { account: Account };
192191
};
193192

194193
const res = await apiServerProxy<Result>({

apps/dashboard/src/app/(app)/login/onboarding/VerifyEmail/VerifyEmail.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2-
import { newAccountStub, teamStub } from "stories/stubs";
2+
import { newAccountStub } from "stories/stubs";
33
import { storybookLog } from "stories/utils";
44
import { AccountOnboardingLayout } from "../onboarding-layout";
55
import { VerifyEmail } from "./VerifyEmail";
@@ -60,7 +60,6 @@ function Story(props: {
6060
throw new Error("Example error");
6161
}
6262
return {
63-
team: teamStub("foo", "free"),
6463
account: newAccountStub(),
6564
};
6665
}}

apps/dashboard/src/app/(app)/login/onboarding/VerifyEmail/VerifyEmail.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"use client";
2-
3-
import type { Team } from "@/api/team";
42
import { Spinner } from "@/components/ui/Spinner/Spinner";
53
import { Button } from "@/components/ui/button";
64
import {
@@ -24,17 +22,11 @@ import {
2422

2523
type VerifyEmailProps = {
2624
email: string;
27-
onEmailConfirmed: (params: {
28-
team: Team;
29-
account: Account;
30-
}) => void;
25+
onEmailConfirmed: (params: { account: Account }) => void;
3126
onBack: () => void;
3227
verifyEmail: (params: {
3328
confirmationToken: string;
34-
}) => Promise<{
35-
team: Team;
36-
account: Account;
37-
}>;
29+
}) => Promise<{ account: Account }>;
3830
resendConfirmationEmail: () => Promise<void>;
3931
trackEvent: (params: TrackingParams) => void;
4032
accountAddress: string;

apps/dashboard/src/app/(app)/login/onboarding/account-onboarding-ui.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"use client";
2-
3-
import type { Team } from "@/api/team";
42
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
53
import type { TrackingParams } from "hooks/analytics/useTrack";
64
import { useState } from "react";
@@ -27,18 +25,12 @@ type AccountOnboardingScreen =
2725
};
2826

2927
type AccountOnboardingProps = {
30-
onComplete: (param: {
31-
team: Team;
32-
account: Account;
33-
}) => void;
28+
onComplete: (param: { account: Account }) => void;
3429
accountAddress: string;
3530
trackEvent: (params: TrackingParams) => void;
3631
verifyEmail: (params: {
3732
confirmationToken: string;
38-
}) => Promise<{
39-
team: Team;
40-
account: Account;
41-
}>;
33+
}) => Promise<{ account: Account }>;
4234
resendEmailConfirmation: () => Promise<void>;
4335
loginOrSignup: (input: {
4436
email: string;
@@ -106,12 +98,7 @@ export function AccountOnboardingUI(props: AccountOnboardingProps) {
10698
verifyEmail={props.verifyEmail}
10799
resendConfirmationEmail={props.resendEmailConfirmation}
108100
trackEvent={props.trackEvent}
109-
onEmailConfirmed={(data) => {
110-
props.onComplete({
111-
team: data.team,
112-
account: data.account,
113-
});
114-
}}
101+
onEmailConfirmed={props.onComplete}
115102
onBack={() => setScreen(screen.backScreen)}
116103
email={screen.email}
117104
/>

0 commit comments

Comments
 (0)