HEADER v3, primary аккаунты и подтверждения

This commit is contained in:
AidarKC
2026-11-27 12:29:24 +03:00
parent f9e7c4ef94
commit ae430e84c7
89 changed files with 1201 additions and 1596 deletions
+6 -5
View File
@@ -7,6 +7,7 @@ import { appendShineMessageLinks } from '../services/shine-message-links.js';
import { confirmDialog } from '../components/confirm-dialog.js';
import { openBlockchainDetailsModal } from '../components/blockchain-details-dialog.js';
import { confirmLikeAction, showLikeStatistics } from '../components/like-action-sheet.js';
import { publicLikeCount, hasLikeStatistics } from '../services/public-like-count.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';
@@ -1990,7 +1991,7 @@ function renderPostCard(post, {
<span class="channel-action-label">${isPending ? t('screens.channel_view.text_096') : t('screens.channel_view.text_097')}</span>
`;
likeButton.setAttribute('aria-pressed', String(isLiked));
setActionTitle(likeButton, isPending ? t('screens.channel_view.text_098') : `${isLiked ? t('screens.channel_view.text_099') : t('screens.channel_view.text_100')}, ${post.likesCount || 0}`);
setActionTitle(likeButton, isPending ? t('screens.channel_view.text_098') : `${isLiked ? t('screens.channel_view.text_099') : t('screens.channel_view.text_100')}, ${publicLikeCount(post)}`);
likeButton.disabled = isPending;
likeButton.addEventListener('click', async (event) => {
event.stopPropagation();
@@ -2009,8 +2010,8 @@ 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', t('screens.channel_view.text_150', { value1: Number(post.likesCount) || 0 }));
likesStatsButton.textContent = String(publicLikeCount(post));
likesStatsButton.setAttribute('aria-label', t('screens.channel_view.text_150', { value1: publicLikeCount(post) }));
likesStatsButton.addEventListener('click', (event) => {
event.stopPropagation();
void showLikeStatistics({
@@ -2158,8 +2159,8 @@ function renderPostCard(post, {
} });
});
// Четыре кнопки как в Threads: лайк, ответы, репост, поделиться.
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 (threadsLayout) actions.append(likeButton, ...(hasLikeStatistics(post) ? [likesStatsButton] : []), discussionButton, repostButton, shareButton);
else actions.append(likeButton, ...(hasLikeStatistics(post) ? [likesStatsButton] : []), shareButton, discussionButton);
actions.append(supportButton);
if (selector?.publicOrdinalUrlsAllowed && post.messageRef?.blockNumber != null) {
const streamRoute = makeShineChannelStreamRoute({