'use strict'; import React from 'react'; import { Menu } from 'antd'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import darkVars from '$themes/dark.json'; import lightVars from '$themes/light.json'; import exampleVars from '$themes/example.json' import styles from './style.css'; import { MenuFoldOutlined, MenuUnfoldOutlined, UserOutlined, LogoutOutlined } from '@ant-design/icons'; const themeMap = { light: lightVars, dark: darkVars, example: exampleVars } const Header = props => { const { dispatch, history, user, pathname, toggleCollapsed, collapsed, actions } = props const handelClick = item => { if (item.key == 'logout') { dispatch(actions.auth.logout(user)); history.push(`/signin`); } } let current = pathname; console.log(pathname); if (pathname == '/' || pathname == '') { current = 'default'; } else if (pathname.charAt(0) == '/') { current = pathname.substring(1); } if (current.indexOf('/') != -1) { current = current.substring(0, current.indexOf('/')); } return (