@coorpacademy/components 11.32.48 → 11.32.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,20 +68,12 @@
68
68
  padding: 16px;
69
69
  background-color: white;
70
70
  height: 114px;
71
- }
72
-
73
- .detailsSection0 {
74
- composes: detailsSectionCommon;
75
71
  flex: 1;
76
72
  }
77
73
 
78
- .detailsSection1 {
79
- composes: detailsSection0;
80
- }
81
-
82
- .detailsSection2 {
74
+ .detailsSection0 , .detailsSection1, .detailsSection2 {
83
75
  composes: detailsSectionCommon;
84
- width: 245px;
76
+ flex: 1;
85
77
  }
86
78
 
87
79
  .detailsInfo {
@@ -105,13 +105,13 @@ const CertificationDetail = (props, context) => {
105
105
  progression: progression,
106
106
  completedModules: completedModules,
107
107
  mandatoryModules: mandatoryModules,
108
- sections: _compact([{
108
+ sections: _compact([diplomaUrl && {
109
109
  type: 'diploma',
110
110
  downloadUrl: diplomaUrl
111
111
  }, badgeUrl && {
112
112
  type: 'badge',
113
113
  downloadUrl: badgeUrl
114
- }, {
114
+ }, stars && {
115
115
  type: 'stars',
116
116
  stars
117
117
  }])
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,SAAQC,qBAAR,QAAoC,mBAApC;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IACJC,gBADI;IAEJC,KAFI;IAGJC,GAHI;IAIJC,WAJI;IAKJC,oBALI;IAMJC,uBANI;IAOJC,OAPI;IAQJC,WARI;IASJC,uBATI;IAUJC,OAVI;IAWJC,OAXI;IAYJC,UAZI;IAaJC;EAbI,IAcFd,KAdJ;EAeA,MAAMe,cAAc,GAAGhC,MAAM,CAAC,IAAD,CAA7B;EACA,MAAM;IAACiC;EAAD,IAAcf,OAApB;EAEA,MAAM;IAACgB,WAAD;IAAcC,gBAAd;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAuDT,OAA7D;EAEA,MAAM,CAACU,sBAAD,EAAyBC,yBAAzB,IAAsDtC,QAAQ,CAAC,KAAD,CAApE;EACA,MAAM,CAACuC,QA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EAAEnE,SAAS,CAACoE,IADG;IAEvBC,OAAO,EAAErE,SAAS,CAACsE,OAAV,CAAkBtE,SAAS,CAACgE,KAAV,CAAgB3D,qBAAhB,CAAlB;EAFc,CAAhB,CAhBqB;EAoB9BkB,WAAW,EAAEvB,SAAS,CAACoE,IApBO;EAqB9B5C,uBAAuB,EAAExB,SAAS,CAACoE;AArBL,CAAhC;AAwBA,eAAevD,mBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n diplomaUrl && {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n stars && {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,SAAQC,qBAAR,QAAoC,m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ApB,2CAAgC;EAC9B5C,KAAK,EAAEjB,SAAS,CAAC8D,MAAV,CAAiBC,UADM;EAE9B7C,GAAG,EAAElB,SAAS,CAAC8D,MAFe;EAG9B9C,gBAAgB,EAAEhB,SAAS,CAAC8D,MAAV,CAAiBC,UAHL;EAI9B5C,WAAW,EAAEnB,SAAS,CAAC8D,MAAV,CAAiBC,UAJA;EAK9BrC,OAAO,EAAE1B,SAAS,CAAC8D,MALW;EAM9BrC,OAAO,EAAEzB,SAAS,CAACgE,KAAV,CAAgB;IACvBjC,WAAW,EAAE/B,SAAS,CAACiE,MADA;IAEvBhC,KAAK,EAAEjC,SAAS,CAACiE,MAFM;IAGvBjC,gBAAgB,EAAEhC,SAAS,CAACiE,MAHL;IAIvB/B,YAAY,EAAElC,SAAS,CAACiE;EAJD,CAAhB,CANqB;EAY9BtC,UAAU,EAAE3B,SAAS,CAAC8D,MAZQ;EAa9BlC,QAAQ,EAAE5B,SAAS,CAAC8D,MAbU;EAc9BzC,uBAAuB,EAAErB,SAAS,CAACkE,IAdL;EAe9B9C,oBAAoB,EAAEpB,SAAS,CAACgE,KAAV,CAAgBxD,SAAS,CAACqD,SAA1B,CAfQ;EAgB9BvC,OAAO,EAAEtB,SAAS,CAACgE,KAAV,CAAgB;IACvBG,QAAQ,EAAEnE,SAAS,CAACoE,IADG;IAEvBC,OAAO,EAAErE,SAAS,CAACsE,OAAV,CAAkBtE,SAAS,CAACgE,KAAV,CAAgB3D,qBAAhB,CAAlB;EAFc,CAAhB,CAhBqB;EAoB9BkB,WAAW,EAAEvB,SAAS,CAACoE,IApBO;EAqB9B5C,uBAAuB,EAAExB,SAAS,CAACoE;AArBL,CAAhC;AAwBA,eAAevD,mBAAf"}
@@ -68,20 +68,12 @@
68
68
  padding: 16px;
69
69
  background-color: white;
70
70
  height: 114px;
71
- }
72
-
73
- .detailsSection0 {
74
- composes: detailsSectionCommon;
75
71
  flex: 1;
76
72
  }
77
73
 
78
- .detailsSection1 {
79
- composes: detailsSection0;
80
- }
81
-
82
- .detailsSection2 {
74
+ .detailsSection0 , .detailsSection1, .detailsSection2 {
83
75
  composes: detailsSectionCommon;
84
- width: 245px;
76
+ flex: 1;
85
77
  }
86
78
 
87
79
  .detailsInfo {
@@ -133,13 +133,13 @@ const CertificationDetail = (props, context) => {
133
133
  progression: progression,
134
134
  completedModules: completedModules,
135
135
  mandatoryModules: mandatoryModules,
136
- sections: (0, _compact2.default)([{
136
+ sections: (0, _compact2.default)([diplomaUrl && {
137
137
  type: 'diploma',
138
138
  downloadUrl: diplomaUrl
139
139
  }, badgeUrl && {
140
140
  type: 'badge',
141
141
  downloadUrl: badgeUrl
142
- }, {
142
+ }, stars && {
143
143
  type: 'stars',
144
144
  stars
145
145
  }])
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","useRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","useState","showMore","setShowMore","handleShowMore","useCallback","useEffect","current","clientHeight","scrollHeight","Description","classnames","style","truncate","completedModules","useMemo","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","number","bool","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC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EAAE6C,kBAAA,CAAUG,KAAV,CAAgB;IACvBzC,WAAW,EAAEsC,kBAAA,CAAUI,MADA;IAEvBxC,KAAK,EAAEoC,kBAAA,CAAUI,MAFM;IAGvBzC,gBAAgB,EAAEqC,kBAAA,CAAUI,MAHL;IAIvBvC,YAAY,EAAEmC,kBAAA,CAAUI;EAJD,CAAhB,CANqB;EAY9B/C,UAAU,EAAE2C,kBAAA,CAAUC,MAZQ;EAa9B3C,QAAQ,EAAE0C,kBAAA,CAAUC,MAbU;EAc9BlD,uBAAuB,EAAEiD,kBAAA,CAAUK,IAdL;EAe9BvD,oBAAoB,EAAEkD,kBAAA,CAAUG,KAAV,CAAgBG,kBAAA,CAAUP,SAA1B,CAfQ;EAgB9B/C,OAAO,EAAEgD,kBAAA,CAAUG,KAAV,CAAgB;IACvBI,QAAQ,EAAEP,kBAAA,CAAUQ,IADG;IAEvBC,OAAO,EAAET,kBAAA,CAAUU,OAAV,CAAkBV,kBAAA,CAAUG,KAAV,CAAgBQ,6BAAhB,CAAlB;EAFc,CAAhB,CAhBqB;EAoB9B1D,WAAW,EAAE+C,kBAAA,CAAUQ,IApBO;EAqB9BtD,uBAAuB,EAAE8C,kBAAA,CAAUQ;AArBL,CAAhC;eAwBejE,mB"}
1
+ {"version":3,"file":"index.js","names":["CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","useRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","useState","showMore","setShowMore","handleShowMore","useCallback","useEffect","current","clientHeight","scrollHeight","Description","classnames","style","truncate","completedModules","useMemo","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","number","bool","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n diplomaUrl && {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n stars && {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IACJC,gBADI;IAEJC,KAFI;IAGJC,GAHI;IAIJC,WAJI;IAKJC,oBALI;IAMJC,uBANI;IAOJC,OAPI;IAQJC,WARI;IASJC,uBATI;IAUJC,OAVI;IAWJC,OAXI;IAYJC,UAZI;IAaJC;EAbI,IAcFd,KAdJ;EAeA,MAAMe,cAAc,GAAG,IAAAC,aAAA,EAAO,IAAP,CAAvB;EACA,MAAM;IAACC;EAAD,IAAchB,OAApB;EAEA,MAAM;IAACiB,WAAD;IAAcC,gBAAd;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAuDV,OAA7D;EAEA,MAAM,CAACW,sBAAD,EAAyBC,yBAAzB,IAAsD,IAAAC,eAAA,EAAS,KAAT,CAA5D;EACA,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,IAAAF,eAAA,EAAS,KAAT,CAAhC;EAEA,MAAMG,cAAc,GAAG,IAAAC,kBAAA,EAAY,MAAMF,WAAW,CAAC,CAACD,QAAF,CAA7B,EAA0C,CAACC,WAAD,EAAcD,QAAd,CAA1C,CAAvB;EAEA,IAAAI,gBAAA,EAAU,MAAM;IACd,IAAId,cAAc,CAACe,OAAnB,EAA4B;MAC1B,MAAM;QAACC,YAAY,GAAG,CAAhB;QAAmBC,YAAY,GAAG;MAAlC,IAAuCjB,cAAc,CAACe,OAA5D;MACAP,yBAAyB,CAACS,YAAY,GAAGD,YAAhB,CAAzB;IACD;EACF,CALD,EAKG,CAAC1B,WAAD,CAL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": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -178,5 +178,5 @@
178
178
  "last 2 versions",
179
179
  "IE 11"
180
180
  ],
181
- "gitHead": "c8dc612e5e367b62fea3f68d7d929a65d9bba4c6"
181
+ "gitHead": "826bb679507927047dd40281763368d03be31563"
182
182
  }