Вернуть профиль пользователя

This commit is contained in:
2026-09-02 15:31:04 +03:00
parent 09c7f8541e
commit e5556f3706
2 changed files with 23 additions and 5 deletions
+8 -5
View File
@@ -58,8 +58,8 @@ function openProfileSheet(title, html) {
}); });
} }
function aboutSheetHtml(card) { function spiritualPathSheetHtml(card) {
return `<div class="user-profile-sheet-copy">${escapeHtml(card?.about || 'Не заполнено')}</div>`; return `<div class="user-profile-sheet-copy">${escapeHtml(card?.spiritualPath || 'Не заполнено')}</div>`;
} }
function contactsSheetHtml(card) { function contactsSheetHtml(card) {
@@ -193,6 +193,7 @@ export function render({ navigate, route, chrome }) {
.map((value) => String(value || '').trim()) .map((value) => String(value || '').trim())
.filter(Boolean) .filter(Boolean)
.join(' '); .join(' ');
const about = String(card.about || '').trim();
const title = header.querySelector('.page-title'); const title = header.querySelector('.page-title');
if (title) title.textContent = card.login; if (title) title.textContent = card.login;
@@ -208,6 +209,8 @@ export function render({ navigate, route, chrome }) {
${metricHtml({ kind: 'close_friends', label: 'Близкие друзья', value: stats.closeFriendsCount, positionClass: 'is-bottom-right' })} ${metricHtml({ kind: 'close_friends', label: 'Близкие друзья', value: stats.closeFriendsCount, positionClass: 'is-bottom-right' })}
</div> </div>
${about ? `<div class="user-profile-about-inline">${escapeHtml(about)}</div>` : ''}
<div class="user-profile-channel-metrics"> <div class="user-profile-channel-metrics">
${metricHtml({ kind: 'channels_following', label: 'Подписки', value: stats.followingChannelsCount, positionClass: 'is-channel-metric' })} ${metricHtml({ kind: 'channels_following', label: 'Подписки', value: stats.followingChannelsCount, positionClass: 'is-channel-metric' })}
${metricHtml({ kind: 'channels_owned', label: 'Каналы', value: stats.ownedPublicChannelsCount, positionClass: 'is-channel-metric' })} ${metricHtml({ kind: 'channels_owned', label: 'Каналы', value: stats.ownedPublicChannelsCount, positionClass: 'is-channel-metric' })}
@@ -230,7 +233,7 @@ export function render({ navigate, route, chrome }) {
</div>` : ''} </div>` : ''}
<div class="user-profile-detail-links"> <div class="user-profile-detail-links">
<button type="button" data-profile-detail="about">О себе</button> <button type="button" data-profile-detail="spiritual-path">Духовный путь</button>
<button type="button" data-profile-detail="contacts">Контакты</button> <button type="button" data-profile-detail="contacts">Контакты</button>
</div>`; </div>`;
@@ -265,8 +268,8 @@ export function render({ navigate, route, chrome }) {
} }
const detailButton = event.target.closest('[data-profile-detail]'); const detailButton = event.target.closest('[data-profile-detail]');
if (detailButton?.dataset.profileDetail === 'about') { if (detailButton?.dataset.profileDetail === 'spiritual-path') {
openProfileSheet('О себе', aboutSheetHtml(card)); openProfileSheet('Духовный путь', spiritualPathSheetHtml(card));
return; return;
} }
if (detailButton?.dataset.profileDetail === 'contacts') { if (detailButton?.dataset.profileDetail === 'contacts') {
+15
View File
@@ -9976,6 +9976,21 @@ body.chat-topbar-overlay .composer-slot > * {
font-weight: 800; font-weight: 800;
} }
.user-profile-about-inline {
width: min(86%, 340px);
margin: clamp(28px, 4.6vh, 36px) auto 0;
padding: 0;
border: 0;
background: transparent;
box-shadow: none;
color: rgba(225, 234, 248, 0.82);
font-size: 14px;
line-height: 1.5;
text-align: center;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.user-profile-metric { .user-profile-metric {
width: min(100%, 92px); width: min(100%, 92px);
min-width: 0; min-width: 0;