Delete "Settings Advanced" page

All items have been ported over
This commit is contained in:
infinite-persistence 2021-08-08 16:26:43 +08:00
parent 0c0448abef
commit 98f7dcd000
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
6 changed files with 6 additions and 160 deletions

View file

@ -67,9 +67,10 @@ const RepostNew = lazyImport(() => import('page/repost' /* webpackChunkName: "se
const RewardsPage = lazyImport(() => import('page/rewards' /* webpackChunkName: "secondary" */)); const RewardsPage = lazyImport(() => import('page/rewards' /* webpackChunkName: "secondary" */));
const RewardsVerifyPage = lazyImport(() => import('page/rewardsVerify' /* webpackChunkName: "secondary" */)); const RewardsVerifyPage = lazyImport(() => import('page/rewardsVerify' /* webpackChunkName: "secondary" */));
const SearchPage = lazyImport(() => import('page/search' /* webpackChunkName: "secondary" */)); const SearchPage = lazyImport(() => import('page/search' /* webpackChunkName: "secondary" */));
const SettingsAdvancedPage = lazyImport(() => import('page/settingsAdvanced' /* webpackChunkName: "secondary" */));
const SettingsStripeCard = lazyImport(() => import('page/settingsStripeCard' /* webpackChunkName: "secondary" */)); const SettingsStripeCard = lazyImport(() => import('page/settingsStripeCard' /* webpackChunkName: "secondary" */));
const SettingsStripeAccount = lazyImport(() => import('page/settingsStripeAccount' /* webpackChunkName: "secondary" */)); const SettingsStripeAccount = lazyImport(() =>
import('page/settingsStripeAccount' /* webpackChunkName: "secondary" */)
);
const SettingsCreatorPage = lazyImport(() => import('page/settingsCreator' /* webpackChunkName: "secondary" */)); const SettingsCreatorPage = lazyImport(() => import('page/settingsCreator' /* webpackChunkName: "secondary" */));
const SettingsNotificationsPage = lazyImport(() => const SettingsNotificationsPage = lazyImport(() =>
import('page/settingsNotifications' /* webpackChunkName: "secondary" */) import('page/settingsNotifications' /* webpackChunkName: "secondary" */)
@ -277,7 +278,6 @@ function AppRouter(props: Props) {
<Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} /> <Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} />
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} /> <Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} /> <Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
<Route path={`/$/${PAGES.SETTINGS_ADVANCED}`} exact component={SettingsAdvancedPage} />
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} /> <Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
<Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} /> <Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} />
<Route path={`/$/${PAGES.REPORT_CONTENT}`} exact component={ReportContentPage} /> <Route path={`/$/${PAGES.REPORT_CONTENT}`} exact component={ReportContentPage} />

View file

@ -41,7 +41,6 @@ exports.SETTINGS = 'settings';
exports.SETTINGS_STRIPE_CARD = 'settings/card'; exports.SETTINGS_STRIPE_CARD = 'settings/card';
exports.SETTINGS_STRIPE_ACCOUNT = 'settings/tip_account'; exports.SETTINGS_STRIPE_ACCOUNT = 'settings/tip_account';
exports.SETTINGS_NOTIFICATIONS = 'settings/notifications'; exports.SETTINGS_NOTIFICATIONS = 'settings/notifications';
exports.SETTINGS_ADVANCED = 'settings/advanced';
exports.SETTINGS_BLOCKED_MUTED = 'settings/block_and_mute'; exports.SETTINGS_BLOCKED_MUTED = 'settings/block_and_mute';
exports.SETTINGS_CREATOR = 'settings/creator'; exports.SETTINGS_CREATOR = 'settings/creator';
exports.SHOW = 'show'; exports.SHOW = 'show';

View file

@ -1,15 +1,12 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { doEnterSettingsPage, doExitSettingsPage } from 'redux/actions/settings'; import { doEnterSettingsPage, doExitSettingsPage } from 'redux/actions/settings';
import { makeSelectClientSetting, selectDaemonSettings } from 'redux/selectors/settings'; import { selectDaemonSettings } from 'redux/selectors/settings';
import { SETTINGS } from 'lbry-redux';
import SettingsPage from './view'; import SettingsPage from './view';
import { selectUserVerifiedEmail } from 'redux/selectors/user'; import { selectUserVerifiedEmail } from 'redux/selectors/user';
const select = (state) => ({ const select = (state) => ({
daemonSettings: selectDaemonSettings(state), daemonSettings: selectDaemonSettings(state),
isAuthenticated: selectUserVerifiedEmail(state), isAuthenticated: selectUserVerifiedEmail(state),
autoDownload: makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state),
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
}); });
const perform = (dispatch) => ({ const perform = (dispatch) => ({

View file

@ -8,15 +8,8 @@ import SettingAccount from 'component/settingAccount';
import SettingAppearance from 'component/settingAppearance'; import SettingAppearance from 'component/settingAppearance';
import SettingContent from 'component/settingContent'; import SettingContent from 'component/settingContent';
import SettingSystem from 'component/settingSystem'; import SettingSystem from 'component/settingSystem';
import Card from 'component/common/card';
import classnames from 'classnames';
import Yrbl from 'component/yrbl'; import Yrbl from 'component/yrbl';
type Price = {
currency: string,
amount: number,
};
type DaemonSettings = { type DaemonSettings = {
download_dir: string, download_dir: string,
share_usage_data: boolean, share_usage_data: boolean,
@ -25,9 +18,6 @@ type DaemonSettings = {
type Props = { type Props = {
daemonSettings: DaemonSettings, daemonSettings: DaemonSettings,
isAuthenticated: boolean, isAuthenticated: boolean,
instantPurchaseEnabled: boolean,
instantPurchaseMax: Price,
openModal: (string) => void,
enterSettings: () => void, enterSettings: () => void,
exitSettings: () => void, exitSettings: () => void,
}; };
@ -44,11 +34,7 @@ class SettingsPage extends React.PureComponent<Props> {
} }
render() { render() {
const { const { daemonSettings, isAuthenticated } = this.props;
daemonSettings,
isAuthenticated,
// autoDownload,
} = this.props;
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
const newStyle = true; const newStyle = true;
@ -88,27 +74,7 @@ class SettingsPage extends React.PureComponent<Props> {
<section className="card card--section"> <section className="card card--section">
<div className="card__title card__title--deprecated">{__('Failed to load settings.')}</div> <div className="card__title card__title--deprecated">{__('Failed to load settings.')}</div>
</section> </section>
) : ( ) : null}
<div className={classnames('card-stack', { 'card--disabled': IS_WEB && !isAuthenticated })}>
{(isAuthenticated || !IS_WEB) && (
<>
<Card
title={__('Advanced settings')}
actions={
<div className="section__actions">
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_ADVANCED}`}
/>
</div>
}
/>
</>
)}
</div>
)}
</Page> </Page>
); );
} }

View file

@ -1,26 +0,0 @@
import { connect } from 'react-redux';
import { doClearCache, doNotifyEncryptWallet, doNotifyDecryptWallet, doNotifyForgetPassword } from 'redux/actions/app';
import { selectAllowAnalytics } from 'redux/selectors/app';
import { doEnterSettingsPage, doExitSettingsPage } from 'redux/actions/settings';
import { makeSelectClientSetting, selectDaemonSettings } from 'redux/selectors/settings';
import { doWalletStatus, selectWalletIsEncrypted, SETTINGS } from 'lbry-redux';
import SettingsAdvancedPage from './view';
const select = (state) => ({
daemonSettings: selectDaemonSettings(state),
allowAnalytics: selectAllowAnalytics(state),
walletEncrypted: selectWalletIsEncrypted(state),
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
});
const perform = (dispatch) => ({
clearCache: () => dispatch(doClearCache()),
encryptWallet: () => dispatch(doNotifyEncryptWallet()),
decryptWallet: () => dispatch(doNotifyDecryptWallet()),
updateWalletStatus: () => dispatch(doWalletStatus()),
confirmForgetPassword: (modalProps) => dispatch(doNotifyForgetPassword(modalProps)),
enterSettings: () => dispatch(doEnterSettingsPage()),
exitSettings: () => dispatch(doExitSettingsPage()),
});
export default connect(select, perform)(SettingsAdvancedPage);

View file

@ -1,90 +0,0 @@
// @flow
import * as React from 'react';
import Page from 'component/page';
import Card from 'component/common/card';
type Price = {
currency: string,
amount: number,
};
type SetDaemonSettingArg = boolean | string | number | Price;
type DaemonSettings = {
download_dir: string,
share_usage_data: boolean,
max_key_fee?: Price,
max_connections_per_download?: number,
save_files: boolean,
save_blobs: boolean,
ffmpeg_path: string,
};
type Props = {
daemonSettings: DaemonSettings,
encryptWallet: () => void,
decryptWallet: () => void,
updateWalletStatus: () => void,
walletEncrypted: boolean,
confirmForgetPassword: ({}) => void,
syncEnabled: boolean,
enterSettings: () => void,
exitSettings: () => void,
};
type State = {
clearingCache: boolean,
};
class SettingsAdvancedPage extends React.PureComponent<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
clearingCache: false,
};
}
componentDidMount() {
const { enterSettings } = this.props;
enterSettings();
}
componentWillUnmount() {
const { exitSettings } = this.props;
exitSettings();
}
setDaemonSetting(name: string, value: ?SetDaemonSettingArg): void {
// this.props.setDaemonSetting(name, value);
}
render() {
const { daemonSettings } = this.props;
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
return (
<Page
noFooter
noSideNavigation
backout={{
title: __('Advanced settings'),
backLabel: __('Done'),
}}
className="card-stack"
>
{!IS_WEB && noDaemonSettings ? (
<section className="card card--section">
<div className="card__title card__title--deprecated">{__('Failed to load settings.')}</div>
</section>
) : (
<div>
</div>
)}
</Page>
);
}
}
export default SettingsAdvancedPage;