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