import React from "react"; import { observer } from "mobx-react-lite"; import Image from "next/image"; import { useRouter } from "next/router"; import { useTheme } from "next-themes"; // ui import { Avatar } from "@plane/ui"; // components import { OnBoardingForm } from "@/components/accounts/onboarding-form"; // helpers import { EPageTypes } from "@/helpers/authentication.helper"; import { ASSET_PREFIX } from "@/helpers/common.helper"; // hooks import { useUser, useUserProfile } from "@/hooks/store"; // wrappers import { AuthWrapper } from "@/lib/wrappers"; // assets import ProfileSetupDark from "public/onboarding/profile-setup-dark.svg"; import ProfileSetup from "public/onboarding/profile-setup-light.svg"; const OnBoardingPage = observer(() => { // router const router = useRouter(); const { next_path } = router.query; // hooks const { resolvedTheme } = useTheme(); const { data: user } = useUser(); const { data: currentUserProfile, updateUserProfile } = useUserProfile(); if (!user) { router.push("/"); return <>; } // complete onboarding const finishOnboarding = async () => { if (!user) return; await updateUserProfile({ onboarding_step: { ...currentUserProfile?.onboarding_step, profile_complete: true, }, }).catch(() => { console.log("Failed to update onboarding status"); }); if (next_path) router.push(next_path.toString()); router.push("/"); }; return (
Plane Logo
{user?.avatar && ( )} {user?.first_name ? `${user?.first_name} ${user?.last_name ?? ""}` : user?.email}

Welcome to Plane!

Let’s setup your profile, tell us a bit about yourself.

{user?.avatar && ( )} {user?.first_name ? `${user?.first_name} ${user?.last_name ?? ""}` : user?.email}
Profile setup
); }); export default OnBoardingPage;