-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d963110
commit 56af25b
Showing
22 changed files
with
190 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Link from "next/link"; | ||
import {Menu} from "antd"; | ||
|
||
const HeaderMenu = ({currentItem = "0", handleClick, authState = "unchecked", className = "header__menu", mode = "horizontal"}) => { | ||
return ( | ||
<Menu | ||
mode={mode} | ||
className={className} | ||
theme="light" | ||
selectedKeys={[currentItem]} | ||
onClick={handleClick} | ||
> | ||
{authState !== "unchecked" ? // eslint-disable-line no-negated-condition | ||
<Menu.Item key="1"> | ||
<Link href={`/${authState === "logged in" ? "logout" : "login"}`}> | ||
<a>{authState === "logged in" ? "Logout" : "Login"}</a> | ||
</Link> | ||
</Menu.Item> : | ||
null} | ||
{authState === "logged out" ? | ||
<Menu.Item key="2"> | ||
<Link href="/register"> | ||
<a>Register</a> | ||
</Link> | ||
</Menu.Item> : | ||
null} | ||
</Menu> | ||
); | ||
}; | ||
|
||
HeaderMenu.propTypes = { | ||
mode: PropTypes.string, | ||
className: PropTypes.string, | ||
authState: PropTypes.string, | ||
handleClick: PropTypes.func, | ||
currentItem: PropTypes.string | ||
}; | ||
HeaderMenu.defaultProps = { | ||
mode: "horizontal", | ||
className: "header__menu", | ||
authState: "unchecked", | ||
handleClick: () => {}, | ||
currentItem: "0" | ||
}; | ||
|
||
export default HeaderMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.