Skip to content

Commit

Permalink
colums name changed
Browse files Browse the repository at this point in the history
  • Loading branch information
JulyaPetrovskaya committed Nov 25, 2023
1 parent 7e24036 commit f255945
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/components/PeopleTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ export const PeopleTable: React.FC<Props> = ({ people }) => {
.sort((person1, person2) => {
switch (sort) {
case SortFields.Name:
return person1.name.localeCompare(person2.name);
case SortFields.Sex:
return person1[sort].localeCompare(person2[sort]);

return person1.sex.localeCompare(person2.sex);
case SortFields.Born:
return person1.born - person2.born;
case SortFields.Died:
return person1[sort] - person2[sort];
return person1.died - person2.died;

default:
return 0;
Expand Down
10 changes: 5 additions & 5 deletions src/types/SortFields.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum SortFields {
Name = 'name',
Sex = 'sex',
Born = 'born',
Died = 'died',
}
Name = 'Name',
Sex = 'Sex',
Born = 'Born',
Died = 'Died',
}

0 comments on commit f255945

Please sign in to comment.