import React from "react"; import { connect } from "react-redux"; import { SpinnerCircular } from 'spinners-react'; import { getImage } from '../../../actions'; class Manager extends React.Component { constructor(props) { super(props); this.state = { company: {}, photo: undefined, loading: true, full: false, }; } static getDerivedStateFromProps(nextProps, prevState) { return { company: nextProps.company, }; } componentDidMount() { const { company } = this.state; if(company.manager_photo !== undefined && company.manager_photo !== null && company.manager_photo !== "") { getImage({ id: company.manager_photo }) .then((result) => { this.setState({ photo: result, loading: false }); }) } else { this.setState({ photo: null, loading: false }); } } _handle_onFull = () => { this.setState({ full: this.state.full ? false : true }); } render() { const { company, loading, photo, full, } = this.state; return (
{ loading ? ( ) : ( { ) }

Помогу выбрать новый автомобиль

{ company.manager_fio }

{ company.manager_jobtitle }

{ company.manager_email } { company.manager_mobilephone !== undefined && company.manager_mobilephone !== null && company.manager_mobilephone !== "" && ( { company.manager_mobilephone } ) } { company.manager_telegram !== undefined && company.manager_telegram !== null && company.manager_telegram !== "" && ( { `@${ company.manager_telegram.replace("@", "")}` } ) }
{ loading ? ( ) : ( { ) }
) } } function mapStateToProps(state, ownProps) { return { company: state.company, } } export default connect(mapStateToProps)(Manager);