mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-05 20:42:19 -07:00
Initial Commit Rework
This commit is contained in:
parent
74a4cc048c
commit
95051cbd63
2483 changed files with 101351 additions and 111396 deletions
37
frontend/src/Components/Menu/SortMenuItem.js
Normal file
37
frontend/src/Components/Menu/SortMenuItem.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import { icons, sortDirections } from 'Helpers/Props';
|
||||
import SelectedMenuItem from './SelectedMenuItem';
|
||||
|
||||
function SortMenuItem(props) {
|
||||
const {
|
||||
name,
|
||||
sortKey,
|
||||
sortDirection,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const isSelected = name === sortKey;
|
||||
|
||||
return (
|
||||
<SelectedMenuItem
|
||||
name={name}
|
||||
selectedIconName={sortDirection === sortDirections.ASCENDING ? icons.SORT_ASCENDING : icons.SORT_DESCENDING}
|
||||
isSelected={isSelected}
|
||||
{...otherProps}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
SortMenuItem.propTypes = {
|
||||
name: PropTypes.string,
|
||||
sortKey: PropTypes.string,
|
||||
sortDirection: PropTypes.oneOf(sortDirections.all),
|
||||
onPress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
SortMenuItem.defaultProps = {
|
||||
name: null
|
||||
};
|
||||
|
||||
export default SortMenuItem;
|
Loading…
Add table
Add a link
Reference in a new issue