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"; // mobx import { useMobxStore } from "@/lib/mobx/store-provider"; // assets import ProfileSetupDark from "public/onboarding/profile-setup-dark.svg"; import ProfileSetup from "public/onboarding/profile-setup.svg"; const imagePrefix = Boolean(parseInt(process.env.NEXT_PUBLIC_DEPLOY_WITH_NGINX || "0")) ? "/spaces" : ""; const OnBoardingPage = observer(() => { // router const router = useRouter(); const { next_path } = router.query; // hooks const { resolvedTheme } = useTheme(); const { user: userStore, profile: { currentUserProfile, updateUserProfile }, } = useMobxStore(); const user = userStore?.currentUser; 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.replace(next_path.toString()); router.replace("/"); }; return (
Let’s setup your profile, tell us a bit about yourself.