1
0
Fork 0
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:
Ali 2022-07-08 01:20:33 +12:00 committed by GitHub
parent 712207e69f
commit 14a8b1d897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 272 additions and 136 deletions

View 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>
);
}