import React from 'react';
import { connect } from 'umi';
import LoginMobileComponent from '../../../mobile/login/LoginMobile';

function LoginMobile({
  dispatch, app, content, loginMobile,
}) {
  const LoginProps = {
    app,
    content,
    onLogin: userlogin,
    dispatch,
    loginMobile,
  };

  function userlogin(param) {
    dispatch({
      type: 'login/login',
      payload: { ...param, dispatch },
    });
  }

  return (
    <div>
      <LoginMobileComponent {...LoginProps} />
    </div>
  );
}

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