Fix warnings for sorts (#735)

This commit is contained in:
Emilien Chauvet 2023-07-18 10:17:11 -07:00 committed by GitHub
parent 5d4fad2d96
commit b313ba175d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,20 +75,20 @@ export function SortDropdownButton<SortField>({
))}
</DropdownMenuItemsContainer>
) : (
[
<>
<DropdownButton.StyledDropdownTopOption
key={0}
onClick={() => setIsOptionUnfolded(true)}
>
{selectedSortDirection === 'asc' ? 'Ascending' : 'Descending'}
<DropdownButton.StyledDropdownTopOptionAngleDown />
</DropdownButton.StyledDropdownTopOption>,
<DropdownMenuSeparator />,
</DropdownButton.StyledDropdownTopOption>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer>
{availableSorts.map((sort, index) => (
<DropdownMenuSelectableItem
key={index + 1}
key={index}
onClick={() => {
setIsUnfolded(false);
onSortItemSelect(sort);
@ -100,8 +100,8 @@ export function SortDropdownButton<SortField>({
{sort.label}
</DropdownMenuSelectableItem>
))}
</DropdownMenuItemsContainer>,
]
</DropdownMenuItemsContainer>
</>
)}
</DropdownButton>
);