Skip to content

Commit

Permalink
feat: update menu
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Aug 14, 2019
1 parent 3de8f81 commit cb88098
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions web/src/components/SiteWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@ const navBarItems = [
];

const accountDropdownProps = ({activeSession}) => {
const username = activeSession ? activeSession.tokenParsed.preferred_username : "Log In?"
const username = activeSession ? activeSession.tokenParsed.preferred_username : "Account"
const avatar = activeSession ? logo : undefined;

const description = activeSession ? "Team" : "Log in?";
const options = [];
if (activeSession) { options.push("profile"); }
if (activeSession) { options.push("divider"); }
options.push("help");
if (!activeSession) { options.push({icon: "settings", value: "Log in", to: "/app/login"}); }
if (activeSession) { options.push({icon: "settings", value: "Settings", to: activeSession.tokenParsed.iss+"/account"}); }
if (activeSession) { options.push({icon: "settings", value: "Log out", to: "/app/logout"}); }
return {
avatarURL: avatar,
name: `${username}`,
description: description,
options: options,
}
};

Expand Down Expand Up @@ -90,4 +99,4 @@ const mapDispatchToProps = {};
export default connect(
mapStateToProps,
mapDispatchToProps
)(SiteWrapper);
)(SiteWrapper);

0 comments on commit cb88098

Please sign in to comment.