ContactsInfoMobile.js 1.11 KB
import React from 'react';
import { connect } from 'umi';
import ContactsInfoMobileComponent from '../../../mobile/common/ContactsInfoMobile';
import * as commonUtils from '../../../utils/utils';


function ContactsInfoMobile({
  dispatch, app, content, location, sModelsId, sModelType,
}) {
  function removePane(changePanes, currentPane) {
    dispatch({ type: 'app/removePane', payload: { changePanes, currentPane } });
  }

  // const sParam = JSON.parse(location.state.sParam);
  let sParam = {};
  if (location.state.sParam) {
    sParam = commonUtils.convertStrToObj(location.state.sParam);
  } else {
    sParam = commonUtils.convertStrToObj(location.state);
  }
  const ContactsInfoMobileProps = {
    app,
    content,
    dispatch,
    sModelsId,
    sModelType,
    personPic: sParam.personPic,
    formRoute: '/contactsInfo',
    peopleInfosId: sParam.sId,
    peopleInfoData: sParam.slaveData,
    onRemovePane: removePane,
  };
  return (
    <ContactsInfoMobileComponent {...ContactsInfoMobileProps} />
  );
}

export default connect(({ routing, app, content }) =>
  ({ routing, app, content }))(ContactsInfoMobile);