Skip to content

Commit

Permalink
refactor: sorting managed
Browse files Browse the repository at this point in the history
Signed-off-by: karan <[email protected]>
  • Loading branch information
16-karan committed Oct 16, 2023
1 parent 35237b6 commit 1dd7099
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/Ecosystem/MemberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ const MemberList = () => {
const firstName = firstMember?.ecosystemRole?.name;
const secondName = secondMember?.ecosystemRole?.name;

if (firstName > secondName) {
return 1;
} else if (secondName > firstName) {
return -1;
} else {
return 0;
switch (true) {
case firstName > secondName:
return 1;
case secondName > firstName:
return -1;
default:
return 0;
}
};
const sortedMemberList = data?.data?.members?.sort(compareMembers);
Expand Down

0 comments on commit 1dd7099

Please sign in to comment.