From 697c934820ba3d5b3e3d45d47651e08ceaa67611 Mon Sep 17 00:00:00 2001 From: axgu <86838870+axgu@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:41:50 -0400 Subject: [PATCH] sort categories alphabetically --- prisma/schema.prisma | 2 +- src/components/Form/Listbox.tsx | 1 + src/types/index.ts | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index c110b64..13489c7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -36,8 +36,8 @@ enum Location { enum Category { BEVERAGE_CONTAINER - CLOTHING CHARGER + CLOTHING EARBUDS_HEADPHONES_CASES GLASSES_CASES JEWELRY_WATCHES diff --git a/src/components/Form/Listbox.tsx b/src/components/Form/Listbox.tsx index 0047a39..41e7f24 100644 --- a/src/components/Form/Listbox.tsx +++ b/src/components/Form/Listbox.tsx @@ -63,6 +63,7 @@ export default function MyListbox({ ? field.value?.length > 0 ? field.value .map((value: T) => displayValue(value)) + .sort() .join(', ') : placeholder : field.value diff --git a/src/types/index.ts b/src/types/index.ts index b6d12da..f06540c 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -39,15 +39,15 @@ export const Colors: Record = { OTHER: 'Other' }; export const Categories: Record = { - CLOTHING: 'Clothing', + BEVERAGE_CONTAINER: 'Beverage Container', CHARGER: 'Charger', - UMBRELLA: 'Umbrellas', + CLOTHING: 'Clothing', + EARBUDS_HEADPHONES_CASES: 'Earbuds/Headphones/Case', GLASSES_CASES: 'Glasses/Sunglasses/Cases', JEWELRY_WATCHES: 'Jewelry/Watches', - EARBUDS_HEADPHONES_CASES: 'Earbuds/Headphones/Case', + KEYS: 'Keys', PHONES_LAPTOPS_TABLETS: 'Phones/Laptops/Tablets', - BEVERAGE_CONTAINER: 'Beverage Container', STATIONARY: 'Stationary', - KEYS: 'Keys', + UMBRELLA: 'Umbrellas', OTHER: 'Other' };