From a36d15894de3010b35162c742b8d6d6b1f8c63c7 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Sun, 4 Dec 2022 00:50:18 +0530 Subject: [PATCH] fix: user infer props and remove avatarSSr from onboarding (#5549) Co-authored-by: alannnc --- .../steps-views/UserProfile.tsx | 22 ++++++++++++------- .../steps-views/UserSettings.tsx | 5 +++-- .../web/pages/getting-started/[[...step]].tsx | 5 ++--- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/apps/web/components/getting-started/steps-views/UserProfile.tsx b/apps/web/components/getting-started/steps-views/UserProfile.tsx index e90e5f7e8b..917678bbf6 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(null!); @@ -100,7 +99,14 @@ const UserProfile = (props: IUserProfile) => { return (
- {user && } + {user && ( + + )} void; } diff --git a/apps/web/pages/getting-started/[[...step]].tsx b/apps/web/pages/getting-started/[[...step]].tsx index f88f4a0508..49a08401bc 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; const INITIAL_STEP = "user-settings"; const steps = ["user-settings", "connected-calendar", "setup-availability", "user-profile"] as const;