import * as React from 'react'; import UserInfo from './UserInfo'; import HonourWall from './HonourWall'; import HonoutTab from './HonourTab'; import HonourTag from './HonourTag'; import { taker, getApiUrl, getQueryString, getUserInfo } from '../../helper' import './index.scss'; interface Props { tagShow: boolean | undefined; honorWall: any | undefined; tab: tab; } interface State { userInfo: any } interface tab { changeContent: (item: any) => void; channelData: any | undefined; setDefatuleChannel: Function; tabs: any[], tabValueField: string, tabTextField: string, onChangeTab: Function } const HeaderLayout = (props: any) => (
{props.children[1]}
{props.children[0]}
{props.tab.tabs.length? (
{props.children[2]}
):null}
) export default class Header extends React.PureComponent{ state = { userInfo: undefined } componentDidMount(){ this.getData() } getData = async () => { const selfId = getUserInfo()['Id']; const toUserID = getQueryString()['to_user_id']; const url = `${getApiUrl('proxy/GetUPaaSCoreGateway/AccountService/GetUserInfo')}?toUserId=${toUserID || selfId}`; let res = await taker(url, 'get') if (!res || !res.OperationObject) return; const { OperationObject } = res; this.setState({ userInfo: OperationObject }) } render() { const { tagShow = true, honorWall, tab } = this.props; return (
{ tagShow && }
) } }