Skip to content

Commit 0a87162

Browse files
committed
feat: add button for show task
1 parent 70ef104 commit 0a87162

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ <h2 class="font-bold text-center">
6565
</div>
6666
</div>
6767
</dialog>
68-
68+
6969
<!-- Criando um usuario -->
7070
<dialog class="bg-gray-800 m-auto h-98 w-[30rem] rounded-xl p-4" id="user-modal">
7171
<div class="content-modal relative">

src/javascript/domTasksCrud.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,17 @@ async function fetchData() {
142142
pathTrash.setAttribute("stroke-linecap", "round");
143143
pathTrash.setAttribute("stroke-linejoin", "round");
144144
pathTrash.setAttribute("d", "M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z");
145-
146145
svgTrash.appendChild(pathTrash);
147146

147+
const tasButton = document.createElement("button");
148+
tasButton.classList.add("bg-black", "p-2", "rounded-[10px]", "font-semibold");
149+
tasButton.textContent = "VER";
150+
tasButton.id = `task-open-${task?.id}`;
151+
tasButton.addEventListener("click", () => {
152+
console.log(task.description)
153+
})
154+
155+
svgDiv.appendChild(tasButton);
148156
svgDiv.appendChild(svgStar);
149157
svgDiv.appendChild(svgTrash);
150158

@@ -161,5 +169,3 @@ async function fetchData() {
161169
}
162170

163171
fetchData();
164-
165-

0 commit comments

Comments
 (0)