Skip to content

Commit

Permalink
🔧 Fix cert modal (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenikAdrien authored Oct 29, 2024
1 parent 0465a62 commit 37ce472
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/organisms/CertificationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const CertificationModal = ({
const [hasExpiryDate, setHasExpiryDate] = useState<boolean>(
editMode && !!userCertificationRef.to
);
const sortedCerts = certificationsRef
? certificationsRef.sort((a, b) =>
a.certBody + a.name > b.certBody + b.name ? 1 : -1
)
: [];

return (
<div className="flex flex-col max-h-75vh p-2 w-full">
Expand Down Expand Up @@ -77,9 +82,7 @@ const CertificationModal = ({
<CustomSelect
labelFn={(cert) => `${cert?.certBody} - ${cert?.name}`}
keyFn={(cert) => cert.id}
choices={certificationsRef.sort((a, b) =>
a.certBody + a.name > b.certBody + b.name ? 1 : -1
)}
choices={sortedCerts}
selectedChoice={userCertification?.Certification}
placeholder={t("userProfile.certModal.selectCert")}
readOnly={editMode}
Expand Down

0 comments on commit 37ce472

Please sign in to comment.