Scheduling infrastructure for absolutely everyone.
fix: user infer props and remove avatarSSr from onboarding (#5549)
Udit Takkara36d15894de3
diff --git a/apps/web/components/getting-started/steps-views/UserProfile.tsx b/apps/web/components/getting-started/steps-views/UserProfile.tsxindex e90e5f7e8bc..917678bbf6d 100644--- a/apps/web/components/getting-started/steps-views/UserProfile.tsx+++ b/apps/web/components/getting-started/steps-views/UserProfile.tsx@@ -4,21 +4,20 @@ import { FormEvent, useRef, useState } from "react";import { useForm } from "react-hook-form";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { User } from "@calcom/prisma/client";import { trpc } from "@calcom/trpc/react";import { Button, ImageUploader, showToast, TextArea } from "@calcom/ui";+import { Avatar } from "@calcom/ui";-import { AvatarSSR } from "@components/ui/AvatarSSR";--interface IUserProfile {- user?: User;-}+import type { IOnboardingPageProps } from "../../../pages/getting-started/[[...step]]";type FormData = {bio: string;};+interface IUserProfileProps {+ user: IOnboardingPageProps["user"];+}-const UserProfile = (props: IUserProfile) => {+const UserProfile = (props: IUserProfileProps) => {const { user } = props;const { t } = useLocale();const avatarRef = useRef<HTMLInputElement>(null!);@@ -100,7 +99,14 @@ const UserProfile = (props: IUserProfile) => {return (<form onSubmit={onSubmit}><div className="flex flex-row items-center justify-start rtl:justify-end">- {user && <AvatarSSR user={user} alt="Profile picture" className="h-16 w-16" />}+ {user && (+ <Avatar+ alt={user.username || "user avatar"}+ gravatarFallbackMd5={user.emailMd5}+ size="lg"+ imageSrc={imageSrc}+ />+ )}<inputref={avatarRef}type="hidden"diff --git a/apps/web/components/getting-started/steps-views/UserSettings.tsx b/apps/web/components/getting-started/steps-views/UserSettings.tsxindex ce524fd7960..ed47714ee0b 100644--- a/apps/web/components/getting-started/steps-views/UserSettings.tsx+++ b/apps/web/components/getting-started/steps-views/UserSettings.tsx@@ -4,14 +4,15 @@ import { Controller, useForm } from "react-hook-form";import dayjs from "@calcom/dayjs";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { User } from "@calcom/prisma/client";import { trpc } from "@calcom/trpc/react";import { Button, TimezoneSelect } from "@calcom/ui";import { UsernameAvailability } from "@components/ui/UsernameAvailability";+import type { IOnboardingPageProps } from "../../../pages/getting-started/[[...step]]";+interface IUserSettingsProps {- user: User;+ user: IOnboardingPageProps["user"];nextStep: () => void;}diff --git a/apps/web/pages/getting-started/[[...step]].tsx b/apps/web/pages/getting-started/[[...step]].tsxindex f88f4a0508e..49a08401bce 100644--- a/apps/web/pages/getting-started/[[...step]].tsx+++ b/apps/web/pages/getting-started/[[...step]].tsx@@ -11,15 +11,14 @@ import { User } from "@calcom/prisma/client";import { Button, StepCard, Steps } from "@calcom/ui";import prisma from "@lib/prisma";+import { inferSSRProps } from "@lib/types/inferSSRProps";import { ConnectedCalendars } from "@components/getting-started/steps-views/ConnectCalendars";import { SetupAvailability } from "@components/getting-started/steps-views/SetupAvailability";import UserProfile from "@components/getting-started/steps-views/UserProfile";import { UserSettings } from "@components/getting-started/steps-views/UserSettings";-interface IOnboardingPageProps {- user: User;-}+export type IOnboardingPageProps = inferSSRProps<typeof getServerSideProps>;const INITIAL_STEP = "user-settings";const steps = ["user-settings", "connected-calendar", "setup-availability", "user-profile"] as const;