From 7386c4f2bcbdc962b7e2342f259a58c46e172130 Mon Sep 17 00:00:00 2001 From: lmaosoggypancakes Date: Sat, 16 Mar 2024 16:59:29 -0400 Subject: [PATCH] fix: actual team search and member name styling --- src/components/admin/Teams/index.module.scss | 3 +++ src/components/admin/Teams/index.tsx | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/admin/Teams/index.module.scss b/src/components/admin/Teams/index.module.scss index f1f322a..71e5036 100644 --- a/src/components/admin/Teams/index.module.scss +++ b/src/components/admin/Teams/index.module.scss @@ -39,6 +39,9 @@ .buttonMargin { margin-right: 1em; + &:nth-child(n+3) { + margin-bottom: 1em; + } } .toolbar { diff --git a/src/components/admin/Teams/index.tsx b/src/components/admin/Teams/index.tsx index f6974aa..2e17c17 100644 --- a/src/components/admin/Teams/index.tsx +++ b/src/components/admin/Teams/index.tsx @@ -140,6 +140,11 @@ export default () => { )); }, + getProps: () => { + return { + class: "team-cell" + } + } }, { Header: 'Actions', @@ -261,9 +266,14 @@ export default () => { { // Loop over the table rows rows - .filter((row) => - row.original.name.includes(search), - ) + .filter((row) => { + const query = search.toLowerCase() + const obj = row.original; + return obj.name.toLowerCase().includes(query) || + obj.description.toLowerCase().includes(query) || + obj.members.some((member) => (member.firstName + member.lastName) + .toLowerCase().includes(query)) + }) .slice( page * rowsPerPage, page * rowsPerPage + rowsPerPage,