index.js 882 B

12345678910111213141516171819202122232425262728293031323334
  1. import React from 'react';
  2. import { Link } from 'react-router-dom';
  3. import Assets from '@src/components/Assets';
  4. import Button from '../Button';
  5. import './index.less';
  6. function Header(props) {
  7. const { tabs = [], active } = props;
  8. return (
  9. <div id="header">
  10. <div className="body">
  11. <div className="left">
  12. <Assets name="logo" svg />
  13. </div>
  14. <div className="center">
  15. <div className="tabs">
  16. {tabs.map(item => {
  17. return (
  18. <Link to={item.path}>
  19. <div className={`tab ${active === item.key ? 'active' : ''}`}>{item.name}</div>
  20. </Link>
  21. );
  22. })}
  23. </div>
  24. </div>
  25. <div className="right">
  26. <Button>登录</Button>
  27. </div>
  28. </div>
  29. </div>
  30. );
  31. }
  32. Header.propTypes = {};
  33. export default Header;