import React from "react"; // import Scrollchor from 'react-scrollchor'; import { Link, withRouter } from "react-router-dom"; import { connect } from "react-redux"; import Button from "../button"; const header = props => { const liArr = [ { path: "/", id: 1, text: "Главная", hideWhenAuth:false}, { path: "/doctors", id: 2, text: "Специалисты", hideWhenAuth:false }, { path: "/services", id: 3, text: "Услуги", hideWhenAuth:false}, { path: "/reviews", id: 4, text: "Отзывы", hideWhenAuth:false }, { path: "/auth", id: 5, text: "Войти", hideWhenAuth:true // Object.keys(props.user).length > 0 ? // props.user.role === "Admin" ? "Admin" // : props.user.role === "Doctor" // ? "Doctor" // : "Logout" // : "Войти" } ]; return }; const mapStateToProps = state => ({ user: state.auth.user }); export default connect(mapStateToProps)(withRouter(header));