|
@ -1,14 +1,19 @@ |
|
|
"use strict"; |
|
|
"use strict"; |
|
|
import React from "react"; |
|
|
import React, { useState, useEffect } from 'react'; |
|
|
import { connect } from "react-redux"; |
|
|
import { connect } from "react-redux"; |
|
|
import { SplitButtonGroup, Dropdown, Button, Nav, Avatar } from '@douyinfe/semi-ui'; |
|
|
import { SplitButtonGroup, Dropdown, Button, Nav, Avatar } from '@douyinfe/semi-ui'; |
|
|
import { IconTreeTriangleDown } from '@douyinfe/semi-icons'; |
|
|
import { IconTreeTriangleDown } from '@douyinfe/semi-icons'; |
|
|
import { headerItems } from './contant'; |
|
|
import { headerItemsFun } from './contant'; |
|
|
import "./index.less"; |
|
|
import "./index.less"; |
|
|
|
|
|
|
|
|
const Header = (props) => { |
|
|
const Header = (props) => { |
|
|
const { dispatch, history, user, actions, socket, tochange } = props; |
|
|
const { dispatch, history, user, actions, socket, tochange } = props; |
|
|
|
|
|
const [allItems, setAllItems] = useState([]) |
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
const headerItems = headerItemsFun(); |
|
|
|
|
|
if (headerItems) |
|
|
|
|
|
setAllItems(headerItems); |
|
|
|
|
|
}, [user && user.authorized]) |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<div id="top-slider"> |
|
|
<div id="top-slider"> |
|
@ -59,7 +64,7 @@ const Header = (props) => { |
|
|
}} |
|
|
}} |
|
|
footer={ |
|
|
footer={ |
|
|
<> |
|
|
<> |
|
|
{headerItems.map((item, index) => { |
|
|
{allItems.map((item, index) => { |
|
|
if (item.hasOwnProperty('items')) { |
|
|
if (item.hasOwnProperty('items')) { |
|
|
return ( |
|
|
return ( |
|
|
<Nav.Sub |
|
|
<Nav.Sub |
|
|