UI: общий верхний и нижний тулбар

This commit is contained in:
AidarKC
2026-08-11 15:22:10 +04:00
parent 628a970e6f
commit 801a4697ea
12 changed files with 218 additions and 36 deletions
+5 -4
View File
@@ -785,7 +785,7 @@ function setChatKeyboardOpen(isOpen) {
document.body.classList.toggle('chat-keyboard-open', !!isOpen);
}
export function render({ navigate, route }) {
export function render({ navigate, route, chrome }) {
const routeChatId = route.params.chatId || 'u1';
const chatId = normalizeDmChatId(routeChatId) || 'u1';
const contact = directMessages.find((d) => normalizeDmChatId(d.id) === chatId) || {
@@ -871,7 +871,7 @@ export function render({ navigate, route }) {
const log = document.createElement('div');
log.className = 'messages-log dm-messages-log';
screen.append(
chrome?.setTopbar(
renderHeader({
title: `Чат с ${contact.name}`,
leftAction: { label: '←', onClick: () => navigate('messages-list') },
@@ -941,7 +941,7 @@ export function render({ navigate, route }) {
},
},
],
})
}),
);
if (!isKnownContact) {
@@ -1490,7 +1490,8 @@ export function render({ navigate, route }) {
window.visualViewport?.addEventListener('resize', syncKeyboardUi);
window.addEventListener('resize', syncKeyboardUi);
wrap.append(historyLoader, log, form);
chrome?.setComposer(form);
wrap.append(historyLoader, log);
screen.append(wrap);
renderLog(log, chatId, {
onOpenActions: handleOpenActions,