Revert "feat: redesign team creation flow to match onboarding-v2 design (#26733)"
This reverts commit 37847c0061.
This commit is contained in:
1 parent
5e8fd13d1f
commit
c5fbafd9fb
13 files changed
+139
-997
No files matched your search
@@ -9,12 +9,7 @@ import { trpc } from "@calcom/trpc/react";
|
||||
import type { OnboardingState } from "../store/onboarding-store";
|
||||
import { useOnboardingStore } from "../store/onboarding-store";
|
||||
|
||||
type UseCreateTeamOptions = {
|
||||
redirectBasePath?: string;
|
||||
};
|
||||
|
||||
export function useCreateTeam(options: UseCreateTeamOptions = {}) {
|
||||
const { redirectBasePath = "/onboarding/teams" } = options;
|
||||
export function useCreateTeam() {
|
||||
const router = useRouter();
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const flags = useFlagMap();
|
||||
@@ -33,7 +28,7 @@ export function useCreateTeam(options: UseCreateTeamOptions = {}) {
|
||||
|
||||
// Validate team details - if empty, redirect back to team details step
|
||||
if (!teamDetails.name || !teamDetails.name.trim() || !teamDetails.slug || !teamDetails.slug.trim()) {
|
||||
router.push(`${redirectBasePath}/details`);
|
||||
router.push("/onboarding/teams/details");
|
||||
setIsSubmitting(false);
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +51,7 @@ export function useCreateTeam(options: UseCreateTeamOptions = {}) {
|
||||
if (result.team) {
|
||||
// Store the teamId and redirect to invite flow after team creation
|
||||
setTeamId(result.team.id);
|
||||
router.push(`${redirectBasePath}/invite/email?teamId=${result.team.id}`);
|
||||
router.push(`/onboarding/teams/invite?teamId=${result.team.id}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to create team:", error);
|
||||
|
||||
Reference in new issue
Block a user