import './Header.scss'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { Icon, Layout, Menu} from 'antd'
import loginTypeAction from '../../actions/login';
const { Header } = Layout;
const ToolUser = (props)=> (
);
ToolUser.propTypes={
user:PropTypes.string,
msg:PropTypes.string
};
const ToolGuest = (props)=> (
- props.onLogin(e)}>登录
- props.onReg(e)}>注册
);
ToolGuest.propTypes={
onLogin:PropTypes.func,
onReg:PropTypes.func
}
class HeaderCom extends Component {
constructor(props) {
super(props);
}
handleLogin = (e) => {
e.preventDefault();
this.props.loginTypeAction("1");
}
handleReg = (e)=>{
e.preventDefault();
this.props.loginTypeAction("2");
}
render () {
const { login, user, msg } = this.props;
return (
YAPI
{login?:''}
)
}
}
HeaderCom.propTypes={
user: PropTypes.string,
msg: PropTypes.string,
login:PropTypes.bool,
loginTypeAction:PropTypes.func
};
export default connect(
(state) => {
return{
user: state.login.userName,
msg: "暂无消息",
login:state.login.isLogin
}
},
{loginTypeAction}
)(HeaderCom)