Add zap button placeholder on channel profiles

This commit is contained in:
thePR0M3TH3AN
2025-09-25 18:36:18 -04:00
parent 4d0731fe6e
commit c1da7dbb39
3 changed files with 46 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="white"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
</svg>

After

Width:  |  Height:  |  Size: 263 B

View File

@@ -47,6 +47,8 @@ export async function initChannelProfileView() {
if (btn) btn.classList.add("hidden");
}
setupZapButton();
// 4) Load users profile (banner, avatar, etc.)
await loadUserProfile(hexPub);
@@ -54,6 +56,22 @@ export async function initChannelProfileView() {
await loadUserVideos(hexPub);
}
function setupZapButton() {
const zapButton = document.getElementById("zapButton");
if (!zapButton) {
return;
}
if (zapButton.dataset.initialized === "true") {
return;
}
zapButton.addEventListener("click", () => {
window.alert("Zaps coming soon.");
});
zapButton.dataset.initialized = "true";
}
/**
* Renders a Subscribe / Unsubscribe button with an icon,
* using color #fe0032 and the subscribe-button-icon.svg on the left.

View File

@@ -43,7 +43,21 @@
<!-- Area for Subscribe/Unsubscribe button -->
<div class="px-4 my-4">
<div id="subscribeBtnArea" class="hidden"></div>
<div class="flex items-center gap-3">
<button
id="zapButton"
type="button"
class="icon-button"
aria-label="Send a zap"
>
<img
src="assets/svg/lightning-bolt.svg"
alt="Zap"
class="icon-image"
/>
</button>
<div id="subscribeBtnArea" class="hidden"></div>
</div>
</div>
<hr class="my-6" />