// @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, myChannelUrls: ?Array, user: User, }; 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, myChannelUrls, user, } = this.props; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; const newStyle = true; return newStyle ? ( ) : ( {/* @if TARGET='web' */} {user && user.fiat_enabled && (