From f625c31279a60608da692b567de57938dda44cd7 Mon Sep 17 00:00:00 2001
From: funkyhippo <52957110+funkyhippo@users.noreply.github.com>
Date: Sat, 23 Apr 2022 11:37:28 -0500
Subject: [PATCH] Fixes and enhancements to the client table. (#468)
* Fix sorting and order for name.
* Add the ability to sort display names.
* Remove no-unstable-nested-components rule.
* Use includes() rather than startsWith() for better 'searching' semantics.
---
web/components/client-table.tsx | 24 ++++++++++++++++++++----
web/styles/ant-overrides.scss | 4 +++-
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/web/components/client-table.tsx b/web/components/client-table.tsx
index f042da439..b1ae3dd11 100644
--- a/web/components/client-table.tsx
+++ b/web/components/client-table.tsx
@@ -1,6 +1,7 @@
-import { Table } from 'antd';
-import { SortOrder } from 'antd/lib/table/interface';
+import { Input, Table } from 'antd';
+import { FilterDropdownProps, SortOrder } from 'antd/lib/table/interface';
import { ColumnsType } from 'antd/es/table';
+import { SearchOutlined } from '@ant-design/icons';
import { formatDistanceToNow } from 'date-fns';
import { Client } from '../types/chat';
import UserPopover from './user-popover';
@@ -22,7 +23,22 @@ export default function ClientTable({ data }: ClientTableProps) {
);
},
- sorter: (a: any, b: any) => a.user.displayName - b.user.displayName,
+ sorter: (a: any, b: any) => b.user.displayName.localeCompare(a.user.displayName),
+ filterIcon: