lbry.tech/views/partials/navigation.js

60 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-07-12 17:21:42 +02:00
"use strict";
// P A C K A G E
const html = require("choo-async/html");
2018-07-13 23:58:24 +02:00
// V A R I A B L E
2018-07-12 17:21:42 +02:00
const navigationItems = [
2018-07-19 01:46:58 +02:00
{
url: "https://lbry.io",
name: "LBRY.io",
title: "Escape the techno scene"
},
2018-07-12 17:21:42 +02:00
{
url: "/overview",
name: "Overview",
title: "LBRY overview"
},
{
url: "/resources",
name: "Resources",
title: "View LBRY resources"
},
{
url: "/contribute",
name: "Contribute",
title: "Contribute to LBRY"
},
{
url: "/build",
name: "Build",
title: "View LBRY resources"
},
{
url: "/community",
name: "Community",
title: "Interact with LBRY"
}
];
// E X P O R T
2018-07-13 23:58:24 +02:00
module.exports = exports = state => {
const renderedNavigationItems = navigationItems.map(navigationItem => `<a class="navigation__item${state.href === navigationItem.url ? " active" : ""}" href="${navigationItem.url}" title="${navigationItem.title}">${navigationItem.name}</a>`);
return html`
<nav class="navigation">
<div class="inner-wrap">
<a class="navigation__item logo" href="/" title="LBRY homepage">Home</a>
${renderedNavigationItems}
</div>
</nav>
`;
};