From 1885c88daa5ef937d2aff37a020b8eeea0b04815 Mon Sep 17 00:00:00 2001 From: Sameer Ahmed Date: Wed, 22 Jan 2025 19:56:27 +0530 Subject: [PATCH 1/2] fixed avatar bug --- src/components/UserProfile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/UserProfile.tsx b/src/components/UserProfile.tsx index 808f513..f2ba0c0 100644 --- a/src/components/UserProfile.tsx +++ b/src/components/UserProfile.tsx @@ -330,7 +330,7 @@ export function UserProfile({ session }: UserProfileProps) { alt="Profile" className="w-full h-full rounded-full object-cover" /> - + } )} From 5b737773f556cd67d9fac0707ebf0ec6f82dfb90 Mon Sep 17 00:00:00 2001 From: Debamitra Mukherjee Date: Sun, 26 Jan 2025 12:53:21 +0530 Subject: [PATCH 2/2] added trim() to fix whitespace issue with name and role --- src/components/Onboarding.tsx | 4 ++-- src/components/UserProfile.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Onboarding.tsx b/src/components/Onboarding.tsx index 913f125..c0e7d5d 100644 --- a/src/components/Onboarding.tsx +++ b/src/components/Onboarding.tsx @@ -11,8 +11,8 @@ interface OnboardingProps { // Validation schema const onboardingSchema = z.object({ - name: z.string().min(2, 'Name must be at least 2 characters').max(50, 'Name is too long'), - role: z.string().min(2, 'Role must be at least 2 characters').max(50, 'Role is too long'), + name: z.string().trim().min(2, 'Name must be at least 2 characters').max(50, 'Name is too long'), + role: z.string().trim().min(2, 'Role must be at least 2 characters').max(50, 'Role is too long'), bio: z.string().max(500, 'Bio must be less than 500 characters').optional(), skills: z.string().max(200, 'Skills list is too long') .refine(val => !val || val.split(',').every(skill => skill.trim().length > 0), { diff --git a/src/components/UserProfile.tsx b/src/components/UserProfile.tsx index 808f513..0cbedfc 100644 --- a/src/components/UserProfile.tsx +++ b/src/components/UserProfile.tsx @@ -15,8 +15,8 @@ interface UserProfileProps { // Validation schema const profileSchema = z.object({ - name: z.string().min(2, 'Name must be at least 2 characters').max(50, 'Name is too long'), - role: z.string().min(2, 'Role must be at least 2 characters').max(50, 'Role is too long'), + name: z.string().trim().min(2, 'Name must be at least 2 characters').max(50, 'Name is too long'), + role: z.string().trim().min(2, 'Role must be at least 2 characters').max(50, 'Role is too long'), bio: z.string().max(500, 'Bio must be less than 500 characters').optional(), skills: z.string().max(200, 'Skills list is too long') .refine(val => !val || val.split(',').every(skill => skill.trim().length > 0), {