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.
31 lines
630 B
31 lines
630 B
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import SelectedMenuItem from './SelectedMenuItem';
|
|
|
|
function ViewMenuItem(props) {
|
|
const {
|
|
name,
|
|
selectedView,
|
|
...otherProps
|
|
} = props;
|
|
|
|
const isSelected = name === selectedView;
|
|
|
|
return (
|
|
<SelectedMenuItem
|
|
name={name}
|
|
isSelected={isSelected}
|
|
{...otherProps}
|
|
/>
|
|
);
|
|
}
|
|
|
|
ViewMenuItem.propTypes = {
|
|
name: PropTypes.string,
|
|
selectedView: PropTypes.string.isRequired,
|
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
onPress: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default ViewMenuItem;
|