Skip to content

Commit e142ee9

Browse files
feat: add env variable to display image
1 parent d3b577c commit e142ee9

File tree

6 files changed

+8
-2
lines changed

6 files changed

+8
-2
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ USER_INFO_COOKIE_NAME=''
2222
SUPPORT_URL=''
2323
LEARNER_FEEDBACK_URL=''
2424
STAFF_FEEDBACK_URL=''
25+
ENABLE_PROFILE_IMAGE=''

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ USER_INFO_COOKIE_NAME='edx-user-info'
2323
SUPPORT_URL='https://support.edx.org'
2424
LEARNER_FEEDBACK_URL=''
2525
STAFF_FEEDBACK_URL=''
26+
ENABLE_PROFILE_IMAGE='true'

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ USER_INFO_COOKIE_NAME='edx-user-info'
2121
SUPPORT_URL='https://support.edx.org'
2222
LEARNER_FEEDBACK_URL=''
2323
STAFF_FEEDBACK_URL=''
24+
ENABLE_PROFILE_IMAGE=''

src/discussions/post-comments/comments/comment/CommentHeader.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import classNames from 'classnames';
77
import { AvatarOutlineAndLabelColors } from '../../../../data/constants';
88
import { AuthorLabel } from '../../../common';
99
import { useAlertBannerVisible } from '../../../data/hooks';
10+
import {getConfig} from "@edx/frontend-platform";
1011

1112
const CommentHeader = ({
1213
author,
@@ -25,7 +26,7 @@ const CommentHeader = ({
2526
closed,
2627
});
2728

28-
const profileImage = postUsers && Object.values(postUsers)[0].profile.image;
29+
const profileImage = getConfig().ENABLE_PROFILE_IMAGE === 'true' && postUsers && Object.values(postUsers)[0].profile.image;
2930

3031
return (
3132
<div className={classNames('d-flex flex-row justify-content-between', {

src/discussions/posts/post/PostHeader.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { AvatarOutlineAndLabelColors, ThreadType } from '../../../data/constants
1111
import { AuthorLabel } from '../../common';
1212
import { useAlertBannerVisible } from '../../data/hooks';
1313
import messages from './messages';
14+
import {getConfig} from "@edx/frontend-platform";
1415

1516
export const PostAvatar = React.memo(({
1617
author, postType, authorLabel, fromPostLink, read, postUsers,
@@ -37,7 +38,7 @@ export const PostAvatar = React.memo(({
3738
return spacing;
3839
}, [postType]);
3940

40-
const profileImage = postUsers && Object.values(postUsers)[0].profile.image;
41+
const profileImage = getConfig().ENABLE_PROFILE_IMAGE === 'true' && postUsers && Object.values(postUsers)[0].profile.image;
4142

4243
return (
4344
<div className={avatarSpacing}>

src/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ initialize({
4040
LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,
4141
LEARNER_FEEDBACK_URL: process.env.LEARNER_FEEDBACK_URL,
4242
STAFF_FEEDBACK_URL: process.env.STAFF_FEEDBACK_URL,
43+
ENABLE_PROFILE_IMAGE: process.env.ENABLE_PROFILE_IMAGE,
4344
}, 'DiscussionsConfig');
4445
},
4546
},

0 commit comments

Comments
 (0)