Manage Profile Pages
This commit is contained in:
@@ -1,51 +1,56 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useApolloClient } from "@apollo/react-hooks";
|
||||
import { Menu, Icon } from "antd";
|
||||
import { Menu, Icon, Row, Col } from "antd";
|
||||
import "./header.styles.scss";
|
||||
|
||||
import SignOut from "../sign-out/sign-out.component";
|
||||
import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component";
|
||||
import GlobalSearch from "../global-search/global-search.component";
|
||||
import LanguageSelector from "../language-selector/langauge-selector.component";
|
||||
import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component";
|
||||
|
||||
export default ({ landingHeader, navItems, selectedNavItem }) => {
|
||||
const apolloClient = useApolloClient();
|
||||
|
||||
|
||||
const handleClick = e => {
|
||||
apolloClient.writeData({ data: { selectedNavItem: e.key } });
|
||||
};
|
||||
return (
|
||||
<Menu
|
||||
theme='dark'
|
||||
className='header'
|
||||
onClick={handleClick}
|
||||
selectedKeys={selectedNavItem}
|
||||
mode='horizontal'>
|
||||
<Menu.Item>
|
||||
<GlobalSearch />
|
||||
</Menu.Item>
|
||||
{navItems.map(navItem => (
|
||||
<Menu.Item key={navItem.title}>
|
||||
<Link to={navItem.path}>
|
||||
{navItem.icontype ? <Icon type={navItem.icontype} /> : null}
|
||||
{navItem.title}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
))}
|
||||
<Row type="flex" justify="space-around">
|
||||
<Col span={16}>
|
||||
<Menu
|
||||
theme="dark"
|
||||
className="header"
|
||||
onClick={handleClick}
|
||||
selectedKeys={selectedNavItem}
|
||||
mode="horizontal"
|
||||
>
|
||||
<Menu.Item>
|
||||
<GlobalSearch />
|
||||
</Menu.Item>
|
||||
{navItems.map(navItem => (
|
||||
<Menu.Item key={navItem.title}>
|
||||
<Link to={navItem.path}>
|
||||
{navItem.icontype ? <Icon type={navItem.icontype} /> : null}
|
||||
{navItem.title}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
))}
|
||||
|
||||
{!landingHeader ? (
|
||||
<Menu.Item>
|
||||
<SignOut />
|
||||
</Menu.Item>
|
||||
) : (
|
||||
<Menu.Item>
|
||||
<ManageSignInButton />
|
||||
</Menu.Item>
|
||||
)}
|
||||
|
||||
{!landingHeader ? <LanguageSelector /> : null}
|
||||
</Menu>
|
||||
{!landingHeader ? (
|
||||
<Menu.Item>
|
||||
<SignOut />
|
||||
</Menu.Item>
|
||||
) : (
|
||||
<Menu.Item>
|
||||
<ManageSignInButton />
|
||||
</Menu.Item>
|
||||
)}
|
||||
</Menu>
|
||||
</Col>
|
||||
<Col span={6} offset={2}>
|
||||
{!landingHeader ? <CurrentUserDropdown /> : null}
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user