Skip to content

Commit

Permalink
add text for empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Jan 19, 2023
1 parent 7f101ff commit 7b9a7b0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,17 @@ export const ui = (() => {
}, 500);
}, 100);
}

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

const para = document.createElement("p");
para.innerText = "There's no to-dos on this project.\nTouch the green plus button to create one."

emptyState.append(para);
projectItem.append(emptyState);
}
};

function toggleCard() {
Expand Down Expand Up @@ -955,7 +966,9 @@ export const ui = (() => {

const h2 = document.createElement("h2");
h2.classList.add("main-page-h2");
h2.innerText = "Your projects:";
h2.innerText = resume.length == 0 ?
"You have no projects.\nCreate a new one from the main menu."
: "Welcome back!\n\nYour projects:";

cardsContainer.append(header, h2);

Expand Down

0 comments on commit 7b9a7b0

Please sign in to comment.