SHA256
UI: правки личного чата и настроек
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user