import React from 'react'; import classNames from 'classnames'; import { LeftPane } from '../LeftPane'; import { SessionButton, SessionButtonColor, SessionButtonType, } from './SessionButton'; import { SessionIcon, SessionIconSize, SessionIconType, } from './icon'; export enum SessionSettingCategory { Privacy = 'privacy', Notifications = 'notifications', Devices = 'devices', } export interface Props { } export interface State { settingCategory: SessionSettingCategory; } export class LeftPaneSettingSection extends React.Component { public constructor(props: Props) { super(props); this.state = { settingCategory: SessionSettingCategory.Privacy, }; this.setCategory = this.setCategory.bind(this); this.renderRows = this.renderRows.bind(this); } public render(): JSX.Element { return (
{this.renderHeader()} {this.renderSettings()}
); } public renderHeader(): JSX.Element | undefined { const labels = [window.i18n('settingsHeader')]; return LeftPane.RENDER_HEADER( labels, null, undefined, undefined, undefined, ); } public renderRows () { const categories = this.getCategories(); return ( <> {categories.map((item) => (
this.setCategory(item.id)} >
{ item.title }
{item.description }
{ item.id === this.state.settingCategory && }
))} ); } public renderCategories() { return (
{this.renderRows()}
) } public renderSettings(): JSX.Element { return (
{this.renderCategories()} {this.renderBottomButtons()}
); } public renderBottomButtons(): JSX.Element { const deleteAccount = window.i18n('deleteAccount'); const showSeed = window.i18n('showSeed'); return (
); } public getCategories(){ return [ { id: SessionSettingCategory.Privacy, title: 'Privacy', description: 'Privacy description', }, { id: SessionSettingCategory.Notifications, title: 'Notifications', description: "Choose what you're notified about." }, { id: SessionSettingCategory.Devices, title: 'Linked Devices', description: "Managed linked devices." } ]; } public setCategory(category: SessionSettingCategory) { this.setState({ settingCategory: category, }); } }