Skip to content

Commit

Permalink
sort display and categories alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
axgu committed Jun 3, 2024
1 parent 697c934 commit b930652
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/manage/items/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ const CreateItem: NextPageWithLayout = () => {
</span>
</label>
<MyListbox
values={Object.values(Category)}
values={Object.values(Category).sort((a, b) => {
if (a === 'OTHER') {
return 1;
}
if (b === 'OTHER') {
return -1;
}
return a.localeCompare(b);
})}
displayValue={(prop) => Categories[prop]}
keyValue={(prop) => prop}
name="categories"
Expand Down

0 comments on commit b930652

Please sign in to comment.