// @flow import * as PAGES from 'constants/pages'; import * as ICONS from 'constants/icons'; import * as React from 'react'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import Page from 'component/page'; import SettingAccount from 'component/settingAccount'; import SettingAppearance from 'component/settingAppearance'; import SettingContent from 'component/settingContent'; import SettingSystem from 'component/settingSystem'; import FileSelector from 'component/common/file-selector'; import Card from 'component/common/card'; import classnames from 'classnames'; import Yrbl from 'component/yrbl'; type Price = { currency: string, amount: number, }; type SetDaemonSettingArg = boolean | string | number; type DaemonSettings = { download_dir: string, share_usage_data: boolean, }; type Props = { setDaemonSetting: (string, ?SetDaemonSettingArg) => void, clearDaemonSetting: (string) => void, toggle3PAnalytics: (boolean) => void, daemonSettings: DaemonSettings, allowAnalytics: boolean, isAuthenticated: boolean, instantPurchaseEnabled: boolean, instantPurchaseMax: Price, openModal: (string) => void, enterSettings: () => void, exitSettings: () => void, }; class SettingsPage extends React.PureComponent { componentDidMount() { const { enterSettings } = this.props; enterSettings(); } componentWillUnmount() { const { exitSettings } = this.props; exitSettings(); } setDaemonSetting(name: string, value: ?SetDaemonSettingArg): void { this.props.setDaemonSetting(name, value); } clearDaemonSetting(name: string): void { this.props.clearDaemonSetting(name); } render() { const { daemonSettings, allowAnalytics, isAuthenticated, // autoDownload, setDaemonSetting, toggle3PAnalytics, } = this.props; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; const newStyle = true; return newStyle ? ( ) : ( {!isAuthenticated && IS_WEB && (
} /> )} {!IS_WEB && noDaemonSettings ? (
{__('Failed to load settings.')}
) : (
{/* @if TARGET='app' */} { setDaemonSetting('download_dir', newDirectory.path); }} />

{__('LBRY downloads will be saved here.')}

} /> {/* @endif */} {/* @if TARGET='app' */} {__( `This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you sign in to lbry.tv)` )}{' '}
} /> )} )}
); } } export default SettingsPage;