Skip to content

Commit

Permalink
placeholder for empty feed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ko71k committed Nov 25, 2024
1 parent 8828fd4 commit 147558b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/components/Feed/Feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class Feed {
* @param {string} description - The description of the event.
* @param {string} image - The image URL of the event.
*/

Object.entries(feed.events).forEach( (elem) => {
const {id, title, image} = elem[1];
const feedElement = new FeedElement(id, title, `${endpoint}/${image}`).renderTemplate();
Expand All @@ -98,6 +99,11 @@ export class Feed {
navigate(path);
});
});
if (feed.events.length = 0) {
const emptyDummy = document.createElement('div');
emptyDummy.innerHTML = 'Тут пока нет постов.';
feedContent.appendChild(emptyDummy);
}

} else {
/**
Expand Down

0 comments on commit 147558b

Please sign in to comment.