Обновить кошельки и мелкие детали UI

This commit is contained in:
AidarKC
2026-11-09 09:59:11 +03:00
parent 34f7faf0a8
commit 526941eb33
29 changed files with 469 additions and 201 deletions
+16 -4
View File
@@ -1,6 +1,6 @@
import { appendShineMessageLinks } from '../services/shine-message-links.js';
import { confirmDialog } from '../components/confirm-dialog.js';
import { confirmLikeAction } from '../components/like-action-sheet.js';
import { confirmLikeAction, showLikeStatistics } from '../components/like-action-sheet.js';
import { iconHtml } from '../components/ui-icon.js';
import { createOverflowDots } from '../components/overflow-dots.js';
import { rememberChannelPosition, readChannelPosition, requestReplyEditorOnOpen, restoreChannelPosition } from '../services/channel-view-state.js';
@@ -2014,7 +2014,6 @@ function renderPostCard(post, {
likeButton.innerHTML = `
<span class="channel-action-icon" aria-hidden="true">${iconHtml('heart', isLiked)}</span>
<span class="channel-action-label">${isPending ? 'Лайк...' : 'Лайк'}</span>
<span class="channel-action-counter">${post.likesCount || ''}</span>
`;
likeButton.setAttribute('aria-pressed', String(isLiked));
setActionTitle(likeButton, isPending ? 'Лайк…' : `${isLiked ? 'Убрать отметку «Нравится»' : 'Нравится'}, ${post.likesCount || 0}`);
@@ -2033,6 +2032,19 @@ function renderPostCard(post, {
}
});
const likesStatsButton = document.createElement('button');
likesStatsButton.type = 'button';
likesStatsButton.className = 'ui-button channel-action-item channel-action-like-stats';
likesStatsButton.textContent = String(Number(post.likesCount) || '');
likesStatsButton.setAttribute('aria-label', `Посмотреть статистику и список лайков: ${Number(post.likesCount) || 0}`);
likesStatsButton.addEventListener('click', (event) => {
event.stopPropagation();
void showLikeStatistics({
counts: post,
onViewList: (tab) => openMessageLikesListModal({ navigate, messageRef: post.messageRef, initialTab: tab }),
});
});
// Сервер считает только прямые ответы; полное число по всем уровням берём из обсуждения (кэш или подгрузка).
if (Number(post.repliesCount || 0) > 0) {
const threadRoute = buildThreadRoute(post, selector);
@@ -2140,8 +2152,8 @@ function renderPostCard(post, {
void onRepost?.(post.messageRef);
});
// Четыре кнопки как в Threads: лайк, ответы, репост, поделиться.
if (threadsLayout) actions.append(likeButton, discussionButton, repostButton, shareButton);
else actions.append(likeButton, shareButton, discussionButton);
if (threadsLayout) actions.append(likeButton, ...(Number(post.likesCount) > 0 ? [likesStatsButton] : []), discussionButton, repostButton, shareButton);
else actions.append(likeButton, ...(Number(post.likesCount) > 0 ? [likesStatsButton] : []), shareButton, discussionButton);
if (selector?.publicOrdinalUrlsAllowed && post.messageRef?.blockNumber != null) {
const streamRoute = makeShineChannelStreamRoute({
ownerBlockchainName: selector?.ownerBlockchainName,