|
|
@ -12,8 +12,8 @@ import {
|
|
|
|
} from '../../state/ducks/section';
|
|
|
|
} from '../../state/ducks/section';
|
|
|
|
import { getFocusedSettingsSection } from '../../state/selectors/section';
|
|
|
|
import { getFocusedSettingsSection } from '../../state/selectors/section';
|
|
|
|
import { SessionIcon } from '../icon';
|
|
|
|
import { SessionIcon } from '../icon';
|
|
|
|
import { SessionSettingCategory } from '../settings/SessionSettings';
|
|
|
|
|
|
|
|
import { LeftPaneSectionHeader } from './LeftPaneSectionHeader';
|
|
|
|
import { LeftPaneSectionHeader } from './LeftPaneSectionHeader';
|
|
|
|
|
|
|
|
import type { SessionSettingCategory } from '../../types/SessionSettingCategory';
|
|
|
|
|
|
|
|
|
|
|
|
const StyledSettingsSectionTitle = styled.strong`
|
|
|
|
const StyledSettingsSectionTitle = styled.strong`
|
|
|
|
font-family: var(--font-accent), var(--font-default);
|
|
|
|
font-family: var(--font-accent), var(--font-default);
|
|
|
@ -42,42 +42,42 @@ const StyledSettingsListItem = styled.div<{ active: boolean }>`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
const getCategories = () => {
|
|
|
|
const getCategories = (): Array<{ id: SessionSettingCategory; title: string }> => {
|
|
|
|
return [
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.Privacy,
|
|
|
|
id: 'privacy' as const,
|
|
|
|
title: window.i18n('privacySettingsTitle'),
|
|
|
|
title: window.i18n('privacySettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.Notifications,
|
|
|
|
id: 'notifications' as const,
|
|
|
|
title: window.i18n('notificationsSettingsTitle'),
|
|
|
|
title: window.i18n('notificationsSettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.Conversations,
|
|
|
|
id: 'conversations' as const,
|
|
|
|
title: window.i18n('conversationsSettingsTitle'),
|
|
|
|
title: window.i18n('conversationsSettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.MessageRequests,
|
|
|
|
id: 'messageRequests' as const,
|
|
|
|
title: window.i18n('openMessageRequestInbox'),
|
|
|
|
title: window.i18n('openMessageRequestInbox'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.Appearance,
|
|
|
|
id: 'appearance' as const,
|
|
|
|
title: window.i18n('appearanceSettingsTitle'),
|
|
|
|
title: window.i18n('appearanceSettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.Permissions,
|
|
|
|
id: 'permissions',
|
|
|
|
title: window.i18n('permissionsSettingsTitle'),
|
|
|
|
title: window.i18n('permissionsSettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.Help,
|
|
|
|
id: 'help' as const,
|
|
|
|
title: window.i18n('helpSettingsTitle'),
|
|
|
|
title: window.i18n('helpSettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.RecoveryPhrase,
|
|
|
|
id: 'recoveryPhrase' as const,
|
|
|
|
title: window.i18n('recoveryPhrase'),
|
|
|
|
title: window.i18n('recoveryPhrase'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id: SessionSettingCategory.ClearData,
|
|
|
|
id: 'ClearData' as const,
|
|
|
|
title: window.i18n('clearDataSettingsTitle'),
|
|
|
|
title: window.i18n('clearDataSettingsTitle'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
];
|
|
|
@ -93,7 +93,7 @@ const LeftPaneSettingsCategoryRow = (props: {
|
|
|
|
|
|
|
|
|
|
|
|
const dataTestId = `${title.toLowerCase().replace(' ', '-')}-settings-menu-item`;
|
|
|
|
const dataTestId = `${title.toLowerCase().replace(' ', '-')}-settings-menu-item`;
|
|
|
|
|
|
|
|
|
|
|
|
const isClearData = id === SessionSettingCategory.ClearData;
|
|
|
|
const isClearData = id === 'ClearData';
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<StyledSettingsListItem
|
|
|
|
<StyledSettingsListItem
|
|
|
@ -103,15 +103,15 @@ const LeftPaneSettingsCategoryRow = (props: {
|
|
|
|
role="link"
|
|
|
|
role="link"
|
|
|
|
onClick={() => {
|
|
|
|
onClick={() => {
|
|
|
|
switch (id) {
|
|
|
|
switch (id) {
|
|
|
|
case SessionSettingCategory.MessageRequests:
|
|
|
|
case 'messageRequests':
|
|
|
|
dispatch(showLeftPaneSection(SectionType.Message));
|
|
|
|
dispatch(showLeftPaneSection(SectionType.Message));
|
|
|
|
dispatch(setLeftOverlayMode('message-requests'));
|
|
|
|
dispatch(setLeftOverlayMode('message-requests'));
|
|
|
|
dispatch(resetConversationExternal());
|
|
|
|
dispatch(resetConversationExternal());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SessionSettingCategory.RecoveryPhrase:
|
|
|
|
case 'recoveryPhrase':
|
|
|
|
dispatch(recoveryPhraseModal({}));
|
|
|
|
dispatch(recoveryPhraseModal({}));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SessionSettingCategory.ClearData:
|
|
|
|
case 'ClearData':
|
|
|
|
dispatch(updateDeleteAccountModal({}));
|
|
|
|
dispatch(updateDeleteAccountModal({}));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|