diff --git a/README.rst b/README.rst
index ab9e4db72f..eba016a348 100644
--- a/README.rst
+++ b/README.rst
@@ -49,6 +49,7 @@ Environment Variables
* ``ACCOUNT_PROFILE_URL`` - The URL of the account profile page.
* ``ACCOUNT_SETTINGS_URL`` - The URL of the account settings page.
* ``AUTHN_MINIMAL_HEADER`` - A boolean flag which hides the main menu, user menu, and logged-out
+* ``ENABLE_HEADER_WITHOUT_USERNAME`` - A boolean flag which hides the username from the header
menu items when truthy. This is intended to be used in micro-frontends like
frontend-app-authentication in which these menus are considered distractions from the user's task.
diff --git a/example/index.js b/example/index.js
index 2559c03d48..ac41c49600 100644
--- a/example/index.js
+++ b/example/index.js
@@ -26,6 +26,7 @@ subscribe(APP_READY, () => {
authenticatedUser: {
userId: '123abc',
username: 'testuser',
+ name: 'test user',
roles: [],
administrator: false,
},
diff --git a/src/DesktopHeader.jsx b/src/DesktopHeader.jsx
index 8bd142fb9e..ff514f1084 100644
--- a/src/DesktopHeader.jsx
+++ b/src/DesktopHeader.jsx
@@ -19,52 +19,26 @@ class DesktopHeader extends React.Component {
super(props);
}
- renderMainMenu() {
- const { mainMenu } = this.props;
-
- // Nodes are accepted as a prop
- if (!Array.isArray(mainMenu)) {
- return mainMenu;
- }
-
- return mainMenu.map((menuItem) => {
- const {
- type,
- href,
- content,
- submenuContent,
- } = menuItem;
-
- if (type === 'item') {
- return (
- {content}
- );
- }
-
- return (
-
- );
- });
- }
+ userMenuWithUsername() {
+ const {
+ userMenu,
+ avatar,
+ username,
+ intl,
+ } = this.props;
- // Renders an optional App Menu for
- renderAppMenu() {
- const { appMenu } = this.props;
- const { content: appMenuContent, menuItems } = appMenu;
return (