// @flow import * as PAGES from 'constants/pages'; import * as ICONS from 'constants/icons'; import * as React from 'react'; import classnames from 'classnames'; 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 SettingUnauthenticated from 'component/settingUnauthenticated'; import Yrbl from 'component/yrbl'; type DaemonSettings = { download_dir: string, share_usage_data: boolean, }; type Props = { daemonSettings: DaemonSettings, isAuthenticated: boolean, enterSettings: () => void, exitSettings: () => void, }; class SettingsPage extends React.PureComponent { componentDidMount() { const { enterSettings } = this.props; enterSettings(); } componentWillUnmount() { const { exitSettings } = this.props; exitSettings(); } render() { const { daemonSettings, isAuthenticated } = this.props; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; return ( {!isAuthenticated && IS_WEB && ( <>
} /> )} {!IS_WEB && noDaemonSettings ? (
{__('Failed to load settings.')}
) : (
)}
); } } export default SettingsPage;