You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
44 lines
1.0 KiB
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import MenuContent from 'Components/Menu/MenuContent';
|
|
import SortMenu from 'Components/Menu/SortMenu';
|
|
import SortMenuItem from 'Components/Menu/SortMenuItem';
|
|
import { align, sortDirections } from 'Helpers/Props';
|
|
import translate from 'Utilities/String/translate';
|
|
|
|
function CollectionSortMenu(props) {
|
|
const {
|
|
sortKey,
|
|
sortDirection,
|
|
isDisabled,
|
|
onSortSelect
|
|
} = props;
|
|
|
|
return (
|
|
<SortMenu
|
|
isDisabled={isDisabled}
|
|
alignMenu={align.RIGHT}
|
|
>
|
|
<MenuContent>
|
|
<SortMenuItem
|
|
name="sortTitle"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Title')}
|
|
</SortMenuItem>
|
|
</MenuContent>
|
|
</SortMenu>
|
|
);
|
|
}
|
|
|
|
CollectionSortMenu.propTypes = {
|
|
sortKey: PropTypes.string,
|
|
sortDirection: PropTypes.oneOf(sortDirections.all),
|
|
isDisabled: PropTypes.bool.isRequired,
|
|
onSortSelect: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default CollectionSortMenu;
|