Skip to content

Commit

Permalink
User full info displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
Md-Rubel-Ahmed-Rana committed Feb 14, 2024
1 parent eb8e726 commit 068d7a1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
41 changes: 40 additions & 1 deletion frontend/src/components/pages/Profile/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const EditProfilePage = ({ setIsEdit }: { setIsEdit: any }) => {
<form onSubmit={handleSubmit(handleEditProfile)} className="mt-4">
{!isChangeImage && (
<div className="mb-4 relative">
<label className="block text-sm font-medium ">Image</label>
<img
className="w-20 h-20 rounded-full border-2 "
src={user?.profile_picture}
Expand Down Expand Up @@ -122,6 +121,46 @@ const EditProfilePage = ({ setIsEdit }: { setIsEdit: any }) => {
className="mt-1 p-2 w-full border rounded-md"
/>
</div>
<div className="mb-4">
<label className="block text-sm font-medium text-gray-600">
Phone number
</label>
<input
type="text"
{...register("phoneNumber")}
className="mt-1 p-2 w-full border rounded-md"
/>
</div>
<div className="mb-4">
<label className="block text-sm font-medium text-gray-600">
Present address
</label>
<input
type="text"
{...register("presentAddress")}
className="mt-1 p-2 w-full border rounded-md"
/>
</div>
<div className="mb-4">
<label className="block text-sm font-medium text-gray-600">
Permanent address
</label>
<input
type="text"
{...register("permanentAddress")}
className="mt-1 p-2 w-full border rounded-md"
/>
</div>
<div className="mb-4">
<label className="block text-sm font-medium text-gray-600">
Country
</label>
<input
type="text"
{...register("country")}
className="mt-1 p-2 w-full border rounded-md"
/>
</div>
<div className="mt-4 flex items-center gap-4">
<button type="submit" className="border px-4 py-2 rounded-md">
Save Changes
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/components/pages/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ const ProfilePage = () => {
<strong>Designation:</strong>{" "}
{user?.designation || "Not available"}
</p>
<p>
<strong>Phone No.:</strong> {user?.phoneNumber || "Not available"}
</p>
<p>
<strong>Present Address:</strong>{" "}
{user?.presentAddress || "Not available"}
</p>
<p>
<strong>Permanent Address:</strong>{" "}
{user?.permanentAddress || "Not available"}
</p>
<p>
<strong>Country:</strong> {user?.country || "Not available"}
</p>
</div>
<div className="mt-4">
<button
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/interfaces/user.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export type IUser = {
email: string;
department: string;
designation: string;
phoneNumber: string;
permanentAddress: string;
presentAddress: string;
country: string;
password: string;
createdAt?: string;
updatedAt?: string;
Expand All @@ -17,6 +21,10 @@ export const userInitData: IUser = {
email: "",
department: "",
designation: "",
phoneNumber: "",
permanentAddress: "",
presentAddress: "",
country: "",
password: "",
createdAt: "",
updatedAt: "",
Expand Down

0 comments on commit 068d7a1

Please sign in to comment.