diff --git a/apps/portal/src/features/account/components/PersonalInfoCard.tsx b/apps/portal/src/features/account/components/PersonalInfoCard.tsx
index 0e9135f1..24ffb446 100644
--- a/apps/portal/src/features/account/components/PersonalInfoCard.tsx
+++ b/apps/portal/src/features/account/components/PersonalInfoCard.tsx
@@ -2,15 +2,15 @@
import { SubCard } from "@/components/molecules/SubCard/SubCard";
import { UserIcon, PencilIcon, CheckIcon, XMarkIcon } from "@heroicons/react/24/outline";
-import type { ProfileDisplayData } from "@customer-portal/domain/customer";
+import type { UserProfile } from "@customer-portal/domain/customer";
interface PersonalInfoCardProps {
- data: ProfileDisplayData;
+ data: UserProfile;
isEditing: boolean;
isSaving: boolean;
onEdit: () => void;
onCancel: () => void;
- onChange: (field: keyof ProfileDisplayData, value: string) => void;
+ onChange: (field: "email" | "phonenumber", value: string) => void;
onSave: () => void;
}
@@ -47,56 +47,41 @@ export function PersonalInfoCard({
- {isEditing ? (
-
onChange("firstname", e.target.value)}
- className="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"
- />
- ) : (
-
+
+
{data.firstname || Not provided}
- )}
+
Name cannot be changed from the portal.
+
- {isEditing ? (
-
onChange("lastname", e.target.value)}
- className="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"
- />
- ) : (
-
+
+
{data.lastname || Not provided}
- )}
+
Name cannot be changed from the portal.
+
-
-
-
{data.email}
-
-
- Verified
-
+ {isEditing ? (
+
onChange("email", e.target.value)}
+ className="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"
+ />
+ ) : (
+
+
+
Email can be updated from the portal.
-
- Email cannot be changed. Contact support to update your email.
-
-
+ )}
diff --git a/apps/portal/src/features/account/hooks/useProfileData.ts b/apps/portal/src/features/account/hooks/useProfileData.ts
index 735c7778..86572e47 100644
--- a/apps/portal/src/features/account/hooks/useProfileData.ts
+++ b/apps/portal/src/features/account/hooks/useProfileData.ts
@@ -20,8 +20,7 @@ export function useProfileData() {
const [billingInfo, setBillingInfo] = useState<{ address: Address } | null>(null);
const [formData, setFormData] = useState
({
- firstname: user?.firstname || "",
- lastname: user?.lastname || "",
+ email: user?.email || "",
phonenumber: user?.phonenumber || "",
});
@@ -70,8 +69,7 @@ export function useProfileData() {
useEffect(() => {
if (user) {
setFormData({
- firstname: user.firstname || "",
- lastname: user.lastname || "",
+ email: user.email || "",
phonenumber: user.phonenumber || "",
});
}
@@ -81,8 +79,7 @@ export function useProfileData() {
setIsSavingProfile(true);
try {
const updatedUser = await accountService.updateProfile({
- firstname: next.firstname,
- lastname: next.lastname,
+ email: next.email,
phonenumber: next.phonenumber,
});
useAuthStore.setState(state => ({