diff --git a/src/components/profile/ProfileExperience.tsx b/src/components/profile/ProfileExperience.tsx index a877d1c2..35a6248e 100644 --- a/src/components/profile/ProfileExperience.tsx +++ b/src/components/profile/ProfileExperience.tsx @@ -65,7 +65,7 @@ const ProfileExperience = ({ handleClick={handleOpen} title={ isOwner - ? 'You haven’t added work experience yet' + ? "You haven't added work experience yet" : 'No Work Experience added.' } description={ @@ -79,58 +79,66 @@ const ProfileExperience = ({ {experiences.length !== 0 && (
- {experiences.map((experience) => ( -
-
-
-
-
-
-
-
-
-

- {experience.designation} -

-

- - {experience.companyName} - - - {experience.EmploymentType} - - {experience.workMode} -

-
- {formatDateRange( - experience.startDate, - experience.endDate - )} + {experiences + .sort((a, b) => { + const dateA = a.endDate ? new Date(a.endDate) : new Date(); + const dateB = b.endDate ? new Date(b.endDate) : new Date(); + return dateB.getTime() - dateA.getTime(); + }) + .map((experience) => ( +
+
+
+
+
+
+
+
+
+

+ {experience.designation} +

+

+ + {experience.companyName} + + + {experience.EmploymentType} + + {experience.workMode} +

+
+ {formatDateRange( + experience.startDate, + experience.endDate + )} +
-
- {isOwner && ( -
- - -
- )} + +
+ )} +
+

+ {experience.description} +

-

- {experience.description} -

-
- ))} + ))}
)}