mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-29 16:31:33 +00:00
36 lines
777 B
JavaScript
36 lines
777 B
JavaScript
import React from "react";
|
|
import Link from "component/link";
|
|
import classnames from "classnames";
|
|
|
|
const SubHeader = props => {
|
|
const { subLinks, currentPage, navigate, fullWidth, smallMargin } = 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={classnames("sub-header", {
|
|
"sub-header--full-width": fullWidth,
|
|
"sub-header--small-margin": smallMargin,
|
|
})}
|
|
>
|
|
{links}
|
|
</nav>
|
|
);
|
|
};
|
|
|
|
export default SubHeader;
|