diff --git a/apps/frontend/src/app/components/DataTable.tsx b/apps/frontend/src/app/components/DataTable.tsx index b9f9357c..061a0d7e 100644 --- a/apps/frontend/src/app/components/DataTable.tsx +++ b/apps/frontend/src/app/components/DataTable.tsx @@ -89,7 +89,7 @@ export default function DataTable({ ]; return ( - + {hasWidths && ( {selection && } @@ -99,34 +99,34 @@ export default function DataTable({ )} - - - {selection && ( - - - - - - - )} - {columns.map((column) => ( - + + {selection && ( + + -
{column.header}
-
- ))} -
-
+ + + + + )} + {columns.map((column) => ( + +
{column.header}
+
+ ))} + + {isLoading ? ( @@ -182,7 +182,13 @@ export default function DataTable({ )} {columns.map((column) => ( - + {column.cell(row)} ))} diff --git a/apps/frontend/src/app/components/TextInputField.tsx b/apps/frontend/src/app/components/TextInputField.tsx index 8d7585c5..99afd469 100644 --- a/apps/frontend/src/app/components/TextInputField.tsx +++ b/apps/frontend/src/app/components/TextInputField.tsx @@ -19,6 +19,7 @@ interface TextInputFieldProps { rows?: number; /** Rendered before the value, e.g. `$` on the budget field. */ prefix?: string; + icon?: React.ReactNode; inputMode?: 'text' | 'decimal' | 'numeric'; } @@ -35,6 +36,7 @@ export default function TextInputField({ multiline = false, rows = 4, prefix, + icon, inputMode, }: TextInputFieldProps) { const [internalValue, setInternalValue] = useState(''); @@ -97,9 +99,18 @@ export default function TextInputField({ {prefix} )} + {icon && ( + + {icon} + + )} (''); + const [selectedDonors, setSelectedDonors] = useState([]); const [showSort, setShowSort] = useState(false); const [selectedSort, setSelectedSort] = useState(''); @@ -116,8 +117,8 @@ export default function DonorsPage() { ) : rows; - if (selectedDonor) { - matching = matching.filter((row) => String(row.donor_id) === selectedDonor); + if (selectedDonors.length > 0) { + matching = matching.filter((row) => selectedDonors.includes(String(row.donor_id))); } if (selectedSort === '# of Projects') { @@ -129,7 +130,7 @@ export default function DonorsPage() { ); } return matching; - }, [rows, search, selectedDonor, selectedSort]); + }, [rows, search, selectedDonors, selectedSort]); const donorOptions = donors.map((d) => ({ label: d.organization, @@ -215,7 +216,6 @@ export default function DonorsPage() { setSaving(true); setSaveError(null); try { - // Previously this only closed the dialog, so nothing was ever persisted. await api.post('/donors', { organization: newOrganization.trim(), contact_name: newContactName.trim(), @@ -262,15 +262,17 @@ export default function DonorsPage() { onClick={() => setShowFilter((prev) => !prev)} > Filter By + {selectedDonors.length > 0 && ` (${selectedDonors.length})`} {showFilter && (
{ - setSelectedDonor(val as string); + setSelectedDonors(val as string[]); setCurrentPage(1); }} /> @@ -354,6 +356,7 @@ export default function DonorsPage() { } value={newContactEmail} onChange={(val) => { setNewContactEmail(val); @@ -441,4 +444,4 @@ export default function DonorsPage() {
); -} +} \ No newline at end of file