Skip to content

Commit

Permalink
fix collection list error
Browse files Browse the repository at this point in the history
  • Loading branch information
nahbee10 committed Oct 2, 2024
1 parent d7fe122 commit c7a619c
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions client/modules/IDE/components/CollectionList/CollectionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,25 @@ const CollectionList = ({
return null;
};

const getButtonLabel = useMemo(
(fieldName, displayName) => {
const { field, direction } = sorting;
let buttonLabel;
if (field !== fieldName) {
buttonLabel =
field === 'name'
? t('CollectionList.ButtonLabelAscendingARIA', { displayName })
: t('CollectionList.ButtonLabelDescendingARIA', { displayName });
} else if (direction === SortingActions.DIRECTION.ASC) {
buttonLabel = t('CollectionList.ButtonLabelDescendingARIA', {
displayName
});
} else {
buttonLabel = t('CollectionList.ButtonLabelAscendingARIA', {
displayName
});
}
return buttonLabel;
},
[sorting, t]
);
const getButtonLabel = (fieldName, displayName) => {
const { field, direction } = sorting;
let buttonLabel;
if (field !== fieldName) {
buttonLabel =
field === 'name'
? t('CollectionList.ButtonLabelAscendingARIA', { displayName })
: t('CollectionList.ButtonLabelDescendingARIA', { displayName });
} else if (direction === SortingActions.DIRECTION.ASC) {
buttonLabel = t('CollectionList.ButtonLabelDescendingARIA', {
displayName
});
} else {
buttonLabel = t('CollectionList.ButtonLabelAscendingARIA', {
displayName
});
}
return buttonLabel;
};

const renderFieldHeader = (fieldName, displayName) => {
const { field, direction } = sorting;
Expand Down

0 comments on commit c7a619c

Please sign in to comment.