lbry-desktop/ui/js/component/subHeader/view.jsx
2017-06-05 21:21:55 -07:00

32 lines
600 B
JavaScript

import React from 'react';
import Link from 'component/link';
const SubHeader = props => {
const { subLinks, currentPage, navigate, modifier } = props;
const links = [];
for (let link of Object.keys(subLinks)) {
links.push(
<Link
onClick={event => navigate(`/${link}`, event)}
key={link}
className={
link == currentPage ? 'sub-header-selected' : 'sub-header-unselected'
}
>
{subLinks[link]}
</Link>
);
}
return (
<nav
className={'sub-header' + (modifier ? ' sub-header--' + modifier : '')}
>
{links}
</nav>
);
};
export default SubHeader;