import React, {Component} from 'react'; import {connect} from 'react-redux'; import {Row, Col, Form, FormGroup, Label, Input, Button} from 'reactstrap'; import {saveCompanyInfo} from '../../actions/profileSettings/profileSettingsActions'; import {profileTexts} from '../../constants/profileSettingsConstants'; class CompanyEditContainer extends Component { constructor(props){ super(props); const profile = this.props.profileInfo; this.state = { idCompany: profile.idCompany, vatCode: profile.vatCode, companyName: profile.companyName }; this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); } handleChange(event) { const field = event.target.name; const profile = {}; profile[field] = event.target.value; return this.setState(profile); } handleSubmit(event) { this.props.dispatch(saveCompanyInfo(this.props.idUser, this.state)); event.preventDefault(); } render() { const {companyName, vatCode} = this.state; return (
{profileTexts.labels.COMPANY_EDIT_TITLE}
); } } export default connect()(CompanyEditContainer);