Skip to content

Commit

Permalink
solved the linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
moheladwy committed Jan 13, 2025
1 parent 461ece8 commit 22c2d48
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions client/src/pages/Account/componenets/UpdateUserProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { User } from "@/lib/api/interfaces"
import { appStore } from "@/store/useStore"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form"
import { Input } from "@/components/ui/input"
import { toast } from "@/hooks/use-toast"
Expand Down Expand Up @@ -57,7 +57,7 @@ export function UpdateProfileForm({ user }: UpdateProfileFormProps) {
lastName: user.lastName,
userName: user.userName,
email: user.email,
phoneNumber: user.phoneNumber || "",
phoneNumber: user.phoneNumber ?? "",
},
})

Expand All @@ -72,7 +72,7 @@ export function UpdateProfileForm({ user }: UpdateProfileFormProps) {
newEmail: data.email,
newPhoneNumber: data.phoneNumber || null,
})

toast({
title: "Profile updated",
description: "Your profile information has been updated successfully.",
Expand Down Expand Up @@ -118,7 +118,7 @@ export function UpdateProfileForm({ user }: UpdateProfileFormProps) {
</FormItem>
)}
/>

<FormField
control={form.control}
name="lastName"
Expand Down Expand Up @@ -178,12 +178,13 @@ export function UpdateProfileForm({ user }: UpdateProfileFormProps) {
<FormField
control={form.control}
name="phoneNumber"
render={({ field }) => (
render={({ field: { value, ...fieldProps } }) => (
<FormItem>
<FormLabel>Phone Number</FormLabel>
<FormControl>
<Input
{...field}
{...fieldProps}
value={value ?? ""}
type="tel"
placeholder="Enter phone number"
disabled={isSubmitting}
Expand Down

0 comments on commit 22c2d48

Please sign in to comment.