From a82da6541d2a339dc37acdbb304ce904d3b10ba9 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Sat, 27 Jul 2024 18:56:10 +0200 Subject: [PATCH] Show column sort order. --- src/Smartable/Column.tsx | 2 ++ src/styles/_headings.less | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Smartable/Column.tsx b/src/Smartable/Column.tsx index d1ba4fc..c7ba038 100644 --- a/src/Smartable/Column.tsx +++ b/src/Smartable/Column.tsx @@ -146,6 +146,8 @@ export function ColumnHeading() {column.title} + + {sortState?.order && {sortState.order}} ); } diff --git a/src/styles/_headings.less b/src/styles/_headings.less index de82337..4e2fa38 100644 --- a/src/styles/_headings.less +++ b/src/styles/_headings.less @@ -60,5 +60,22 @@ tr.headings { bottom: 0.5em; } + + .order + { // Sort order indicator. + position: relative; + top: 0; + bottom: 0; + + display: block; + margin: auto 0; + padding: 0.3em 0.3em 0; + align-items: center; + justify-content: center; + color: var(--foreground-lightest); + font-size: 0.7em; + + float: right; + } } }