BC-14: feat: table rows clickable.

This commit is contained in:
elforjani3
2021-09-07 00:17:32 +02:00
parent 39ba31a842
commit b3439a2bc1
24 changed files with 153 additions and 4 deletions

View File

@@ -95,6 +95,11 @@ function CustomersTable({
openDrawer('contact-detail-drawer', { contactId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('contact-detail-drawer', { contactId: cell.row.original.id });
};
if (isEmptyStatus) {
return <CustomersEmptyStatus />;
}
@@ -121,6 +126,7 @@ function CustomersTable({
autoResetPage={false}
TableLoadingRenderer={TableSkeletonRows}
TableHeaderSkeletonRenderer={TableSkeletonHeader}
onCellClick={handleCellClick}
payload={{
onDelete: handleCustomerDelete,
onEdit: handleCustomerEdit,

View File

@@ -104,6 +104,7 @@ export function useCustomersTableColumns() {
width: 45,
disableResizing: true,
disableSortBy: true,
clickable: true,
},
{
id: 'display_name',
@@ -111,6 +112,7 @@ export function useCustomersTableColumns() {
accessor: 'display_name',
className: 'display_name',
width: 150,
clickable: true,
},
{
id: 'company_name',
@@ -118,6 +120,7 @@ export function useCustomersTableColumns() {
accessor: 'company_name',
className: 'company_name',
width: 150,
clickable: true,
},
{
id: 'work_phone',
@@ -125,6 +128,7 @@ export function useCustomersTableColumns() {
accessor: PhoneNumberAccessor,
className: 'phone_number',
width: 100,
clickable: true,
},
{
id: 'balance',
@@ -132,6 +136,7 @@ export function useCustomersTableColumns() {
accessor: BalanceAccessor,
className: 'receivable_balance',
width: 100,
clickable: true,
},
],
[],