Skip to content

Commit

Permalink
sort list alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezryr committed Oct 26, 2024
1 parent de99f08 commit 37a7173
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions components/PlantList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ export const PlantList = ({

return (
<div>
{plants.filter(filterPlantList).map((plant, key) => (
//this should display PlantCalendarRows instead of this temporary div
<div key={key}>{plant.plant_name}</div>
))}
{plants
.filter(filterPlantList)
.sort((a, b) => a.plant_name.localeCompare(b.plant_name))
.map((plant, key) => (
//this should display PlantCalendarRows instead of this temporary div
<div key={key}>{plant.plant_name}</div>
))}
</div>
);
};

0 comments on commit 37a7173

Please sign in to comment.