Fixed offers asc/desc sorting not updating in component (#19361)

refs
https://linear.app/tryghost/issue/PROD-8/when-i-sort-by-name-→-click-into-an-offer-→-go-back-to-the-list-it
This commit is contained in:
Ronald Langeveld 2023-12-13 15:46:11 +02:00 committed by GitHub
parent b67176431b
commit f23767fe12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,11 +247,11 @@ export const OffersIndexModal = () => {
<h1 className='text-3xl'>{offersTabs.find(tab => tab.id === selectedTab)?.title} offers</h1>
<div className='-mr-3'>
<SortMenu
direction='desc'
direction={sortDirection as 'asc' | 'desc'}
items={[
{id: 'date-added', label: 'Date added', selected: sortOption === 'date-added', direction: 'desc'},
{id: 'name', label: 'Name', selected: sortOption === 'name', direction: 'asc'},
{id: 'redemptions', label: 'Redemptions', selected: sortOption === 'redemptions', direction: 'desc'}
{id: 'date-added', label: 'Date added', selected: sortOption === 'date-added', direction: sortDirection as 'asc' | 'desc'},
{id: 'name', label: 'Name', selected: sortOption === 'name', direction: sortDirection as 'asc' | 'desc'},
{id: 'redemptions', label: 'Redemptions', selected: sortOption === 'redemptions', direction: sortDirection as 'asc' | 'desc'}
]}
position='right'
onDirectionChange={(selectedDirection) => {