Improved sorting dropdown to display order field and order dir

This commit is contained in:
Alejandro Celaya
2020-12-25 11:05:50 +01:00
parent 16f4f7eac8
commit 93b4de60f6
2 changed files with 22 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ export default function SortingDropdown<T extends string = string>(
>
{!isButton && <>Order by</>}
{isButton && !orderField && <>Order by...</>}
{isButton && orderField && <>Order by: {items[orderField]} - {orderDir}</>}
{isButton && orderField && `Order by: "${items[orderField]}" - "${orderDir ?? 'DESC'}"`}
</DropdownToggle>
<DropdownMenu
right={right}