UI: правки личного чата и настроек

This commit is contained in:
AidarKC
2026-07-22 18:59:09 +04:00
parent f640451257
commit af62b51ef5
5 changed files with 88 additions and 48 deletions
+7 -1
View File
@@ -6,6 +6,7 @@ export function renderHeader({ title, leftAction, leftLabel = '', rightActions =
left.className = 'header-left';
if (leftAction) {
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'icon-btn';
btn.textContent = leftAction.label;
btn.addEventListener('click', leftAction.onClick);
@@ -26,10 +27,15 @@ export function renderHeader({ title, leftAction, leftLabel = '', rightActions =
right.className = 'header-actions';
rightActions.forEach((action) => {
const btn = document.createElement('button');
btn.type = 'button';
btn.className = `icon-btn${action.className ? ` ${action.className}` : ''}`;
btn.textContent = action.label;
if (action.title) btn.title = action.title;
if (action.ariaLabel) btn.setAttribute('aria-label', action.ariaLabel);
if (action.iconNode instanceof Node) {
btn.append(action.iconNode);
} else {
btn.textContent = action.label;
}
btn.addEventListener('click', action.onClick);
right.append(btn);
});