diff --git a/src/discussions/posts/post/Post.jsx b/src/discussions/posts/post/Post.jsx index 95e0aa7f..3a5a43fa 100644 --- a/src/discussions/posts/post/Post.jsx +++ b/src/discussions/posts/post/Post.jsx @@ -1,6 +1,7 @@ -import React from 'react'; +import React, { useContext } from 'react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory, useLocation } from 'react-router-dom'; @@ -11,6 +12,7 @@ import HTMLLoader from '../../../components/HTMLLoader'; import { ContentActions } from '../../../data/constants'; import { selectorForUnitSubsection, selectTopicContext } from '../../../data/selectors'; import { AlertBanner, Confirmation } from '../../common'; +import { DiscussionContext } from '../../common/context'; import { selectModerationSettings } from '../../data/selectors'; import { selectTopic } from '../../topics/data/selectors'; import { removeThread, updateExistingThread } from '../data/thunks'; @@ -56,6 +58,7 @@ function Post({ hideReportConfirmation(); }; + const { inContext } = useContext(DiscussionContext); const actionHandlers = { [ContentActions.EDIT_CONTENT]: () => history.push({ ...location, @@ -107,13 +110,25 @@ function Post({ {topicContext && topic && ( -
+
{intl.formatMessage(messages.relatedTo)}{' '} - {`${getTopicCategoryName(topic)} / ${topic.name}`} + {inContext + ? ( + <> + {topicContext.chapterName} + / + {topicContext.verticalName} + / + {topicContext.unitName} + + ) + : `${getTopicCategoryName(topic)} / ${topic.name}`}
)}