Skip to content

Commit

Permalink
Feature/default channel sorting (#578)
Browse files Browse the repository at this point in the history
* fix

* update
  • Loading branch information
ybaidiuk authored Nov 5, 2023
1 parent 7edf7e4 commit 7b41848
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/src/components/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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>(
Expand Down
6 changes: 6 additions & 0 deletions src/client/src/views/channels/channels/ChannelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,12 @@ export const ChannelTable = () => {
data={tableData}
withGlobalSort={true}
withSorting={true}
initSorting={[
{
id: 'balanceBars',
desc: false,
},
]}
toggleConfiguration={handleToggle}
defaultHiddenColumns={hiddenColumnState}
filterPlaceholder="channels"
Expand Down

0 comments on commit 7b41848

Please sign in to comment.