Skip to content

Commit 0abf66d

Browse files
asadiqbal08asadali145
authored andcommitted
asadiqbal08/Added user full name option (#3)
* Added user full name option * nit
1 parent 4acf721 commit 0abf66d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Header.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ensureConfig([
2828
subscribe(APP_CONFIG_INITIALIZED, () => {
2929
mergeConfig({
3030
AUTHN_MINIMAL_HEADER: !!process.env.AUTHN_MINIMAL_HEADER,
31+
SHOW_FULLNAME: process.env.SHOW_FULLNAME
3132
}, 'Header additional config');
3233
});
3334

src/learning-header/AuthenticatedUserDropdown.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const AuthenticatedUserDropdown = ({ intl, username }) => {
2424
<Dropdown.Toggle variant="outline-primary">
2525
<FontAwesomeIcon icon={faUserCircle} className="d-md-none" size="lg" />
2626
<span data-hj-suppress className="d-none d-md-inline">
27-
{username}
27+
{name}
2828
</span>
2929
</Dropdown.Toggle>
3030
<Dropdown.Menu className="dropdown-menu-right">
@@ -51,7 +51,7 @@ const AuthenticatedUserDropdown = ({ intl, username }) => {
5151

5252
AuthenticatedUserDropdown.propTypes = {
5353
intl: intlShape.isRequired,
54-
username: PropTypes.string.isRequired,
54+
name: PropTypes.string.isRequired,
5555
};
5656

5757
export default injectIntl(AuthenticatedUserDropdown);

src/learning-header/LearningHeader.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ const LearningHeader = ({
4949
<span className="d-block m-0 font-weight-bold course-title">{courseTitle}</span>
5050
</div>
5151
{showUserDropdown && authenticatedUser && (
52-
<AuthenticatedUserDropdown
53-
username={authenticatedUser.username}
54-
/>
52+
<AuthenticatedUserDropdown
53+
name={getConfig().SHOW_FULLNAME ? authenticatedUser.name : authenticatedUser.username}
54+
/>
5555
)}
5656
{showUserDropdown && !authenticatedUser && (
5757
<AnonymousUserMenu />

0 commit comments

Comments
 (0)