File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ class DesktopHeader extends React.Component {
7777 userMenu,
7878 avatar,
7979 username,
80+ name,
8081 intl,
8182 } = this . props ;
8283
@@ -88,7 +89,7 @@ class DesktopHeader extends React.Component {
8889 className = "btn btn-outline-primary d-inline-flex align-items-center pl-2 pr-3"
8990 >
9091 < Avatar size = "1.5em" src = { avatar } alt = "" className = "mr-2" />
91- { username } < CaretIcon role = "img" aria-hidden focusable = "false" />
92+ { name || username } < CaretIcon role = "img" aria-hidden focusable = "false" />
9293 </ MenuTrigger >
9394 < MenuContent className = "mb-0 dropdown-menu show dropdown-menu-right pin-right shadow py-2" >
9495 { userMenu . map ( ( { type, href, content } ) => (
@@ -178,6 +179,7 @@ DesktopHeader.propTypes = {
178179 logoDestination : PropTypes . string ,
179180 avatar : PropTypes . string ,
180181 username : PropTypes . string ,
182+ name : PropTypes . string ,
181183 loggedIn : PropTypes . bool ,
182184
183185 // i18n
@@ -207,6 +209,7 @@ DesktopHeader.defaultProps = {
207209 logoDestination : null ,
208210 avatar : null ,
209211 username : null ,
212+ name : null ,
210213 loggedIn : false ,
211214 appMenu : null ,
212215} ;
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ const Header = ({ intl }) => {
9494 logoDestination : `${ config . LMS_BASE_URL } /dashboard` ,
9595 loggedIn : authenticatedUser !== null ,
9696 username : authenticatedUser !== null ? authenticatedUser . username : null ,
97+ name : authenticatedUser !== null ? authenticatedUser . name : null ,
9798 avatar : authenticatedUser !== null ? authenticatedUser . avatar : null ,
9899 mainMenu : getConfig ( ) . AUTHN_MINIMAL_HEADER ? [ ] : mainMenu ,
99100 userMenu : getConfig ( ) . AUTHN_MINIMAL_HEADER ? [ ] : userMenu ,
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ class MobileHeader extends React.Component {
8989 loggedIn,
9090 avatar,
9191 username,
92+ name,
9293 stickyOnMobile,
9394 intl,
9495 mainMenu,
@@ -139,7 +140,7 @@ class MobileHeader extends React.Component {
139140 aria-label = { intl . formatMessage ( messages [ 'header.label.account.menu' ] ) }
140141 title = { intl . formatMessage ( messages [ 'header.label.account.menu' ] ) }
141142 >
142- < Avatar size = "1.5rem" src = { avatar } alt = { username } />
143+ < Avatar size = "1.5rem" src = { avatar } alt = { name || username } />
143144 </ MenuTrigger >
144145 < MenuContent tag = "ul" className = "nav flex-column pin-left pin-right border-top shadow py-2" >
145146 { loggedIn ? this . renderUserMenuItems ( ) : this . renderLoggedOutItems ( ) }
@@ -173,6 +174,7 @@ MobileHeader.propTypes = {
173174 logoDestination : PropTypes . string ,
174175 avatar : PropTypes . string ,
175176 username : PropTypes . string ,
177+ name : PropTypes . string ,
176178 loggedIn : PropTypes . bool ,
177179 stickyOnMobile : PropTypes . bool ,
178180
@@ -189,6 +191,7 @@ MobileHeader.defaultProps = {
189191 logoDestination : null ,
190192 avatar : null ,
191193 username : null ,
194+ name : null ,
192195 loggedIn : false ,
193196 stickyOnMobile : true ,
194197
You can’t perform that action at this time.
0 commit comments