mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor: remove broken anon mode feature
- delete the anon mode hook/store and stop wiring publish flows through alternate signers - strip the settings UI, avatar warning, reply indicators, and FAQ text that referenced the toggle - drop the anon mode translation keys via scripts/update-translations.js
This commit is contained in:
@@ -54,15 +54,3 @@
|
||||
margin: 2px 0 10px 0;
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
.anonMode {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.anonMode label {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.anonMode input[type="checkbox"] {
|
||||
margin-right: 3px;
|
||||
}
|
||||
@@ -3,27 +3,11 @@ import { useTranslation } from 'react-i18next';
|
||||
import { createAccount, deleteAccount, exportAccount, importAccount, setAccount, setActiveAccount, useAccount, useAccounts } from '@plebbit/plebbit-react-hooks';
|
||||
import stringify from 'json-stringify-pretty-compact';
|
||||
import styles from './account-settings.module.css';
|
||||
import useAnonModeStore from '../../../stores/use-anon-mode-store';
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
|
||||
const isAndroid = Capacitor.getPlatform() === 'android';
|
||||
|
||||
const AnonMode = () => {
|
||||
const { t } = useTranslation();
|
||||
const anonMode = useAnonModeStore((state) => state.anonMode);
|
||||
const setAnonMode = useAnonModeStore((state) => state.setAnonMode);
|
||||
|
||||
return (
|
||||
<div className={styles.anonMode}>
|
||||
<label>
|
||||
<input type='checkbox' checked={anonMode} onChange={(e) => setAnonMode(e.target.checked)} /> {t('anon_mode')}
|
||||
</label>
|
||||
<span className={styles.settingTip}>{t('anon_mode_description')}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const AccountSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
@@ -236,7 +220,7 @@ const AccountSettings = () => {
|
||||
<div></div>
|
||||
<textarea value={text} onChange={(e) => setText(e.target.value)} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
||||
<div>
|
||||
<button onClick={saveAccount}>{t('save_changes')}</button> <button onClick={() => setText(accountJson)}>{t('reset_changes')}</button> <AnonMode />
|
||||
<button onClick={saveAccount}>{t('save_changes')}</button> <button onClick={() => setText(accountJson)}>{t('reset_changes')}</button>
|
||||
<button className={styles.deleteAccount} onClick={() => _deleteAccount(account?.name)}>
|
||||
{t('delete_account')}
|
||||
</button>
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.warning {
|
||||
font-size: 0.8em;
|
||||
padding: 0 10px 10px 10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.avatar img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
|
||||
@@ -4,7 +4,6 @@ import { setAccount, useAccount, useAuthorAvatar } from '@plebbit/plebbit-react-
|
||||
import styles from './avatar-settings.module.css';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import LoadingEllipsis from '../../loading-ellipsis';
|
||||
import useAnonMode from '../../../hooks/use-anon-mode';
|
||||
|
||||
const AvatarPreview = ({ avatar }: any) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -115,11 +114,8 @@ const AvatarSettings = () => {
|
||||
alert(`saved`);
|
||||
};
|
||||
|
||||
const { anonMode } = useAnonMode();
|
||||
|
||||
return (
|
||||
<div className={styles.avatarSettings}>
|
||||
{anonMode && <span className={styles.warning}>{t('avatar_warning')}</span>}
|
||||
<AvatarPreview avatar={avatar} />
|
||||
<div className={styles.avatarSettingsForm}>
|
||||
<div className={styles.avatarSettingInput}>
|
||||
|
||||
Reference in New Issue
Block a user