import React, {Component} from 'react'; import {connect} from 'react-redux'; import {Container, Row, Col} from 'reactstrap'; import ProfileEditContainer from './ProfileEditContainer.jsx'; import CompanyEditContainer from './CompanyEditContainer.jsx'; import ProfileShowContainer from './ProfileShowContainer.jsx'; import ProfileAddressesContainer from './ProfileAddressesContainer.jsx'; import BillingAddressesContainer from './BillingAddressesContainer.jsx'; import ChangePasswordContainer from './ChangePasswordContainer.jsx'; import WiaasBox from '../../mainComponents/box/WiaasBox.jsx'; import {fetchProfileInfo, fetchCountries} from '../../actions/profileSettings/profileSettingsActions'; import './style/ProfieSettingsContainer.css'; class ProfileSettingsContainer extends Component { componentDidMount(){ this.props.dispatch(fetchProfileInfo(this.props.userInfo.wiaas_id_user)); this.props.dispatch(fetchCountries()); } render() { const {profileInfo, isLoading} = this.props; return ( { isLoading &&
} { (profileInfo && !isLoading) && { profileInfo.isCompanyAdmin === 1 && } }
); } } const mapStateToProps = (state) => ({ profileInfo: state.profileSettingsReducer.profileInfo, isLoading: state.profileSettingsReducer.isLoading, userInfo: state.auth.userInfo }); export default connect(mapStateToProps)(ProfileSettingsContainer);