import React from 'react'; import { connect } from 'react-redux'; import { Button, Input, Form } from 'UI'; import { updateAccount, updateClient } from 'Duck/user'; import styles from './profileSettings.module.css'; @connect( (state) => ({ accountName: state.getIn(['user', 'account', 'name']), organizationName: state.getIn(['user', 'account', 'tenantName']), loading: state.getIn(['user', 'updateAccountRequest', 'loading']) || state.getIn(['user', 'putClientRequest', 'loading']), }), { updateAccount, updateClient, } ) export default class Settings extends React.PureComponent { state = { accountName: this.props.accountName, organizationName: this.props.organizationName, }; onChange = ({ target: { value, name } }) => { this.setState({ changed: true, [name]: value }); }; handleSubmit = (e) => { e.preventDefault(); const { accountName, organizationName } = this.state; this.props .updateClient({ name: accountName, tenantName: organizationName }) .then(() => this.setState({ changed: false })); }; render() { const { loading } = this.props; const { accountName, organizationName, changed, copied } = this.state; return (