Skip to content

Commit

Permalink
add text to empty filter
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Jan 19, 2023
1 parent ce10147 commit 97407fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,17 @@ export const ui = (() => {
});

cardsContainer.appendChild(projectItem);

if(project.todos.length == 0){
const emptyDiv = document.createElement("div");
emptyDiv.classList.add("empty-state");

const emptyPara = document.createElement("p");
emptyPara.innerText = `There's no results for this filter.`;

emptyDiv.append(emptyPara);
projectItem.append(emptyDiv);
}
}

function taskCheck(projectIdxParam, todoIdxParam, taskIdxParam){
Expand Down Expand Up @@ -979,7 +990,7 @@ export const ui = (() => {
h2.classList.add("main-page-h2");
h2.innerText = resume.length == 0 ?
"You have no projects.\nCreate a new one from the main menu."
: "Welcome back!\n\nYour projects:";
: "Your projects:";

cardsContainer.append(header, h2);

Expand Down

0 comments on commit 97407fe

Please sign in to comment.