Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bluedeepart committed Jan 17, 2025
1 parent 04fa802 commit b360807
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions blocks/header/header-megamenu-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,16 @@ function buildEventCardSubmenu(block) {

/* RECENT NEWS */
async function recentNewsHandler() {
const eventsMenu = div({ class: ['flex-space-between'] });
document.querySelector('.news-cards-submenu').replaceChildren(eventsMenu);
const newsMenu = div({ class: ['flex-space-between'] });
document.querySelector('.news-cards-submenu').replaceChildren(newsMenu);

const news = await ffetch('/query-index.json')
.sheet('news')
.limit(1)
.all();
console.log(news);

news.forEach((item) => {
const newsDate = formatDate(unixDateToString(item.date));
console.log(newsDate);
const title = div(h3({ id: toClassName(item.title) }, item.title));
const newsContent = div(
div(
Expand All @@ -296,7 +294,7 @@ async function recentNewsHandler() {
title,
newsContent,
);
eventsMenu.replaceWith(newsBlock);
newsMenu.replaceWith(newsBlock);
});
}

Expand Down

0 comments on commit b360807

Please sign in to comment.