diff --git a/scm-ui/ui-components/src/table/Table.tsx b/scm-ui/ui-components/src/table/Table.tsx index c89c72e89e..6d9ccca5c5 100644 --- a/scm-ui/ui-components/src/table/Table.tsx +++ b/scm-ui/ui-components/src/table/Table.tsx @@ -65,6 +65,10 @@ const Table: FC = ({ data, sortable, children }) => { setlastSortBy(index); }; + const shouldShowIcon = (index: number) => { + return index === lastSortBy || index === hoveredColumnIndex; + }; + return ( tableData.length > 0 && ( @@ -81,8 +85,7 @@ const Table: FC = ({ data, sortable, children }) => { // @ts-ignore child.props.header } - {isSortable(child) && - renderSortIcon(child, ascending, index === lastSortBy || index === hoveredColumnIndex)} + {isSortable(child) && renderSortIcon(child, ascending, shouldShowIcon(index))} ))}