Feature/default channel sorting (#578)

* fix

* update
This commit is contained in:
Yevhen Baidiuk 2023-11-05 15:35:31 +01:00 committed by GitHub
parent 7edf7e40f4
commit 7b41848be8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -22,6 +22,7 @@ interface TableProps {
filterPlaceholder?: string;
withGlobalSort?: boolean; // enables the global search box
withSorting?: boolean; // enables columns to be sorted
initSorting?: SortingState;
withBorder?: boolean;
alignCenter?: boolean;
fontSize?: string;
@ -94,9 +95,10 @@ export default function Table({
toggleConfiguration,
withGlobalSort = false,
withSorting = false,
initSorting,
}: TableProps) {
const [globalFilter, setGlobalFilter] = useState('');
const [sorting, setSorting] = useState<SortingState>([]);
const [sorting, setSorting] = useState<SortingState>(initSorting || []);
const [isOpen, setIsOpen] = useState<boolean>(false);
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>(

View File

@ -580,6 +580,12 @@ export const ChannelTable = () => {
data={tableData}
withGlobalSort={true}
withSorting={true}
initSorting={[
{
id: 'balanceBars',
desc: false,
},
]}
toggleConfiguration={handleToggle}
defaultHiddenColumns={hiddenColumnState}
filterPlaceholder="channels"