From 9d6b79c821dfb5baddf0a93d04a19b776d205280 Mon Sep 17 00:00:00 2001 From: Mohammad <153328465+Mo7amadd@users.noreply.github.com> Date: Tue, 24 Nov 2026 02:18:05 -0800 Subject: [PATCH] feat(clients): tint rows and cards of depleting and ended clients (#7084) An operator scanning a long client list for renewals had only a small tag in one column to go by. Tint the table row and the mobile card amber when the client is about to run out of time or traffic and red once it has, using the theme's warning and error tokens so all three themes follow. A selected row keeps its selection colour. --- frontend/src/pages/clients/ClientsPage.css | 42 ++++++++++++++++++++++ frontend/src/pages/clients/ClientsPage.tsx | 21 ++++++++--- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/clients/ClientsPage.css b/frontend/src/pages/clients/ClientsPage.css index bdb9a9986..d197d5da7 100644 --- a/frontend/src/pages/clients/ClientsPage.css +++ b/frontend/src/pages/clients/ClientsPage.css @@ -338,3 +338,45 @@ text-align: center; color: var(--ant-color-text-secondary); } + +.clients-page + .ant-table-wrapper + .ant-table-tbody + > tr.client-row-expiring:not(.ant-table-row-selected) + > td { + background: var(--ant-color-warning-bg); +} + +.clients-page + .ant-table-wrapper + .ant-table-tbody + > tr.client-row-expiring:not(.ant-table-row-selected):hover + > td { + background: var(--ant-color-warning-bg-hover); +} + +.clients-page + .ant-table-wrapper + .ant-table-tbody + > tr.client-row-depleted:not(.ant-table-row-selected) + > td { + background: var(--ant-color-error-bg); +} + +.clients-page + .ant-table-wrapper + .ant-table-tbody + > tr.client-row-depleted:not(.ant-table-row-selected):hover + > td { + background: var(--ant-color-error-bg-hover); +} + +.client-card.is-expiring:not(.is-selected) { + border-color: var(--ant-color-warning-border); + background: var(--ant-color-warning-bg); +} + +.client-card.is-depleted:not(.is-selected) { + border-color: var(--ant-color-error-border); + background: var(--ant-color-error-bg); +} diff --git a/frontend/src/pages/clients/ClientsPage.tsx b/frontend/src/pages/clients/ClientsPage.tsx index c7e7754c5..eb16928ce 100644 --- a/frontend/src/pages/clients/ClientsPage.tsx +++ b/frontend/src/pages/clients/ClientsPage.tsx @@ -1241,6 +1241,16 @@ export default function ClientsPage() { ], ); + const rowClassName = useCallback( + (record: ClientRecord) => { + const bucket = clientBucket(record); + if (bucket === 'depleted') return 'client-row-depleted'; + if (bucket === 'expiring') return 'client-row-expiring'; + return ''; + }, + [clientBucket], + ); + const tablePagination = { current: currentPage, pageSize: tablePageSize, @@ -1708,6 +1718,7 @@ export default function ClientsPage() { loading={transitioning} rowKey="email" rowSelection={rowSelection} + rowClassName={rowClassName} pagination={tablePagination} size="small" scroll={{ x: 1200 }} @@ -1767,11 +1778,13 @@ export default function ClientsPage() { )} {filteredClients.map((row) => { const bucket = clientBucket(row); + const cardClass = ['client-card']; + if (selectedRowKeys.includes(row.email)) + cardClass.push('is-selected'); + if (bucket === 'depleted' || bucket === 'expiring') + cardClass.push(`is-${bucket}`); return ( -