2018-09-24 22:58:03 +02:00
|
|
|
"use strict";
|
|
|
|
|
2018-09-26 18:42:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
// P A C K A G E
|
|
|
|
|
2018-09-24 22:58:03 +02:00
|
|
|
import html from "choo/html";
|
|
|
|
|
2018-09-26 18:42:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
// E X P O R T
|
2018-09-24 22:58:03 +02:00
|
|
|
|
2018-10-03 22:27:13 +02:00
|
|
|
export default links => {
|
2018-10-01 22:47:10 +02:00
|
|
|
const renderedLinks = links.map((link) =>
|
|
|
|
returnLinkTemplate(link.title, link.description, link.destination, link.label));
|
|
|
|
|
2018-09-24 22:58:03 +02:00
|
|
|
return html`
|
2018-09-24 23:14:50 +02:00
|
|
|
<ul class="link-grid">
|
|
|
|
${renderedLinks}
|
2018-09-24 22:58:03 +02:00
|
|
|
</ul>
|
|
|
|
`;
|
2018-09-26 18:42:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// H E L P E R
|
|
|
|
|
|
|
|
function returnLinkTemplate(title, description, destination, label) {
|
|
|
|
return `
|
|
|
|
<li class="link-grid__link">
|
|
|
|
<p class="link-grid__title"><strong>${title}</strong></p>
|
|
|
|
<p class="link-grid__description">${description}</p>
|
|
|
|
<a class="link-grid__cta" href="${destination}">${label}</a>
|
|
|
|
</li>
|
|
|
|
`;
|
2018-09-24 22:58:03 +02:00
|
|
|
}
|