'use strict'; import React from 'react'; import UserActions from '../../actions/user_actions'; import AccountSettings from './account_settings'; import BitcoinWalletSettings from './bitcoin_wallet_settings'; import APISettings from './api_settings'; import WebhookSettings from './webhook_settings'; import AclProxy from '../acl_proxy'; import { mergeOptions } from '../../utils/general_utils'; import { getLangText } from '../../utils/lang_utils'; import { setDocumentTitle } from '../../utils/dom_utils'; let SettingsContainer = React.createClass({ propTypes: { children: React.PropTypes.oneOfType([ React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.element ]), // Provided from AscribeApp currentUser: React.PropTypes.object.isRequired, whitelabel: React.PropTypes.object.isRequired, // Provided from router location: React.PropTypes.object }, loadUser(invalidateCache) { UserActions.fetchCurrentUser(invalidateCache); }, render() { const { children, currentUser, whitelabel } = this.props; setDocumentTitle(getLangText('Account settings')); if (currentUser.username) { return (
{children}
); } return null; } }); export default SettingsContainer;