chore: Update personal and team onboarding flows (remove profile/video steps, add settings, improve team invites) (#24947)
## What does this PR do? - Redesigns and streamlines the onboarding flow for personal, team, and organization accounts - Consolidates shared components and improves code organization - Adds browser preview for better user experience during onboarding - Simplifies the personal onboarding flow by removing the video integration step - Enhances team onboarding with CSV upload functionality ## Visual Demo (For contributors especially) #### Image Demo: - The PR adds a new browser preview component that shows users how their profile/team will look during onboarding - Redesigned UI with a more consistent layout across all onboarding steps - Improved mobile responsiveness with better component organization ## Mandatory Tasks (DO NOT REMOVE) - [x] I have self-reviewed the code. - [x] I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. - [x] I confirm automated tests are in place that prove my fix is effective or that my feature works. ## How should this be tested? 1. Test the complete onboarding flow for personal accounts: - Start at `/onboarding/getting-started` - Proceed through personal details and calendar setup - Verify the flow completes successfully 2. Test the team onboarding flow: - Start at `/onboarding/getting-started` and select team - Complete team details - Test the invite options including CSV upload - Verify team creation works correctly 3. Test the organization onboarding flow: - Start at `/onboarding/getting-started` and select organization - Complete organization details and branding - Test member invitations - Verify organization creation works correctly 4. Verify browser preview functionality: - Check that the preview updates in real-time as you enter information - Confirm it displays correctly on different screen sizes ## Checklist - I have read the [contributing guide](https://github.com/calcom/cal.com/blob/main/CONTRIBUTING.md) - My code follows the style guidelines of this project - I have commented my code, particularly in hard-to-understand areas - I have checked if my changes generate no new warnings
This commit is contained in:
1 parent
52e27bab53
commit
02b1393ff4
24 files changed
+1312
-1264
No files matched your search
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
import { isCompanyEmail } from "@calcom/features/ee/organizations/lib/utils";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
@@ -10,20 +12,43 @@ import { Button } from "@calcom/ui/components/button";
|
||||
import { type IconName } from "@calcom/ui/components/icon";
|
||||
import { RadioAreaGroup } from "@calcom/ui/components/radio";
|
||||
|
||||
import { OnboardingCard } from "../components/OnboardingCard";
|
||||
import { OnboardingLayout } from "../components/OnboardingLayout";
|
||||
import { OnboardingContinuationPrompt } from "../components/onboarding-continuation-prompt";
|
||||
import { PlanIcon } from "../components/plan-icon";
|
||||
import { useOnboardingStore, type PlanType } from "../store/onboarding-store";
|
||||
|
||||
type OnboardingViewProps = {
|
||||
userName: string;
|
||||
userEmail: string;
|
||||
};
|
||||
|
||||
export const OnboardingView = ({ userName, userEmail }: OnboardingViewProps) => {
|
||||
export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
|
||||
const router = useRouter();
|
||||
const { t } = useLocale();
|
||||
const { selectedPlan, setSelectedPlan } = useOnboardingStore();
|
||||
const previousPlanRef = useRef<PlanType | null>(null);
|
||||
|
||||
// Plan order mapping for determining direction
|
||||
const planOrder: Record<PlanType, number> = {
|
||||
personal: 0,
|
||||
team: 1,
|
||||
organization: 2,
|
||||
};
|
||||
|
||||
// Calculate animation direction synchronously
|
||||
const getDirection = (): "up" | "down" => {
|
||||
if (!selectedPlan || !previousPlanRef.current) return "down";
|
||||
const previousOrder = planOrder[previousPlanRef.current];
|
||||
const currentOrder = planOrder[selectedPlan];
|
||||
return currentOrder > previousOrder ? "down" : "up";
|
||||
};
|
||||
|
||||
const direction = getDirection();
|
||||
|
||||
// Update previous plan ref after render
|
||||
useEffect(() => {
|
||||
previousPlanRef.current = selectedPlan;
|
||||
}, [selectedPlan]);
|
||||
|
||||
const handleContinue = () => {
|
||||
if (selectedPlan === "organization") {
|
||||
@@ -37,7 +62,7 @@ export const OnboardingView = ({ userName, userEmail }: OnboardingViewProps) =>
|
||||
|
||||
const planIconByType: Record<PlanType, IconName> = {
|
||||
personal: "user",
|
||||
team: "users",
|
||||
team: "user",
|
||||
organization: "users",
|
||||
};
|
||||
|
||||
@@ -56,7 +81,7 @@ export const OnboardingView = ({ userName, userEmail }: OnboardingViewProps) =>
|
||||
badge: t("onboarding_plan_team_badge"),
|
||||
description: t("onboarding_plan_team_description"),
|
||||
icon: planIconByType.team,
|
||||
variant: "single" as const,
|
||||
variant: "team" as const,
|
||||
},
|
||||
{
|
||||
id: "organization" as PlanType,
|
||||
@@ -76,26 +101,26 @@ export const OnboardingView = ({ userName, userEmail }: OnboardingViewProps) =>
|
||||
return true;
|
||||
});
|
||||
|
||||
const selectedPlanData = plans.find((plan) => plan.id === selectedPlan);
|
||||
|
||||
return (
|
||||
<>
|
||||
<OnboardingContinuationPrompt />
|
||||
<OnboardingLayout userEmail={userEmail} currentStep={1}>
|
||||
<div className="flex w-full flex-col gap-6">
|
||||
{/* Left column - Main content */}
|
||||
<OnboardingCard
|
||||
title="Select plan"
|
||||
subtitle={t("onboarding_welcome_question")}
|
||||
footer={
|
||||
<div className="flex w-full justify-end gap-2">
|
||||
<Button color="primary" className="rounded-[10px]" onClick={handleContinue}>
|
||||
{t("continue")}
|
||||
</Button>
|
||||
</div>
|
||||
}>
|
||||
{/* Card */}
|
||||
<div className="bg-muted border-muted relative rounded-xl border p-1">
|
||||
<div className="bg-muted border-muted relative flex min-h-0 w-full flex-col overflow-hidden rounded-xl border p-1">
|
||||
<div className="rounded-inherit flex w-full flex-col items-start overflow-clip">
|
||||
{/* Card Header */}
|
||||
<div className="flex w-full gap-1.5 px-5 py-4">
|
||||
<div className="flex w-full flex-col gap-1">
|
||||
<h1 className="font-cal text-xl font-semibold leading-6">
|
||||
{t("onboarding_welcome_message", { userName })}
|
||||
</h1>
|
||||
<p className="text-subtle text-sm font-medium leading-tight">
|
||||
{t("onboarding_welcome_question")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Plan options */}
|
||||
<RadioAreaGroup.Group
|
||||
value={selectedPlan ?? undefined}
|
||||
@@ -114,46 +139,45 @@ export const OnboardingView = ({ userName, userEmail }: OnboardingViewProps) =>
|
||||
"pr-12 [&>button]:left-auto [&>button]:right-6 [&>button]:mt-0 [&>button]:transform"
|
||||
)}
|
||||
classNames={{
|
||||
container: "flex w-full items-center gap-4 p-4 pl-5 pr-12 md:p-5 md:pr-14",
|
||||
container: "flex w-full items-center gap-3 p-5 pr-12",
|
||||
}}>
|
||||
<div className="flex w-full items-center gap-4">
|
||||
<PlanIcon icon={plan.icon} variant={plan.variant} />
|
||||
<div className="flex flex-1 flex-col gap-2">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<p className="text-emphasis text-base font-semibold leading-5">{plan.title}</p>
|
||||
<Badge
|
||||
variant="gray"
|
||||
size="md"
|
||||
className="hidden h-4 rounded-md px-1 py-1 md:flex md:items-center">
|
||||
<span className="text-emphasis text-xs font-medium leading-3">
|
||||
{plan.badge}
|
||||
</span>
|
||||
</Badge>
|
||||
</div>
|
||||
<div className="flex w-full flex-col gap-1">
|
||||
<div className="flex flex-wrap items-center gap-1">
|
||||
<p className="text-emphasis text-sm font-semibold leading-4">{plan.title}</p>
|
||||
<Badge
|
||||
variant="gray"
|
||||
size="md"
|
||||
className="h-4 w-fit rounded-md px-1 py-1 md:hidden">
|
||||
className="hidden h-4 rounded-md px-1 py-1 md:flex md:items-center">
|
||||
<span className="text-emphasis text-xs font-medium leading-3">{plan.badge}</span>
|
||||
</Badge>
|
||||
<p className="text-subtle max-w-full text-sm font-normal leading-tight">
|
||||
{plan.description}
|
||||
</p>
|
||||
</div>
|
||||
<Badge variant="gray" size="md" className="h-4 w-fit rounded-md px-1 py-1 md:hidden">
|
||||
<span className="text-emphasis text-xs font-medium leading-3">{plan.badge}</span>
|
||||
</Badge>
|
||||
<p className="text-subtle max-w-full text-sm font-medium leading-[1.25]">
|
||||
{plan.description}
|
||||
</p>
|
||||
</div>
|
||||
</RadioAreaGroup.Item>
|
||||
);
|
||||
})}
|
||||
</RadioAreaGroup.Group>
|
||||
|
||||
{/* Footer */}
|
||||
<div className="flex w-full items-center justify-end gap-1 px-5 py-4">
|
||||
<Button color="primary" className="rounded-[10px]" onClick={handleContinue}>
|
||||
{t("continue")}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</OnboardingCard>
|
||||
|
||||
{/* Right column - Icon display */}
|
||||
<div className="bg-muted border-subtle hidden h-full w-full rounded-l-2xl border-b border-l border-t xl:flex xl:items-center xl:justify-center">
|
||||
<AnimatePresence mode="wait">
|
||||
{selectedPlanData && (
|
||||
<PlanIcon
|
||||
key={selectedPlan}
|
||||
icon={selectedPlanData.icon}
|
||||
variant={selectedPlanData.variant}
|
||||
animationDirection={direction}
|
||||
/>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
</OnboardingLayout>
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user