Добавить отключаемое предупреждение о звонках в настройках

This commit is contained in:
AidarKC
2026-12-03 15:03:32 +03:00
parent d420ae5400
commit 30a58299a6
8 changed files with 50 additions and 8 deletions
@@ -1,5 +1,6 @@
import { t, th } from '../i18n/index.js';
import { createTopBar } from '../components/topbar.js';
import { getShowCallWarning, setShowCallWarning } from '../services/call-warning-preference.js';
import { getShowPublicHistoryWarning, setShowPublicHistoryWarning } from '../services/public-history-consent.js';
export const pageMeta = { id: 'application-settings-view', get title() { return t('screens.application_settings_view.text_001'); } };
@@ -26,6 +27,19 @@ export function render({ navigate, chrome }) {
input.checked = getShowPublicHistoryWarning();
input.addEventListener('change', () => setShowPublicHistoryWarning(input.checked));
section.append(row);
const callRow = document.createElement('label');
callRow.className = 'nav-row nav-row--switch';
callRow.innerHTML = `
<span class="nav-row__text">
<span class="nav-row__label">${th('screens.application_settings_view.call_warning')}</span>
<span class="nav-row__hint">${th('screens.application_settings_view.call_hint')}</span>
</span>
<input class="switch" type="checkbox" />
`;
const callInput = callRow.querySelector('input');
callInput.checked = getShowCallWarning();
callInput.addEventListener('change', () => setShowCallWarning(callInput.checked));
section.append(callRow);
screen.append(section);
return screen;
}