import React, { useState } from 'react';
import PropTypes from 'prop-types';
import './Settings.scss';
import initMatrix from '../../../client/initMatrix';
import cons from '../../../client/state/cons';
import settings from '../../../client/state/settings';
import { toggleMarkdown, toggleMembershipEvents, toggleNickAvatarEvents } from '../../../client/action/settings';
import Text from '../../atoms/text/Text';
import IconButton from '../../atoms/button/IconButton';
import Button from '../../atoms/button/Button';
import Toggle from '../../atoms/button/Toggle';
import SegmentedControls from '../../atoms/segmented-controls/SegmentedControls';
import PopupWindow, { PWContentSelector } from '../../molecules/popup-window/PopupWindow';
import SettingTile from '../../molecules/setting-tile/SettingTile';
import ImportE2ERoomKeys from '../../molecules/import-export-e2e-room-keys/ImportE2ERoomKeys';
import ExportE2ERoomKeys from '../../molecules/import-export-e2e-room-keys/ExportE2ERoomKeys';
import ProfileEditor from '../profile-editor/ProfileEditor';
import SettingsIC from '../../../../public/res/ic/outlined/settings.svg';
import SunIC from '../../../../public/res/ic/outlined/sun.svg';
import LockIC from '../../../../public/res/ic/outlined/lock.svg';
import InfoIC from '../../../../public/res/ic/outlined/info.svg';
import CrossIC from '../../../../public/res/ic/outlined/cross.svg';
import CinnySVG from '../../../../public/res/svg/cinny.svg';
function GeneralSection() {
return (
settings.setTheme(index)}
/>
)}
/>
{ toggleMarkdown(); updateState({}); }}
/>
)}
content={Format messages with markdown syntax before sending.}
/>
{ toggleMembershipEvents(); updateState({}); }}
/>
)}
content={Hide membership change messages from room timeline. (Join, Leave, Invite, Kick and Ban)}
/>
{ toggleNickAvatarEvents(); updateState({}); }}
/>
)}
content={Hide nick and avatar change messages from room timeline.}
/>
);
}
function SecuritySection() {
return (
Use this device ID-key combo to verify or manage this session from Element client.}
/>
Export end-to-end encryption room keys to decrypt old messages in other session. In order to encrypt keys you need to set a password, which will be used while importing.
>
)}
/>
{'To decrypt older messages, Export E2EE room keys from Element (Settings > Security & Privacy > Encryption > Cryptography) and import them here. Imported keys are encrypted so you\'ll have to enter the password you set in order to decrypt it.'}
>
)}
/>
);
}
function AboutSection() {
return (
Cinny
{`v${cons.version}`}Yet another matrix client