Skip to content

Commit 1dcf123

Browse files
committed
fix: capital filter
1 parent 4f0aa6e commit 1dcf123

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

client/src/components/donations/DonationFilter.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useMemo } from "react";
1+
import { useState, useMemo } from "react";
22
import {
33
Menu,
44
MenuButton,
@@ -18,15 +18,6 @@ import {
1818
import { ChevronDownIcon, SearchIcon } from "@chakra-ui/icons";
1919
import { FaPlus } from "react-icons/fa";
2020

21-
type Props = {
22-
donors: string[];
23-
donor: string;
24-
setDonor: (d: string) => void;
25-
newDonor: string;
26-
setNewDonor: (n: string) => void;
27-
28-
addDonor: (name: string) => Promise<void>;
29-
};
3021

3122
export function DonationFilter({
3223
donors,
@@ -44,15 +35,6 @@ export function DonationFilter({
4435
handleAddDonor: () => void;
4536
}) {
4637
const { isOpen, onOpen, onClose } = useDisclosure();
47-
const donorMap: {[key: string]: string} = {
48-
"panera": "Panera",
49-
"mcdonalds": "McDonald's",
50-
"grand theater": "Grand Theater",
51-
"pantry": "Pantry",
52-
"copia": "Copia",
53-
"costco": "Costco",
54-
"sprouts": "Sprouts",
55-
}
5638
const {
5739
isOpen: isAddOpen,
5840
onOpen: onAddOpen,
@@ -93,7 +75,7 @@ export function DonationFilter({
9375
w="300px"
9476
textAlign="left"
9577
>
96-
{donor || "Select Donor"}
78+
{donor ? donor.charAt(0).toUpperCase() + donor.slice(1).toLowerCase() : "Select Donor"}
9779
</MenuButton>
9880

9981
<MenuList w="300px" p={2} boxShadow="md">
@@ -111,7 +93,7 @@ export function DonationFilter({
11193
<VStack align="stretch" spacing={0} maxH="100vh" overflowY="auto">
11294
{filtered.map((d) => (
11395
<MenuItem key={d} onClick={() => selectDonor(d)}>
114-
{donorMap[d]}
96+
{d.charAt(0).toUpperCase() + d.slice(1).toLowerCase()}
11597
</MenuItem>
11698
))}
11799
{filtered.length === 0 && (

0 commit comments

Comments
 (0)