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 (
Помогу выбрать новый автомобиль
{ company.manager_fio }
{ company.manager_jobtitle }