X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a01f29eb2238fbab8c87254ab23bbc82107832be..7444429308f438fb2e29188db8f208223ed39128:/src/components/data-table/data-table.tsx diff --git a/src/components/data-table/data-table.tsx b/src/components/data-table/data-table.tsx index ec260e96..565630be 100644 --- a/src/components/data-table/data-table.tsx +++ b/src/components/data-table/data-table.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { Table, TableBody, TableRow, TableCell, TableHead, StyleRulesCallback, Theme, WithStyles, withStyles, Typography } from '@material-ui/core'; +import { Table, TableBody, TableRow, TableCell, TableHead, TableSortLabel, StyleRulesCallback, Theme, WithStyles, withStyles, Typography } from '@material-ui/core'; import { DataColumn } from './data-column'; export interface DataTableProps { @@ -23,9 +23,16 @@ class DataTable extends React.Component & WithStyles {columns .filter(column => column.selected) - .map(({ name, renderHeader, key }, index) => + .map(({ name, renderHeader, key, sortDirection, onSortToggle }, index) => - {renderHeader ? renderHeader() : name} + {renderHeader ? + renderHeader() : + onSortToggle && onSortToggle()}> + {name} + } )} @@ -48,7 +55,7 @@ class DataTable extends React.Component & WithStyles )} - : :