@@ -5,9 +5,9 @@ import styled from "styled-components"
55import Loading from "../Loading"
66import { fetchProgress } from "../../services/progress"
77import PagesContext from "../../contexes/PagesContext"
8- import PartProgress from "./PartProgress"
98import { getCachedUserDetails } from "../../services/moocfi"
109import { SMALL_MEDIUM_BREAKPOINT } from "../../util/constants"
10+ import CourseProgress from "./CourseProgress"
1111
1212const StyledModal = styled ( Modal ) `
1313 z-index: 500 !important;
@@ -54,6 +54,7 @@ class PointsBalloonContent extends React.Component {
5454 data : null ,
5555 error : null ,
5656 appliesForStudyRight : null ,
57+ currentCourseVariant : null ,
5758 }
5859
5960 async componentDidMount ( ) {
@@ -63,7 +64,8 @@ class PointsBalloonContent extends React.Component {
6364 let userDetails = await getCachedUserDetails ( )
6465 const appliesForStudyRight =
6566 userDetails ?. extra_fields ?. applies_for_study_right === "t"
66- this . setState ( { data, appliesForStudyRight } )
67+ const currentCourseVariant = userDetails ?. extra_fields ?. course_variant
68+ this . setState ( { data, appliesForStudyRight, currentCourseVariant } )
6769 } catch ( e ) {
6870 this . setState ( { error : e . toString ( ) } )
6971 }
@@ -98,16 +100,11 @@ class PointsBalloonContent extends React.Component {
98100 </ div >
99101 ) : (
100102 < div >
101- { this . state . data &&
102- Object . entries ( this . state . data ) . map ( ( [ name , data ] ) => {
103- return (
104- < PartProgress
105- appliesForStudyRight = { this . state . appliesForStudyRight }
106- name = { name }
107- data = { data }
108- />
109- )
110- } ) }
103+ < CourseProgress
104+ data = { this . state . data }
105+ appliesForStudyRight = { this . state . appliesForStudyRight }
106+ currentCourseVariant = { this . state . currentCourseVariant }
107+ />
111108 </ div >
112109 ) }
113110 </ Fragment >
0 commit comments