Skip to content

Commit

Permalink
feat: pass unitId as a prop through to Xpert component
Browse files Browse the repository at this point in the history
This commit modifies the Course component to pass the unitId prop, which presents the unit usage key in which the Xpert is being rendered, to the Chat component. The Chat component passes this unit ID as a prop to the Xpert component.
  • Loading branch information
MichaelRoytman committed Dec 18, 2023
1 parent 684ac49 commit 257bbc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/courseware/course/Course.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const Course = ({
isStaff={isStaff}
courseId={courseId}
contentToolsEnabled={course.showCalculator || course.notes.enabled}
unitId={unitId}
/>
<SidebarTriggers />
</>
Expand Down
4 changes: 3 additions & 1 deletion src/courseware/course/chat/Chat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const Chat = ({
isStaff,
courseId,
contentToolsEnabled,
unitId,
}) => {
const VERIFIED_MODES = [
'professional',
Expand Down Expand Up @@ -44,7 +45,7 @@ const Chat = ({
<>
{/* Use a portal to ensure that component overlay does not compete with learning MFE styles. */}
{shouldDisplayChat && (createPortal(
<Xpert courseId={courseId} contentToolsEnabled={contentToolsEnabled} />,
<Xpert courseId={courseId} contentToolsEnabled={contentToolsEnabled} unitId={unitId} />,
document.body,
))}
</>
Expand All @@ -57,6 +58,7 @@ Chat.propTypes = {
enrollmentMode: PropTypes.string,
courseId: PropTypes.string.isRequired,
contentToolsEnabled: PropTypes.bool.isRequired,
unitId: PropTypes.string.isRequired,
};

Chat.defaultProps = {
Expand Down

0 comments on commit 257bbc0

Please sign in to comment.