SHA256
Вернуть профиль пользователя
This commit is contained in:
@@ -58,8 +58,8 @@ function openProfileSheet(title, html) {
|
||||
});
|
||||
}
|
||||
|
||||
function aboutSheetHtml(card) {
|
||||
return `<div class="user-profile-sheet-copy">${escapeHtml(card?.about || 'Не заполнено')}</div>`;
|
||||
function spiritualPathSheetHtml(card) {
|
||||
return `<div class="user-profile-sheet-copy">${escapeHtml(card?.spiritualPath || 'Не заполнено')}</div>`;
|
||||
}
|
||||
|
||||
function contactsSheetHtml(card) {
|
||||
@@ -193,6 +193,7 @@ export function render({ navigate, route, chrome }) {
|
||||
.map((value) => String(value || '').trim())
|
||||
.filter(Boolean)
|
||||
.join(' ');
|
||||
const about = String(card.about || '').trim();
|
||||
|
||||
const title = header.querySelector('.page-title');
|
||||
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' })}
|
||||
</div>
|
||||
|
||||
${about ? `<div class="user-profile-about-inline">${escapeHtml(about)}</div>` : ''}
|
||||
|
||||
<div class="user-profile-channel-metrics">
|
||||
${metricHtml({ kind: 'channels_following', label: 'Подписки', value: stats.followingChannelsCount, 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 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>
|
||||
</div>`;
|
||||
|
||||
@@ -265,8 +268,8 @@ export function render({ navigate, route, chrome }) {
|
||||
}
|
||||
|
||||
const detailButton = event.target.closest('[data-profile-detail]');
|
||||
if (detailButton?.dataset.profileDetail === 'about') {
|
||||
openProfileSheet('О себе', aboutSheetHtml(card));
|
||||
if (detailButton?.dataset.profileDetail === 'spiritual-path') {
|
||||
openProfileSheet('Духовный путь', spiritualPathSheetHtml(card));
|
||||
return;
|
||||
}
|
||||
if (detailButton?.dataset.profileDetail === 'contacts') {
|
||||
|
||||
Reference in New Issue
Block a user