mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 13:59:40 +02:00
feat(ui): add sorting icon component and table header cell styling EE-3626 (#7165)
* feat(ui): add sorting icons EE-3626 feat(ui): Add react component for sorting icons feat(ui) make component usable in angular * feat(ui): update angular example EE-3626
This commit is contained in:
parent
712207e69f
commit
14a8b1d897
17 changed files with 272 additions and 136 deletions
33
app/react/components/datatables/TableHeaderSortIcons.tsx
Normal file
33
app/react/components/datatables/TableHeaderSortIcons.tsx
Normal file
|
@ -0,0 +1,33 @@
|
|||
import clsx from 'clsx';
|
||||
|
||||
import SortDownIcon from './sort-arrow-down.svg?c';
|
||||
import SortUpIcon from './sort-arrow-up.svg?c';
|
||||
import styles from './TableHeaderSortIcons.module.css';
|
||||
|
||||
interface Props {
|
||||
sorted: boolean;
|
||||
descending: boolean;
|
||||
}
|
||||
|
||||
export function TableHeaderSortIcons({ sorted, descending }: Props) {
|
||||
return (
|
||||
<div className="flex flex-row no-wrap w-min-max">
|
||||
<SortDownIcon
|
||||
className={clsx(
|
||||
'space-left',
|
||||
sorted && !descending && styles.activeSortIcon,
|
||||
styles.sortIcon
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<SortUpIcon
|
||||
className={clsx(
|
||||
'-ml-1', // shift closer to SortDownIcon to match the mockup
|
||||
sorted && descending && styles.activeSortIcon,
|
||||
styles.sortIcon
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue