mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 05:43:04 +00:00
Refactor Video Card and Modal layout to move view counts and use icons.
- Moved view count and comments to a new bottom engagement section in `VideoCard.js`. - Replaced text labels with Eye and Message SVG icons in `VideoCard.js`. - Updated `video-modal.html` to include an Eye icon for the view count. - Refactored `VideoModal.js` to update only the text node for view counts, preserving the icon. - Removed "views" text suffix in favor of a cleaner numeric display.
This commit is contained in:
1 parent
868639cbf2
commit
1f47e161d4
2 files changed
+21
-7
No files matched your search
@@ -3959,8 +3959,17 @@ export class VideoModal {
|
||||
}
|
||||
|
||||
updateViewCountLabel(text) {
|
||||
if (this.videoViewCountEl) {
|
||||
this.videoViewCountEl.textContent = text || "";
|
||||
if (!this.videoViewCountEl) {
|
||||
return;
|
||||
}
|
||||
const textEl = this.videoViewCountEl.querySelector(
|
||||
"[data-view-count-text]"
|
||||
);
|
||||
if (textEl) {
|
||||
textEl.textContent = text || "–";
|
||||
} else {
|
||||
// Fallback if span is missing
|
||||
this.videoViewCountEl.textContent = text || "–";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5438,15 +5447,14 @@ export class VideoModal {
|
||||
return this.formatViewCountLabel(Number(total));
|
||||
}
|
||||
if (status === "hydrating") {
|
||||
return "Loading views…";
|
||||
return "Loading…";
|
||||
}
|
||||
return "– views";
|
||||
return "–";
|
||||
}
|
||||
|
||||
formatViewCountLabel(total) {
|
||||
const numeric = Number.isFinite(total) ? Math.max(0, Number(total)) : 0;
|
||||
const label = numeric === 1 ? "view" : "views";
|
||||
return `${formatViewCount(numeric)} ${label}`;
|
||||
return formatViewCount(numeric);
|
||||
}
|
||||
|
||||
syncMoreMenuData({ currentVideo, canManageBlacklist }) {
|
||||
|
||||
Reference in new issue
Block a user