'use strict'; import React from 'react'; import UserStore from '../../stores/user_store'; import UserActions from '../../actions/user_actions'; import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; import Form from '../ascribe_forms/form'; import Property from '../ascribe_forms/property'; import InputCheckbox from '../ascribe_forms/input_checkbox'; import CollapsibleParagraph from '../ascribe_collapsible/collapsible_paragraph'; import ApiUrls from '../../constants/api_urls'; import AppConstants from '../../constants/application_constants'; import { getLangText } from '../../utils/lang_utils'; let AccountSettings = React.createClass({ getInitialState() { return UserStore.getState(); }, componentDidMount() { UserStore.listen(this.onChange); UserActions.fetchCurrentUser(); }, componentWillUnmount() { UserStore.unlisten(this.onChange); }, onChange(state) { this.setState(state); }, handleSuccess(){ UserActions.fetchCurrentUser(); let notification = new GlobalNotificationModel(getLangText('Settings succesfully updated'), 'success', 5000); GlobalNotificationActions.appendGlobalNotification(notification); }, getFormDataProfile(){ return {'email': this.state.currentUser.email}; }, render() { let content = ; let profile = null; if (this.state.currentUser.username) { content = (
); profile = ( ); } return (