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

@@ -78,6 +78,11 @@ function ExpensesDataTable({
});
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('expense-drawer', { expenseId: cell.row.original.id });
};
// Display empty status instead of the table.
if (isEmptyStatus) {
return <ExpensesEmptyStatus />;
@@ -103,6 +108,7 @@ function ExpensesDataTable({
TableLoadingRenderer={TableSkeletonRows}
TableHeaderSkeletonRenderer={TableSkeletonHeader}
ContextMenu={ActionsMenu}
onCellClick={handleCellClick}
payload={{
onPublish: handlePublishExpense,
onDelete: handleDeleteExpense,