@coorpacademy/components 11.32.22 → 11.32.23-alpha.2
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.
- package/es/molecule/playlist-detail-cover/index.d.ts +14 -0
- package/es/molecule/playlist-detail-cover/index.d.ts.map +1 -0
- package/es/molecule/playlist-detail-cover/index.js +52 -0
- package/es/molecule/playlist-detail-cover/index.js.map +1 -0
- package/es/molecule/playlist-detail-cover/style.css +17 -0
- package/es/template/playlist-detail/index.d.ts +96 -0
- package/es/template/playlist-detail/index.d.ts.map +1 -0
- package/es/template/playlist-detail/index.js +112 -0
- package/es/template/playlist-detail/index.js.map +1 -0
- package/es/template/playlist-detail/style.css +109 -0
- package/es/template/skill-detail/all-courses.d.ts +1 -1
- package/es/template/skill-detail/all-courses.js +3 -3
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/es/template/skill-detail/index.d.ts +39 -4
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +2 -4
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/variables/courses.d.ts +3 -0
- package/es/variables/courses.d.ts.map +1 -0
- package/es/variables/courses.js +3 -0
- package/es/variables/courses.js.map +1 -0
- package/lib/molecule/playlist-detail-cover/index.d.ts +14 -0
- package/lib/molecule/playlist-detail-cover/index.d.ts.map +1 -0
- package/lib/molecule/playlist-detail-cover/index.js +68 -0
- package/lib/molecule/playlist-detail-cover/index.js.map +1 -0
- package/lib/molecule/playlist-detail-cover/style.css +17 -0
- package/lib/template/playlist-detail/index.d.ts +96 -0
- package/lib/template/playlist-detail/index.d.ts.map +1 -0
- package/lib/template/playlist-detail/index.js +137 -0
- package/lib/template/playlist-detail/index.js.map +1 -0
- package/lib/template/playlist-detail/style.css +109 -0
- package/lib/template/skill-detail/all-courses.d.ts +1 -1
- package/lib/template/skill-detail/all-courses.js +3 -3
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/lib/template/skill-detail/index.d.ts +39 -4
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +3 -2
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/variables/courses.d.ts +3 -0
- package/lib/variables/courses.d.ts.map +1 -0
- package/lib/variables/courses.js +7 -0
- package/lib/variables/courses.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default PlaylistDetailCover;
|
|
2
|
+
declare function PlaylistDetailCover({ images }: {
|
|
3
|
+
images: any;
|
|
4
|
+
}): JSX.Element;
|
|
5
|
+
declare namespace PlaylistDetailCover {
|
|
6
|
+
namespace propTypes {
|
|
7
|
+
const images: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
8
|
+
type: PropTypes.Requireable<string>;
|
|
9
|
+
url: PropTypes.Requireable<string>;
|
|
10
|
+
}> | null | undefined)[]>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/playlist-detail-cover/index.js"],"names":[],"mappings":";AAQA;;gBAoCC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useMemo, useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { COURSE_TYPES } from '../../variables/courses';
|
|
4
|
+
import style from './style.css';
|
|
5
|
+
const FALLBACK_PATH = 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/cover-fallback-external-$TYPE.png';
|
|
6
|
+
|
|
7
|
+
const PlaylistDetailCover = ({
|
|
8
|
+
images
|
|
9
|
+
}) => {
|
|
10
|
+
const [firstColumnImages, secondColumnImages] = useMemo(() => {
|
|
11
|
+
const imagesClone = [...images];
|
|
12
|
+
return [imagesClone.splice(0, imagesClone.length / 2), imagesClone];
|
|
13
|
+
}, [images]);
|
|
14
|
+
const buildImageStyle = useCallback(({
|
|
15
|
+
type,
|
|
16
|
+
url
|
|
17
|
+
}) => {
|
|
18
|
+
const imageUrl = url || FALLBACK_PATH.replace('$TYPE', type);
|
|
19
|
+
return {
|
|
20
|
+
backgroundImage: `url(${imageUrl})`,
|
|
21
|
+
backgroundSize: 'cover',
|
|
22
|
+
backgroundPosition: 'center'
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: style.container
|
|
27
|
+
}, images.length === 1 ? /*#__PURE__*/React.createElement("img", {
|
|
28
|
+
className: style.image,
|
|
29
|
+
style: buildImageStyle(images[0])
|
|
30
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: style.imagesWrapper
|
|
32
|
+
}, firstColumnImages.map((image, index) => /*#__PURE__*/React.createElement("img", {
|
|
33
|
+
key: index,
|
|
34
|
+
className: style.image,
|
|
35
|
+
style: buildImageStyle(image)
|
|
36
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: style.imagesWrapper
|
|
38
|
+
}, secondColumnImages.map((image, index) => /*#__PURE__*/React.createElement("img", {
|
|
39
|
+
key: index,
|
|
40
|
+
className: style.image,
|
|
41
|
+
style: buildImageStyle(image)
|
|
42
|
+
})))));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
PlaylistDetailCover.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
46
|
+
images: PropTypes.arrayOf(PropTypes.shape({
|
|
47
|
+
type: PropTypes.oneOf(COURSE_TYPES),
|
|
48
|
+
url: PropTypes.string
|
|
49
|
+
}))
|
|
50
|
+
} : {};
|
|
51
|
+
export default PlaylistDetailCover;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","PropTypes","COURSE_TYPES","style","FALLBACK_PATH","PlaylistDetailCover","images","firstColumnImages","secondColumnImages","imagesClone","splice","length","buildImageStyle","type","url","imageUrl","replace","backgroundImage","backgroundSize","backgroundPosition","container","image","imagesWrapper","map","index","propTypes","arrayOf","shape","oneOf","string"],"sources":["../../../src/molecule/playlist-detail-cover/index.js"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {COURSE_TYPES} from '../../variables/courses';\nimport style from './style.css';\n\nconst FALLBACK_PATH =\n 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/cover-fallback-external-$TYPE.png';\n\nconst PlaylistDetailCover = ({images}) => {\n const [firstColumnImages, secondColumnImages] = useMemo(() => {\n const imagesClone = [...images];\n return [imagesClone.splice(0, imagesClone.length / 2), imagesClone];\n }, [images]);\n\n const buildImageStyle = useCallback(({type, url}) => {\n const imageUrl = url || FALLBACK_PATH.replace('$TYPE', type);\n\n return {\n backgroundImage: `url(${imageUrl})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center'\n };\n });\n\n return (\n <div className={style.container}>\n {images.length === 1 ? (\n <img className={style.image} style={buildImageStyle(images[0])} />\n ) : (\n <>\n <div className={style.imagesWrapper}>\n {firstColumnImages.map((image, index) => (\n <img key={index} className={style.image} style={buildImageStyle(image)} />\n ))}\n </div>\n <div className={style.imagesWrapper}>\n {secondColumnImages.map((image, index) => (\n <img key={index} className={style.image} style={buildImageStyle(image)} />\n ))}\n </div>\n </>\n )}\n </div>\n );\n};\n\nPlaylistDetailCover.propTypes = {\n images: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(COURSE_TYPES),\n url: PropTypes.string\n })\n )\n};\n\nexport default PlaylistDetailCover;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,WAAxB,QAA0C,OAA1C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,YAAR,QAA2B,yBAA3B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AA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AAR,kBACtB;IAAK,GAAG,EAAEA,KAAV;IAAiB,SAAS,EAAErB,KAAK,CAACkB,KAAlC;IAAyC,KAAK,EAAET,eAAe,CAACS,KAAD;EAA/D,EADD,CADH,CANF,CAJJ,CADF;AAoBD,CApCD;;AAsCAhB,mBAAmB,CAACoB,SAApB,2CAAgC;EAC9BnB,MAAM,EAAEL,SAAS,CAACyB,OAAV,CACNzB,SAAS,CAAC0B,KAAV,CAAgB;IACdd,IAAI,EAAEZ,SAAS,CAAC2B,KAAV,CAAgB1B,YAAhB,CADQ;IAEdY,GAAG,EAAEb,SAAS,CAAC4B;EAFD,CAAhB,CADM;AADsB,CAAhC;AASA,eAAexB,mBAAf"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export default PlaylistDetail;
|
|
2
|
+
declare function PlaylistDetail(props: any, context: any): JSX.Element;
|
|
3
|
+
declare namespace PlaylistDetail {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
}
|
|
28
|
+
namespace propTypes {
|
|
29
|
+
const title: PropTypes.Validator<string>;
|
|
30
|
+
const coverImages: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
31
|
+
type: PropTypes.Requireable<string>;
|
|
32
|
+
url: PropTypes.Requireable<string>;
|
|
33
|
+
}> | null | undefined)[]>;
|
|
34
|
+
const playlistRef: PropTypes.Validator<string>;
|
|
35
|
+
const description: PropTypes.Requireable<string>;
|
|
36
|
+
const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
38
|
+
customStyle: PropTypes.Requireable<{
|
|
39
|
+
[x: string]: string | null | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
loading: PropTypes.Requireable<boolean>;
|
|
42
|
+
}>>;
|
|
43
|
+
const playlistCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
44
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
45
|
+
customStyle: PropTypes.Requireable<{
|
|
46
|
+
[x: string]: string | null | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
loading: PropTypes.Requireable<boolean>;
|
|
49
|
+
}>>;
|
|
50
|
+
const totalCourses: PropTypes.Requireable<number>;
|
|
51
|
+
const filters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
52
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
54
|
+
name: PropTypes.Validator<string>;
|
|
55
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
56
|
+
selected: PropTypes.Requireable<boolean>;
|
|
57
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
58
|
+
}> | null | undefined)[]>;
|
|
59
|
+
}>>;
|
|
60
|
+
const sorting: PropTypes.Requireable<PropTypes.InferProps<{
|
|
61
|
+
title: PropTypes.Requireable<string>;
|
|
62
|
+
name: PropTypes.Requireable<string>;
|
|
63
|
+
className: PropTypes.Requireable<string>;
|
|
64
|
+
borderClassName: PropTypes.Requireable<string>;
|
|
65
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
66
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
67
|
+
description: PropTypes.Requireable<string>;
|
|
68
|
+
required: PropTypes.Requireable<boolean>;
|
|
69
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
|
+
theme: PropTypes.Requireable<string>;
|
|
71
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
72
|
+
name: PropTypes.Validator<string>;
|
|
73
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
74
|
+
selected: PropTypes.Requireable<boolean>;
|
|
75
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
76
|
+
}> | null | undefined)[]>;
|
|
77
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
78
|
+
label: PropTypes.Validator<string>;
|
|
79
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
80
|
+
name: PropTypes.Validator<string>;
|
|
81
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
82
|
+
selected: PropTypes.Requireable<boolean>;
|
|
83
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
84
|
+
}> | null | undefined)[]>;
|
|
85
|
+
}> | null | undefined)[]>;
|
|
86
|
+
modified: PropTypes.Requireable<boolean>;
|
|
87
|
+
error: PropTypes.Requireable<boolean>;
|
|
88
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
89
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
90
|
+
}>>;
|
|
91
|
+
const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
|
+
const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
import PropTypes from "prop-types";
|
|
96
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAyEC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import Provider from '../../atom/provider';
|
|
5
|
+
import Tag from '../../atom/tag';
|
|
6
|
+
import Select, { SelectOptionPropTypes } from '../../atom/select';
|
|
7
|
+
import Icon from '../../atom/icon';
|
|
8
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
9
|
+
import AllCourses from '../skill-detail/all-courses';
|
|
10
|
+
import ContinueLearning from '../skill-detail/continue-learning';
|
|
11
|
+
import PlaylistDetailCover from '../../molecule/playlist-detail-cover';
|
|
12
|
+
import { ContinueLearningButton } from '../skill-detail';
|
|
13
|
+
import style from './style.css';
|
|
14
|
+
const DESCRIPTION_BREAKPOINT = 382;
|
|
15
|
+
|
|
16
|
+
const PlaylistDetail = (props, context) => {
|
|
17
|
+
const {
|
|
18
|
+
title,
|
|
19
|
+
coverImages,
|
|
20
|
+
playlistRef,
|
|
21
|
+
description,
|
|
22
|
+
ongoingCourses,
|
|
23
|
+
playlistCourses,
|
|
24
|
+
totalCourses,
|
|
25
|
+
filters,
|
|
26
|
+
sorting,
|
|
27
|
+
onBackClick,
|
|
28
|
+
onContinueLearningClick
|
|
29
|
+
} = props;
|
|
30
|
+
const {
|
|
31
|
+
translate
|
|
32
|
+
} = context;
|
|
33
|
+
const [showMore, setShowMore] = useState(false);
|
|
34
|
+
const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
|
|
35
|
+
const Description = useCallback(() => {
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: classnames(style.description, !showMore && style.truncate)
|
|
38
|
+
}, description);
|
|
39
|
+
}, [showMore, description]);
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: style.backgroundContainer
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: style.container,
|
|
44
|
+
"data-name": playlistRef
|
|
45
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: style.backButtonWrapper,
|
|
47
|
+
onClick: onBackClick
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
+
iconName: "arrow-left",
|
|
50
|
+
size: {
|
|
51
|
+
faSize: 14,
|
|
52
|
+
wrapperSize: 14
|
|
53
|
+
}
|
|
54
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: style.ctaContainer
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: style.coverWrapper
|
|
58
|
+
}, /*#__PURE__*/React.createElement(PlaylistDetailCover, {
|
|
59
|
+
images: coverImages
|
|
60
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tag, {
|
|
61
|
+
label: translate('playlist')
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: style.title
|
|
64
|
+
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), description.length >= DESCRIPTION_BREAKPOINT ? /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: style.showMoreWrapper,
|
|
66
|
+
onClick: handleShowMore
|
|
67
|
+
}, translate(showMore ? 'Show less' : 'Show more'), /*#__PURE__*/React.createElement(Icon, {
|
|
68
|
+
iconName: showMore ? 'chevron-up' : 'chevron-down',
|
|
69
|
+
size: {
|
|
70
|
+
faSize: 14,
|
|
71
|
+
wrapperSize: 16
|
|
72
|
+
}
|
|
73
|
+
})) : null) : null, /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: style.continueLearningButton
|
|
75
|
+
}, /*#__PURE__*/React.createElement(ContinueLearningButton, {
|
|
76
|
+
ongoingCoursesAvailable: !!ongoingCourses.list.length,
|
|
77
|
+
onClick: onContinueLearningClick
|
|
78
|
+
})))), /*#__PURE__*/React.createElement(ContinueLearning, {
|
|
79
|
+
ongoingCourses: ongoingCourses
|
|
80
|
+
}), /*#__PURE__*/React.createElement(AllCourses, {
|
|
81
|
+
courses: playlistCourses,
|
|
82
|
+
totalCourses: totalCourses,
|
|
83
|
+
filters: filters,
|
|
84
|
+
sorting: sorting
|
|
85
|
+
})));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
PlaylistDetail.contextTypes = {
|
|
89
|
+
skin: Provider.childContextTypes.skin,
|
|
90
|
+
translate: Provider.childContextTypes.translate
|
|
91
|
+
};
|
|
92
|
+
PlaylistDetail.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
93
|
+
title: PropTypes.string.isRequired,
|
|
94
|
+
coverImages: PropTypes.arrayOf(PropTypes.shape({
|
|
95
|
+
type: PropTypes.oneOf(['podcast', 'video', 'interactive', 'document']),
|
|
96
|
+
url: PropTypes.string
|
|
97
|
+
})),
|
|
98
|
+
playlistRef: PropTypes.string.isRequired,
|
|
99
|
+
description: PropTypes.string,
|
|
100
|
+
ongoingCourses: PropTypes.shape(CardsGrid.propTypes),
|
|
101
|
+
playlistCourses: PropTypes.shape(CardsGrid.propTypes),
|
|
102
|
+
totalCourses: PropTypes.number,
|
|
103
|
+
filters: PropTypes.shape({
|
|
104
|
+
onChange: PropTypes.func,
|
|
105
|
+
options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
|
|
106
|
+
}),
|
|
107
|
+
sorting: PropTypes.shape(Select.propTypes),
|
|
108
|
+
onBackClick: PropTypes.func,
|
|
109
|
+
onContinueLearningClick: PropTypes.func
|
|
110
|
+
} : {};
|
|
111
|
+
export default PlaylistDetail;
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Provider","Tag","Select","SelectOptionPropTypes","Icon","CardsGrid","AllCourses","ContinueLearning","PlaylistDetailCover","ContinueLearningButton","style","DESCRIPTION_BREAKPOINT","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCourses","playlistCourses","totalCourses","filters","sorting","onBackClick","onContinueLearningClick","translate","showMore","setShowMore","handleShowMore","Description","truncate","backgroundContainer","container","backButtonWrapper","faSize","wrapperSize","ctaContainer","coverWrapper","length","showMoreWrapper","continueLearningButton","list","contextTypes","skin","childContextTypes","propTypes","string","isRequired","arrayOf","shape","type","oneOf","url","number","onChange","func","options"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport ContinueLearning from '../skill-detail/continue-learning';\nimport PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCourses,\n playlistCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick\n } = props;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n <div className={style.backButtonWrapper} onClick={onBackClick}>\n <Icon iconName=\"arrow-left\" size={{faSize: 14, wrapperSize: 14}} />\n </div>\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\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.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n courses={playlistCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(['podcast', 'video', 'interactive', 'document']),\n url: PropTypes.string\n })\n ),\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default PlaylistDetail;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,MA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AAe5C,cAAf"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
3
|
+
@value tablet from breakpoints;
|
|
4
|
+
@value mobile from breakpoints;
|
|
5
|
+
@value xtraLightGrey from colors;
|
|
6
|
+
@value cm_grey_100 from colors;
|
|
7
|
+
@value cm_grey_200 from colors;
|
|
8
|
+
@value cm_grey_400 from colors;
|
|
9
|
+
|
|
10
|
+
.textBase {
|
|
11
|
+
font-family: "Gilroy";
|
|
12
|
+
font-style: normal;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.backgroundContainer {
|
|
16
|
+
background-color: white;
|
|
17
|
+
min-height: 100%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.container {
|
|
22
|
+
composes: textBase;
|
|
23
|
+
background-color: white;
|
|
24
|
+
font-family: "Gilroy";
|
|
25
|
+
font-style: normal;
|
|
26
|
+
margin-top: 48px;
|
|
27
|
+
margin-bottom: 48px;
|
|
28
|
+
margin-left: auto;
|
|
29
|
+
margin-right: auto;
|
|
30
|
+
padding: 0 16px;
|
|
31
|
+
position: relative;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
min-height: 100%;
|
|
34
|
+
width: 100%;
|
|
35
|
+
max-width: calc(1080px + 40px);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.backButtonWrapper {
|
|
39
|
+
margin-bottom: 16px;
|
|
40
|
+
background-color: cm_grey_100;
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
width: fit-content;
|
|
43
|
+
padding: 8px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ctaContainer {
|
|
48
|
+
display: flex;
|
|
49
|
+
width: 100%;
|
|
50
|
+
justify-content: space-between;
|
|
51
|
+
gap: 40px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.coverWrapper {
|
|
55
|
+
width: 420px;
|
|
56
|
+
height: 280px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.showMoreWrapper {
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.showMoreWrapper {
|
|
65
|
+
align-items: center;
|
|
66
|
+
margin-top: 8px;
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.title {
|
|
72
|
+
margin-top: 8px;
|
|
73
|
+
font-size: 24px;
|
|
74
|
+
font-weight: 700;
|
|
75
|
+
line-height: 32px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.description {
|
|
79
|
+
margin-top: 8px;
|
|
80
|
+
max-width: 620px;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
color: cm_grey_400;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.truncate {
|
|
88
|
+
display: -webkit-box;
|
|
89
|
+
-webkit-line-clamp: 4;
|
|
90
|
+
-webkit-box-orient: vertical;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.continueLearningButton {
|
|
96
|
+
margin-top: 24px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media tablet {
|
|
100
|
+
.ctaContainer {
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media mobile {
|
|
106
|
+
.coverWrapper {
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -26,7 +26,7 @@ declare namespace AllCourses {
|
|
|
26
26
|
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
}
|
|
28
28
|
namespace propTypes {
|
|
29
|
-
const
|
|
29
|
+
const courses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
30
|
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
31
31
|
customStyle: PropTypes.Requireable<{
|
|
32
32
|
[x: string]: string | null | undefined;
|
|
@@ -53,7 +53,7 @@ FilterButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
53
53
|
|
|
54
54
|
const AllCourses = (props, context) => {
|
|
55
55
|
const {
|
|
56
|
-
|
|
56
|
+
courses,
|
|
57
57
|
totalCourses,
|
|
58
58
|
filters,
|
|
59
59
|
sorting
|
|
@@ -65,7 +65,7 @@ const AllCourses = (props, context) => {
|
|
|
65
65
|
const {
|
|
66
66
|
list,
|
|
67
67
|
loading
|
|
68
|
-
} =
|
|
68
|
+
} = courses;
|
|
69
69
|
const {
|
|
70
70
|
translate
|
|
71
71
|
} = context;
|
|
@@ -177,7 +177,7 @@ AllCourses.contextTypes = {
|
|
|
177
177
|
translate: Provider.childContextTypes.translate
|
|
178
178
|
};
|
|
179
179
|
AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
180
|
-
|
|
180
|
+
courses: PropTypes.shape(CardsGrid.propTypes),
|
|
181
181
|
totalCourses: PropTypes.number,
|
|
182
182
|
filters: PropTypes.shape({
|
|
183
183
|
onChange: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","skillIncludedCourses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","course","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","toggledShowCompleted","progress","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {skillIncludedCourses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = skillIncludedCourses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n sortBy(course => -getOr(0, ['progress'], course), list)\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n useEffect(() => {\n setSearchResults(sortBy(course => -getOr(0, ['progress'], course), list));\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const toggledShowCompleted = !showCompleted;\n setShowCompleted(toggledShowCompleted);\n if (toggledShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress === 0));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,SAAtC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,UAAP,MAAuB,4BAAvB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,mBAAP,MAAgC,kCAAhC;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,mBAAlB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,MAAX;IAAmBC;EAAnB,IAA8BJ,KAApC;EACA,MAAM;IAACK;EAAD,IAASJ,OAAf;;EACA,MAAMK,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBD,IAAtB,CAAzB;;EAEA,MAAME,WAAW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AACsB,SAA1B,CADD;EAErBM,YAAY,EAAElC,SAAS,CAACgF,MAFH;EAGrB7C,OAAO,EAAEnC,SAAS,CAAC+E,KAAV,CAAgB;IACvBzC,QAAQ,EAAEtC,SAAS,CAAC+B,IADG;IAEvBM,OAAO,EAAErC,SAAS,CAACiF,OAAV,CAAkBjF,SAAS,CAAC+E,KAAV,CAAgB5E,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAAC+E,KAAV,CAAgB7E,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
|
|
1
|
+
{"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","courses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","course","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","toggledShowCompleted","progress","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {courses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = courses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n sortBy(course => -getOr(0, ['progress'], course), list)\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n useEffect(() => {\n setSearchResults(sortBy(course => -getOr(0, ['progress'], course), list));\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const toggledShowCompleted = !showCompleted;\n setShowCompleted(toggledShowCompleted);\n if (toggledShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress === 0));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n courses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(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X.Element;
|
|
2
|
+
export namespace ContinueLearningButton {
|
|
4
3
|
namespace contextTypes {
|
|
5
4
|
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
5
|
common: PropTypes.Requireable<{
|
|
@@ -26,6 +25,42 @@ declare namespace SkillDetail {
|
|
|
26
25
|
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
26
|
}
|
|
28
27
|
namespace propTypes {
|
|
28
|
+
const ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
|
|
29
|
+
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export default SkillDetail;
|
|
33
|
+
import PropTypes from "prop-types";
|
|
34
|
+
declare function SkillDetail(props: any, context: any): JSX.Element;
|
|
35
|
+
declare namespace SkillDetail {
|
|
36
|
+
export namespace contextTypes_1 {
|
|
37
|
+
const skin_1: PropTypes.Requireable<PropTypes.InferProps<{
|
|
38
|
+
common: PropTypes.Requireable<{
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
}>;
|
|
41
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
42
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
43
|
+
logo: PropTypes.Requireable<any>;
|
|
44
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
45
|
+
login: PropTypes.Requireable<any>;
|
|
46
|
+
}>>;
|
|
47
|
+
icons: PropTypes.Requireable<{
|
|
48
|
+
[x: string]: any;
|
|
49
|
+
}>;
|
|
50
|
+
mod: PropTypes.Requireable<{
|
|
51
|
+
[x: string]: any;
|
|
52
|
+
}>;
|
|
53
|
+
courses: PropTypes.Requireable<any[]>;
|
|
54
|
+
texts: PropTypes.Requireable<{
|
|
55
|
+
[x: string]: any;
|
|
56
|
+
}>;
|
|
57
|
+
}>>;
|
|
58
|
+
export { skin_1 as skin };
|
|
59
|
+
const translate_1: PropTypes.Requireable<(...args: any[]) => any>;
|
|
60
|
+
export { translate_1 as translate };
|
|
61
|
+
}
|
|
62
|
+
export { contextTypes_1 as contextTypes };
|
|
63
|
+
export namespace propTypes_1 {
|
|
29
64
|
const title: PropTypes.Validator<string>;
|
|
30
65
|
const skillRef: PropTypes.Validator<string>;
|
|
31
66
|
const description: PropTypes.Requireable<string>;
|
|
@@ -96,6 +131,6 @@ declare namespace SkillDetail {
|
|
|
96
131
|
const onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
132
|
const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
133
|
}
|
|
134
|
+
export { propTypes_1 as propTypes };
|
|
99
135
|
}
|
|
100
|
-
import PropTypes from "prop-types";
|
|
101
136
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAcO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEA+JC"}
|
|
@@ -11,8 +11,7 @@ import CardsGrid from '../../organism/cards-grid';
|
|
|
11
11
|
import style from './style.css';
|
|
12
12
|
import AllCourses from './all-courses';
|
|
13
13
|
import ContinueLearning from './continue-learning';
|
|
14
|
-
|
|
15
|
-
const ContinueLearningButton = (props, context) => {
|
|
14
|
+
export const ContinueLearningButton = (props, context) => {
|
|
16
15
|
const {
|
|
17
16
|
ongoingCoursesAvailable,
|
|
18
17
|
onClick
|
|
@@ -45,7 +44,6 @@ const ContinueLearningButton = (props, context) => {
|
|
|
45
44
|
onClick: onClick
|
|
46
45
|
}));
|
|
47
46
|
};
|
|
48
|
-
|
|
49
47
|
ContinueLearningButton.contextTypes = {
|
|
50
48
|
skin: Provider.childContextTypes.skin,
|
|
51
49
|
translate: Provider.childContextTypes.translate
|
|
@@ -185,7 +183,7 @@ const SkillDetail = (props, context) => {
|
|
|
185
183
|
}, score.toFixed(1), "%"))))) : null, /*#__PURE__*/React.createElement(ContinueLearning, {
|
|
186
184
|
ongoingCourses: ongoingCourses
|
|
187
185
|
}), /*#__PURE__*/React.createElement(AllCourses, {
|
|
188
|
-
|
|
186
|
+
courses: skillIncludedCourses,
|
|
189
187
|
totalCourses: totalCourses,
|
|
190
188
|
filters: filters,
|
|
191
189
|
sorting: sorting
|