@coorpacademy/components 11.2.13-alpha.2 → 11.2.13-alpha.36
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/atom/lottie-wrapper/index.d.ts.map +1 -1
- package/es/atom/lottie-wrapper/index.js +12 -16
- package/es/atom/lottie-wrapper/index.js.map +1 -1
- package/es/atom/review-background/index.d.ts.map +1 -1
- package/es/atom/review-background/index.js +18 -9
- package/es/atom/review-background/index.js.map +1 -1
- package/es/molecule/add-to-my-list/index.js +3 -1
- package/es/molecule/add-to-my-list/index.js.map +1 -1
- package/es/molecule/card/notification.js +3 -1
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/cm-popin/index.native.d.ts +5 -0
- package/es/molecule/cm-popin/index.native.d.ts.map +1 -0
- package/es/molecule/cm-popin/index.native.js +124 -0
- package/es/molecule/cm-popin/index.native.js.map +1 -0
- package/es/molecule/cm-popin/types.d.ts +3 -3
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/es/molecule/forum/forum-post/index.js +2 -1
- package/es/molecule/forum/forum-post/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.d.ts.map +1 -1
- package/es/molecule/questions/free-text/index.js +1 -2
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/share/index.d.ts.map +1 -1
- package/es/molecule/share/index.js +5 -1
- package/es/molecule/share/index.js.map +1 -1
- package/es/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/es/organism/mobile-navigation/index.native.js +3 -3
- package/es/organism/mobile-navigation/index.native.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +7 -5
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-header/index.native.d.ts.map +1 -1
- package/es/organism/review-header/index.native.js +34 -3
- package/es/organism/review-header/index.native.js.map +1 -1
- package/es/organism/review-slide/index.d.ts.map +1 -1
- package/es/organism/review-slide/index.js +31 -2
- package/es/organism/review-slide/index.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +6 -6
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/organism/user-preferences/index.js +2 -1
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/template/app-review/player/index.native.d.ts.map +1 -1
- package/es/template/app-review/player/index.native.js +4 -2
- package/es/template/app-review/player/index.native.js.map +1 -1
- package/es/template/app-review/skills/index.d.ts.map +1 -1
- package/es/template/app-review/skills/index.js +1 -6
- package/es/template/app-review/skills/index.js.map +1 -1
- package/es/template/app-review/skills/style.css +0 -5
- package/es/template/back-office/brand-update/style.css +1 -0
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +2 -1
- package/es/template/common/search-page/index.js.map +1 -1
- package/lib/atom/lottie-wrapper/index.d.ts.map +1 -1
- package/lib/atom/lottie-wrapper/index.js +13 -16
- package/lib/atom/lottie-wrapper/index.js.map +1 -1
- package/lib/atom/review-background/index.d.ts.map +1 -1
- package/lib/atom/review-background/index.js +18 -9
- package/lib/atom/review-background/index.js.map +1 -1
- package/lib/molecule/add-to-my-list/index.js +3 -1
- package/lib/molecule/add-to-my-list/index.js.map +1 -1
- package/lib/molecule/card/notification.js +3 -1
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/cm-popin/index.native.d.ts +5 -0
- package/lib/molecule/cm-popin/index.native.d.ts.map +1 -0
- package/lib/molecule/cm-popin/index.native.js +141 -0
- package/lib/molecule/cm-popin/index.native.js.map +1 -0
- package/lib/molecule/cm-popin/types.d.ts +3 -3
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/lib/molecule/forum/forum-post/index.js +2 -1
- package/lib/molecule/forum/forum-post/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.d.ts.map +1 -1
- package/lib/molecule/questions/free-text/index.js +1 -2
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/share/index.d.ts.map +1 -1
- package/lib/molecule/share/index.js +5 -1
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/lib/organism/mobile-navigation/index.native.js +2 -2
- package/lib/organism/mobile-navigation/index.native.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +7 -5
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-header/index.native.d.ts.map +1 -1
- package/lib/organism/review-header/index.native.js +36 -3
- package/lib/organism/review-header/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.d.ts.map +1 -1
- package/lib/organism/review-slide/index.js +30 -1
- package/lib/organism/review-slide/index.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +5 -5
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/organism/user-preferences/index.js +2 -1
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/template/app-review/player/index.native.d.ts.map +1 -1
- package/lib/template/app-review/player/index.native.js +5 -2
- package/lib/template/app-review/player/index.native.js.map +1 -1
- package/lib/template/app-review/skills/index.d.ts.map +1 -1
- package/lib/template/app-review/skills/index.js +1 -7
- package/lib/template/app-review/skills/index.js.map +1 -1
- package/lib/template/app-review/skills/style.css +0 -5
- package/lib/template/back-office/brand-update/style.css +1 -0
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +2 -1
- package/lib/template/common/search-page/index.js.map +1 -1
- package/locales/en/global.json +5 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/index.js"],"names":[],"mappings":"AAWO,iMAmCN;;AAED,wDAwGC"}
|
|
@@ -4,6 +4,7 @@ import React, { useMemo, useRef, useEffect, useState } from 'react';
|
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import lottie from 'lottie-web';
|
|
6
6
|
import includes from 'lodash/fp/includes';
|
|
7
|
+
import isNil from 'lodash/fp/isNil';
|
|
7
8
|
import keys from 'lodash/fp/keys';
|
|
8
9
|
import omit from 'lodash/fp/omit';
|
|
9
10
|
import unfetch from 'isomorphic-unfetch';
|
|
@@ -54,19 +55,18 @@ const LottieWrapper = props => {
|
|
|
54
55
|
className: animationClassName,
|
|
55
56
|
hideOnTransparent = true
|
|
56
57
|
} = rendererSettings;
|
|
57
|
-
const containerRef = useRef(null);
|
|
58
|
+
const containerRef = useRef(null);
|
|
59
|
+
const isCancelledRef = useRef(null); // lottie's animation instance
|
|
58
60
|
|
|
59
61
|
const [animationItem, setAnimationItem] = useState(null);
|
|
60
62
|
const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);
|
|
61
63
|
const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);
|
|
62
64
|
const lottieAnimationClassName = useMemo(() => classnames(animationClassName, style.animation), [animationClassName]);
|
|
63
65
|
useEffect(() => {
|
|
64
|
-
|
|
65
|
-
// to remove when the migration towards @testing-library/react is done
|
|
66
|
-
|
|
67
|
-
/* istanbul ignore next */
|
|
68
|
-
if (containerRef.current && includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {
|
|
66
|
+
if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {
|
|
69
67
|
setIsAnimationVisible(true);
|
|
68
|
+
/* istanbul ignore next */
|
|
69
|
+
|
|
70
70
|
if (animationItem) animationItem[animationControl]();
|
|
71
71
|
if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);
|
|
72
72
|
}
|
|
@@ -74,23 +74,19 @@ const LottieWrapper = props => {
|
|
|
74
74
|
useEffect(() => {
|
|
75
75
|
const loadAnimation = async () => {
|
|
76
76
|
/* istanbul ignore else */
|
|
77
|
-
if (!animationItem) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const animation = await fetchAndLoadAnimation(lottie, unfetch, animationSrc, containerRef, loop, lottieAnimationClassName, hideOnTransparent, autoplay);
|
|
84
|
-
containerRef.current && setAnimationItem(animation);
|
|
77
|
+
if (!animationItem && typeof window !== 'undefined') {
|
|
78
|
+
window.lottie = lottie;
|
|
79
|
+
const animation = await fetchAndLoadAnimation(window.lottie, unfetch, animationSrc, containerRef, loop, lottieAnimationClassName, hideOnTransparent, autoplay);
|
|
80
|
+
isNil(isCancelledRef.current) && setAnimationItem(animation);
|
|
85
81
|
}
|
|
86
82
|
};
|
|
87
83
|
|
|
88
84
|
loadAnimation();
|
|
89
85
|
return () => {
|
|
90
|
-
|
|
86
|
+
isCancelledRef.current = true;
|
|
91
87
|
return animationItem &&
|
|
92
88
|
/* istanbul ignore next */
|
|
93
|
-
lottie.destroy(animationItem.name);
|
|
89
|
+
window.lottie.destroy(animationItem.name);
|
|
94
90
|
};
|
|
95
91
|
}, [lottieAnimationClassName, containerRef, hideOnTransparent, loop, animationSrc, animationItem, autoplay]);
|
|
96
92
|
const accessibilityProps = ariaLabel ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useRef","useEffect","useState","classnames","lottie","includes","keys","omit","unfetch","style","propTypes","ANIMATION_CONTROL","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","animationControl","animationClassName","animationItem","setAnimationItem","isAnimationVisible","setIsAnimationVisible","wrapperClassName","lottieContainer","lottieAnimationClassName","stop","window","destroy","name","accessibilityProps","role","maxWidth","maxHeight","opacity","transition"],"sources":["../../../src/atom/lottie-wrapper/index.js"],"sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\n\nexport const fetchAndLoadAnimation = async (\n _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n autoplay = true,\n animationControl\n } = props;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useRef","useEffect","useState","classnames","lottie","includes","isNil","keys","omit","unfetch","style","propTypes","ANIMATION_CONTROL","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","animationControl","animationClassName","isCancelledRef","animationItem","setAnimationItem","isAnimationVisible","setIsAnimationVisible","wrapperClassName","lottieContainer","lottieAnimationClassName","stop","window","destroy","name","accessibilityProps","role","maxWidth","maxHeight","opacity","transition"],"sources":["../../../src/atom/lottie-wrapper/index.js"],"sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport includes from 'lodash/fp/includes';\nimport isNil from 'lodash/fp/isNil';\nimport keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\n\nexport const fetchAndLoadAnimation = async (\n _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n autoplay = true,\n animationControl\n } = props;\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n const isCancelledRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(\n () => classnames(animationClassName, style.animation),\n [animationClassName]\n );\n\n useEffect(() => {\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n /* istanbul ignore next */\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n /* istanbul ignore else */\n if (!animationItem && typeof window !== 'undefined') {\n window.lottie = lottie;\n const animation = await fetchAndLoadAnimation(\n window.lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\n );\n\n isNil(isCancelledRef.current) && setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => {\n isCancelledRef.current = true;\n return animationItem && /* istanbul ignore next */ window.lottie.destroy(animationItem.name);\n };\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n animationItem,\n autoplay\n ]);\n\n const accessibilityProps = ariaLabel\n ? {\n 'aria-label': ariaLabel,\n role: 'img'\n }\n : {\n 'aria-hidden': 'true',\n role: 'presentation'\n };\n\n return (\n <div\n {...accessibilityProps}\n ref={containerRef}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n }),\n opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\n }}\n />\n );\n};\n\nLottieWrapper.propTypes = propTypes;\n\nexport default LottieWrapper;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,MAAxB,EAAgCC,SAAhC,EAA2CC,QAA3C,QAA0D,OAA1D;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,YAAnB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAO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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-background/index.js"],"names":[],"mappings":";AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-background/index.js"],"names":[],"mappings":";AAIA,2DAmBC"}
|
|
@@ -8,23 +8,32 @@ const ReviewBackground = props => {
|
|
|
8
8
|
} = props;
|
|
9
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
10
10
|
className: style.mainContainer,
|
|
11
|
-
"aria-label": ariaLabel
|
|
11
|
+
"aria-label": ariaLabel,
|
|
12
|
+
tabIndex: -1
|
|
12
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
-
className: style.container
|
|
14
|
+
className: style.container,
|
|
15
|
+
tabIndex: -1
|
|
14
16
|
}, /*#__PURE__*/React.createElement("span", {
|
|
15
|
-
className: style.interrogationLeft
|
|
17
|
+
className: style.interrogationLeft,
|
|
18
|
+
tabIndex: -1
|
|
16
19
|
}, "?"), /*#__PURE__*/React.createElement("span", {
|
|
17
|
-
className: style.interrogationRight
|
|
20
|
+
className: style.interrogationRight,
|
|
21
|
+
tabIndex: -1
|
|
18
22
|
}, "?"), /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: style.recYellow
|
|
23
|
+
className: style.recYellow,
|
|
24
|
+
tabIndex: -1
|
|
20
25
|
}), /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: style.recRed
|
|
26
|
+
className: style.recRed,
|
|
27
|
+
tabIndex: -1
|
|
22
28
|
}), /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: style.recBlue
|
|
29
|
+
className: style.recBlue,
|
|
30
|
+
tabIndex: -1
|
|
24
31
|
}), /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
className: style.recGreen
|
|
32
|
+
className: style.recGreen,
|
|
33
|
+
tabIndex: -1
|
|
26
34
|
}), /*#__PURE__*/React.createElement("div", {
|
|
27
|
-
className: style.recGreenLight
|
|
35
|
+
className: style.recGreenLight,
|
|
36
|
+
tabIndex: -1
|
|
28
37
|
})));
|
|
29
38
|
};
|
|
30
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","style","propTypes","ReviewBackground","props","ariaLabel","mainContainer","container","interrogationLeft","interrogationRight","recYellow","recRed","recBlue","recGreen","recGreenLight"],"sources":["../../../src/atom/review-background/index.js"],"sourcesContent":["import React from 'react';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ReviewBackground = props => {\n const {'aria-label': ariaLabel} = props;\n return (\n <div className={style.mainContainer} aria-label={ariaLabel}>\n <div className={style.container}>\n <span className={style.interrogationLeft}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","style","propTypes","ReviewBackground","props","ariaLabel","mainContainer","container","interrogationLeft","interrogationRight","recYellow","recRed","recBlue","recGreen","recGreenLight"],"sources":["../../../src/atom/review-background/index.js"],"sourcesContent":["import React from 'react';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ReviewBackground = props => {\n const {'aria-label': ariaLabel} = props;\n return (\n <div className={style.mainContainer} aria-label={ariaLabel} tabIndex={-1}>\n <div className={style.container} tabIndex={-1}>\n <span className={style.interrogationLeft} tabIndex={-1}>\n ?\n </span>\n <span className={style.interrogationRight} tabIndex={-1}>\n ?\n </span>\n <div className={style.recYellow} tabIndex={-1} />\n <div className={style.recRed} tabIndex={-1} />\n <div className={style.recBlue} tabIndex={-1} />\n <div className={style.recGreen} tabIndex={-1} />\n <div className={style.recGreenLight} tabIndex={-1} />\n </div>\n </div>\n );\n};\n\nReviewBackground.propTypes = propTypes;\n\nexport default ReviewBackground;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AAEA,MAAMC,gBAAgB,GAAGC,KAAK,IAAI;EAChC,MAAM;IAAC,cAAcC;EAAf,IAA4BD,KAAlC;EACA,oBACE;IAAK,SAAS,EAAEH,KAAK,CAACK,aAAtB;IAAqC,cAAYD,SAAjD;IAA4D,QAAQ,EAAE,CAAC;EAAvE,gBACE;IAAK,SAAS,EAAEJ,KAAK,CAACM,SAAtB;IAAiC,QAAQ,EAAE,CAAC;EAA5C,gBACE;IAAM,SAAS,EAAEN,KAAK,CAACO,iBAAvB;IAA0C,QAAQ,EAAE,CAAC;EAArD,OADF,eAIE;IAAM,SAAS,EAAEP,KAAK,CAACQ,kBAAvB;IAA2C,QAAQ,EAAE,CAAC;EAAtD,OAJF,eAOE;IAAK,SAAS,EAAER,KAAK,CAACS,SAAtB;IAAiC,QAAQ,EAAE,CAAC;EAA5C,EAPF,eAQE;IAAK,SAAS,EAAET,KAAK,CAACU,MAAtB;IAA8B,QAAQ,EAAE,CAAC;EAAzC,EARF,eASE;IAAK,SAAS,EAAEV,KAAK,CAACW,OAAtB;IAA+B,QAAQ,EAAE,CAAC;EAA1C,EATF,eAUE;IAAK,SAAS,EAAEX,KAAK,CAACY,QAAtB;IAAgC,QAAQ,EAAE,CAAC;EAA3C,EAVF,eAWE;IAAK,SAAS,EAAEZ,KAAK,CAACa,aAAtB;IAAqC,QAAQ,EAAE,CAAC;EAAhD,EAXF,CADF,CADF;AAiBD,CAnBD;;AAqBAX,gBAAgB,CAACD,SAAjB,2CAA6BA,SAA7B;AAEA,eAAeC,gBAAf"}
|
|
@@ -42,7 +42,9 @@ export const AddToMyListFeedback = ({
|
|
|
42
42
|
className: styles.checkIcon,
|
|
43
43
|
width: 13,
|
|
44
44
|
height: 13
|
|
45
|
-
}), /*#__PURE__*/React.createElement("p",
|
|
45
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
46
|
+
role: "status"
|
|
47
|
+
}, favorite ? addToMyListText : removeFromMyListText));
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
const AddToMyList = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useContext","useEffect","useMemo","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionNavigationMore","MoreIcon","Link","styles","ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","createContext","AddToMyListStatusProvider","children","status","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p>{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\n\nexport default AddToMyList;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,UAAzB,EAAqCC,SAArC,EAAgDC,OAAhD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,6BAA6B,IAAIC,QAFnC,QAGO,0BAHP;AAIA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,MAAMC,qBAAqB,GAAG;EAC5BC,IAAI,EAAE,MADsB;EAE5BC,OAAO,EAAE;AAFmB,CAA9B;AAKA,MAAMC,aAAa,gBAAGhB,KAAK,CAACiB,aAAN,CAAoBJ,qBAAqB,CAACC,IAA1C,CAAtB;AAEA,OAAO,MAAMI,yBAAyB,GAAG,CAAC;EAACC;AAAD,CAAD,KAAgB;EACvD,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBpB,QAAQ,CAACY,qBAAqB,CAACC,IAAvB,CAApC;EACAX,SAAS,CAAC,MAAM;IACd,IAAImB,SAAJ;IACA,MAAMC,QAAQ,GAAG,IAAjB;;IACA,IAAIH,MAAM,KAAKP,qBAAqB,CAACC,IAArC,EAA2C;MACzCQ,SAAS,GAAGE,UAAU,CAAC,MAAMH,SAAS,CAACR,qBAAqB,CAACC,IAAvB,CAAhB,EAA8CS,QAA9C,CAAtB;IACD;;IACD,OAAO,MAAME,YAAY,CAACH,SAAD,CAAzB;EACD,CAPQ,EAON,CAACF,MAAD,CAPM,CAAT;EAQA,MAAMM,WAAW,GAAGtB,OAAO,CAAC,MAAM,CAACgB,MAAD,EAASC,SAAT,CAAP,EAA4B,CAACD,MAAD,EAASC,SAAT,CAA5B,CAA3B;EACA,oBAAO,oBAAC,aAAD,CAAe,QAAf;IAAwB,KAAK,EAAEK;EAA/B,GAA6CP,QAA7C,CAAP;AACD,CAZM;AAcP,OAAO,MAAMQ,mBAAmB,GAAG,CAAC;EAACC,eAAD;EAAkBC,oBAAlB;EAAwCC;AAAxC,CAAD,KAAuD;EACxF,MAAM,CAACV,MAAD,IAAWlB,UAAU,CAACc,aAAD,CAA3B;EACA,IAAII,MAAM,KAAKP,qBAAqB,CAACC,IAArC,EAA2C,OAAO,IAAP;EAE3C,oBACE;IAAK,SAAS,EAAER,UAAU,CAACM,MAAM,CAACmB,QAAR,CAA1B;IAA6C,aAAW;EAAxD,gBACE,oBAAC,SAAD;IAAW,SAAS,EAAEnB,MAAM,CAACoB,SAA7B;IAAwC,KAAK,EAAE,EAA/C;IAAmD,MAAM,EAAE;EAA3D,EADF,eAEE
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useContext","useEffect","useMemo","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionNavigationMore","MoreIcon","Link","styles","ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","createContext","AddToMyListStatusProvider","children","status","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p role=\"status\">{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\n\nexport default AddToMyList;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,UAAzB,EAAqCC,SAArC,EAAgDC,OAAhD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,6BAA6B,IAAIC,QAFnC,QAGO,0BAHP;AAIA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,MAAMC,qBAAqB,GAAG;EAC5BC,IAAI,EAAE,MADsB;EAE5BC,OAAO,EAAE;AAFmB,CAA9B;AAKA,MAAMC,aAAa,gBAAGhB,KAAK,CAACiB,aAAN,CAAoBJ,qBAAqB,CAACC,IAA1C,CAAtB;AAEA,OAAO,MAAMI,yBAAyB,GAAG,CAAC;EAACC;AAAD,CAAD,KAAgB;EACvD,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBpB,QAAQ,CAACY,qBAAqB,CAACC,IAAvB,CAApC;EACAX,SAAS,CAAC,MAAM;IACd,IAAImB,SAAJ;I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
|
|
41
41
|
className: style.message
|
|
42
|
-
}, /*#__PURE__*/React.createElement("span",
|
|
42
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
role: "status"
|
|
44
|
+
}, message))));
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","names":["React","PropTypes","classnames","NovaCompositionNavigationMore","MoreIcon","NovaSolidLoginLocked","LockIcon","NovaSolidLocksLockUnlock1","UnlockIcon","NovaCompositionCoorpacademyCheck","CheckIcon","style","NOTIFICATION_ICON","addFavorite","removeFavorite","lock","unlock","handleOverlayClick","e","stopPropagation","preventDefault","Notification","props","message","icon","IconType","showOverlay","notificationWrapper","notification","propTypes","string","isRequired","oneOf"],"sources":["../../../src/molecule/card/notification.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaSolidLoginLocked as LockIcon,\n NovaSolidLocksLockUnlock1 as UnlockIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport style from './notification.css';\n\nconst NOTIFICATION_ICON = {\n addFavorite: CheckIcon,\n removeFavorite: MoreIcon,\n lock: LockIcon,\n unlock: UnlockIcon\n};\n\nconst handleOverlayClick = e => {\n e.stopPropagation();\n e.preventDefault();\n return false;\n};\n\nconst Notification = props => {\n const {message, icon} = props;\n\n const IconType = get(icon, NOTIFICATION_ICON);\n return (\n <div\n data-name=\"notification\"\n data-type={icon}\n onClick={handleOverlayClick}\n className={classnames(style.showOverlay, style.notificationWrapper)}\n >\n <div className={style.notification}>\n <IconType className={style.icon} color={null} stroke={null} />\n <div className={style.message}>\n <span>{message}</span>\n </div>\n </div>\n </div>\n );\n};\nNotification.propTypes = {\n message: PropTypes.string.isRequired,\n icon: PropTypes.oneOf(keys(NOTIFICATION_ICON)).isRequired\n};\n\nexport default Notification;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,6BAA6B,IAAIC,QADnC,EAEEC,oBAAoB,IAAIC,QAF1B,EAGEC,yBAAyB,IAAIC,UAH/B,EAIEC,gCAAgC,IAAIC,SAJtC,QAKO,0BALP;AAMA,OAAOC,KAAP,MAAkB,oBAAlB;AAEA,MAAMC,iBAAiB,GAAG;EACxBC,WAAW,EAAEH,SADW;EAExBI,cAAc,EAAEV,QAFQ;EAGxBW,IAAI,EAAET,QAHkB;EAIxBU,MAAM,EAAER;AAJgB,CAA1B;;AAOA,MAAMS,kBAAkB,GAAGC,CAAC,IAAI;EAC9BA,CAAC,CAACC,eAAF;EACAD,CAAC,CAACE,cAAF;EACA,OAAO,KAAP;AACD,CAJD;;AAMA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAkBF,KAAxB;;EAEA,MAAMG,QAAQ,GAAG,KAAID,IAAJ,EAAUZ,iBAAV,CAAjB;;EACA,oBACE;IACE,aAAU,cADZ;IAEE,aAAWY,IAFb;IAGE,OAAO,EAAEP,kBAHX;IAIE,SAAS,EAAEf,UAAU,CAACS,KAAK,CAACe,WAAP,EAAoBf,KAAK,CAACgB,mBAA1B;EAJvB,gBAME;IAAK,SAAS,EAAEhB,KAAK,CAACiB;EAAtB,gBACE,oBAAC,QAAD;IAAU,SAAS,EAAEjB,KAAK,CAACa,IAA3B;IAAiC,KAAK,EAAE,IAAxC;IAA8C,MAAM,EAAE;EAAtD,EADF,eAEE;IAAK,SAAS,EAAEb,KAAK,CAACY;EAAtB,gBACE,
|
|
1
|
+
{"version":3,"file":"notification.js","names":["React","PropTypes","classnames","NovaCompositionNavigationMore","MoreIcon","NovaSolidLoginLocked","LockIcon","NovaSolidLocksLockUnlock1","UnlockIcon","NovaCompositionCoorpacademyCheck","CheckIcon","style","NOTIFICATION_ICON","addFavorite","removeFavorite","lock","unlock","handleOverlayClick","e","stopPropagation","preventDefault","Notification","props","message","icon","IconType","showOverlay","notificationWrapper","notification","propTypes","string","isRequired","oneOf"],"sources":["../../../src/molecule/card/notification.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaSolidLoginLocked as LockIcon,\n NovaSolidLocksLockUnlock1 as UnlockIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport style from './notification.css';\n\nconst NOTIFICATION_ICON = {\n addFavorite: CheckIcon,\n removeFavorite: MoreIcon,\n lock: LockIcon,\n unlock: UnlockIcon\n};\n\nconst handleOverlayClick = e => {\n e.stopPropagation();\n e.preventDefault();\n return false;\n};\n\nconst Notification = props => {\n const {message, icon} = props;\n\n const IconType = get(icon, NOTIFICATION_ICON);\n return (\n <div\n data-name=\"notification\"\n data-type={icon}\n onClick={handleOverlayClick}\n className={classnames(style.showOverlay, style.notificationWrapper)}\n >\n <div className={style.notification}>\n <IconType className={style.icon} color={null} stroke={null} />\n <div className={style.message}>\n <span role=\"status\">{message}</span>\n </div>\n </div>\n </div>\n );\n};\nNotification.propTypes = {\n message: PropTypes.string.isRequired,\n icon: PropTypes.oneOf(keys(NOTIFICATION_ICON)).isRequired\n};\n\nexport default Notification;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,6BAA6B,IAAIC,QADnC,EAEEC,oBAAoB,IAAIC,QAF1B,EAGEC,yBAAyB,IAAIC,UAH/B,EAIEC,gCAAgC,IAAIC,SAJtC,QAKO,0BALP;AAMA,OAAOC,KAAP,MAAkB,oBAAl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AM,SAAS,CAAC;AA4ErC,QAAA,MAAM,eAAe,UAAW,YAAY,uBAgD3C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Text, StyleSheet, View } from 'react-native';
|
|
3
|
+
import Modal from 'react-native-modal';
|
|
4
|
+
import { NovaSolidSpaceMoonRocket as MoonRocket } from '@coorpacademy/nova-icons';
|
|
5
|
+
import Touchable from '../../hoc/touchable/index.native';
|
|
6
|
+
import { useTemplateContext } from '../../template/app-review/template-context';
|
|
7
|
+
|
|
8
|
+
const createStyleSheet = theme => StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
backgroundColor: 'rgba(255, 255, 255, 1)',
|
|
11
|
+
borderRadius: 20,
|
|
12
|
+
width: '90%',
|
|
13
|
+
maxHeight: '50%',
|
|
14
|
+
marginTop: '70%'
|
|
15
|
+
},
|
|
16
|
+
wrapper: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
marginVertical: theme.spacing.large,
|
|
20
|
+
marginHorizontal: theme.spacing.base
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
width: 76,
|
|
24
|
+
height: 76
|
|
25
|
+
},
|
|
26
|
+
content: {
|
|
27
|
+
color: '#1D1D2B',
|
|
28
|
+
fontWeight: theme.fontWeight.bold,
|
|
29
|
+
fontSize: 20,
|
|
30
|
+
lineHeight: 28,
|
|
31
|
+
marginVertical: theme.spacing.small
|
|
32
|
+
},
|
|
33
|
+
descriptionText: {
|
|
34
|
+
color: '#515161',
|
|
35
|
+
fontWeight: theme.fontWeight.semiBold,
|
|
36
|
+
fontSize: 14,
|
|
37
|
+
lineHeight: 20,
|
|
38
|
+
textAlign: 'center'
|
|
39
|
+
},
|
|
40
|
+
buttonContainer: {
|
|
41
|
+
marginHorizontal: theme.spacing.base
|
|
42
|
+
},
|
|
43
|
+
buttonText: {
|
|
44
|
+
fontWeight: theme.fontWeight.bold,
|
|
45
|
+
fontSize: 14,
|
|
46
|
+
lineHeight: 20,
|
|
47
|
+
marginVertical: 12,
|
|
48
|
+
textAlign: 'center'
|
|
49
|
+
},
|
|
50
|
+
secondButton: {
|
|
51
|
+
backgroundColor: theme.colors.cta,
|
|
52
|
+
borderRadius: 7,
|
|
53
|
+
marginBottom: theme.spacing.small
|
|
54
|
+
},
|
|
55
|
+
secondButtonText: {
|
|
56
|
+
color: theme.colors.white
|
|
57
|
+
},
|
|
58
|
+
firstButton: {
|
|
59
|
+
borderRadius: 7,
|
|
60
|
+
marginBottom: theme.spacing.small
|
|
61
|
+
},
|
|
62
|
+
firstButtonText: {
|
|
63
|
+
color: '#ED3436'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const QuitPopinReview = props => {
|
|
68
|
+
const {
|
|
69
|
+
content,
|
|
70
|
+
descriptionText,
|
|
71
|
+
firstButton,
|
|
72
|
+
secondButton
|
|
73
|
+
} = props;
|
|
74
|
+
const templateContext = useTemplateContext();
|
|
75
|
+
const [styleSheet, setStylesheet] = useState(null);
|
|
76
|
+
const {
|
|
77
|
+
theme
|
|
78
|
+
} = templateContext;
|
|
79
|
+
const isVisible = true;
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const _stylesheet = createStyleSheet(theme);
|
|
82
|
+
|
|
83
|
+
setStylesheet(_stylesheet);
|
|
84
|
+
}, [theme]);
|
|
85
|
+
|
|
86
|
+
if (!styleSheet) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
91
|
+
isVisible: isVisible,
|
|
92
|
+
style: styleSheet.container,
|
|
93
|
+
testID: "podcast-popin-intro"
|
|
94
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
style: styleSheet.wrapper
|
|
96
|
+
}, /*#__PURE__*/React.createElement(MoonRocket, {
|
|
97
|
+
style: styleSheet.icon,
|
|
98
|
+
color: "#06265B"
|
|
99
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
100
|
+
style: styleSheet.content
|
|
101
|
+
}, content), /*#__PURE__*/React.createElement(Text, {
|
|
102
|
+
style: styleSheet.descriptionText
|
|
103
|
+
}, descriptionText)), /*#__PURE__*/React.createElement(View, {
|
|
104
|
+
style: styleSheet.buttonContainer
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
106
|
+
style: styleSheet.secondButton,
|
|
107
|
+
onPress: secondButton?.handleOnclick,
|
|
108
|
+
accessibilityLabel: secondButton?.['aria-label'],
|
|
109
|
+
testID: "second-button"
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
111
|
+
style: [styleSheet.buttonText, styleSheet.secondButtonText]
|
|
112
|
+
}, secondButton?.label)), /*#__PURE__*/React.createElement(Touchable, {
|
|
113
|
+
style: styleSheet.firstButton,
|
|
114
|
+
isHighlight: true,
|
|
115
|
+
onPress: firstButton?.handleOnclick,
|
|
116
|
+
accessibilityLabel: firstButton?.['aria-label'],
|
|
117
|
+
testID: "first-button"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
119
|
+
style: [styleSheet.buttonText, styleSheet.firstButtonText]
|
|
120
|
+
}, firstButton?.label))));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default QuitPopinReview;
|
|
124
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Text","StyleSheet","View","Modal","NovaSolidSpaceMoonRocket","MoonRocket","Touchable","useTemplateContext","createStyleSheet","theme","create","container","backgroundColor","borderRadius","width","maxHeight","marginTop","wrapper","display","alignItems","marginVertical","spacing","large","marginHorizontal","base","icon","height","content","color","fontWeight","bold","fontSize","lineHeight","small","descriptionText","semiBold","textAlign","buttonContainer","buttonText","secondButton","colors","cta","marginBottom","secondButtonText","white","firstButton","firstButtonText","QuitPopinReview","props","templateContext","styleSheet","setStylesheet","isVisible","_stylesheet","handleOnclick","label"],"sources":["../../../src/molecule/cm-popin/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {Text, TextStyle, StyleSheet, View, ViewStyle} from 'react-native';\nimport Modal from 'react-native-modal';\nimport {NovaSolidSpaceMoonRocket as MoonRocket} from '@coorpacademy/nova-icons';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {CMPopinProps} from './types';\n\ninterface StyleSheetType {\n container: ViewStyle;\n wrapper: ViewStyle;\n icon: ViewStyle;\n content: TextStyle;\n descriptionText: TextStyle;\n buttonContainer: ViewStyle;\n buttonText: TextStyle;\n firstButton: ViewStyle;\n firstButtonText: TextStyle;\n secondButton: ViewStyle;\n secondButtonText: TextStyle;\n}\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: 'rgba(255, 255, 255, 1)',\n borderRadius: 20,\n width: '90%',\n maxHeight: '50%',\n marginTop: '70%'\n },\n wrapper: {\n display: 'flex',\n alignItems: 'center',\n marginVertical: theme.spacing.large,\n marginHorizontal: theme.spacing.base\n },\n icon: {\n width: 76,\n height: 76\n },\n content: {\n color: '#1D1D2B',\n fontWeight: theme.fontWeight.bold,\n fontSize: 20,\n lineHeight: 28,\n marginVertical: theme.spacing.small\n },\n descriptionText: {\n color: '#515161',\n fontWeight: theme.fontWeight.semiBold,\n fontSize: 14,\n lineHeight: 20,\n textAlign: 'center'\n },\n buttonContainer: {\n marginHorizontal: theme.spacing.base\n },\n buttonText: {\n fontWeight: theme.fontWeight.bold,\n fontSize: 14,\n lineHeight: 20,\n marginVertical: 12,\n textAlign: 'center'\n },\n secondButton: {\n backgroundColor: theme.colors.cta,\n borderRadius: 7,\n marginBottom: theme.spacing.small\n },\n secondButtonText: {\n color: theme.colors.white\n },\n firstButton: {\n borderRadius: 7,\n marginBottom: theme.spacing.small\n },\n firstButtonText: {\n color: '#ED3436'\n }\n });\n\nconst QuitPopinReview = (props: CMPopinProps) => {\n const {content, descriptionText, firstButton, secondButton} = props;\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n const isVisible = true;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <Modal isVisible={isVisible} style={styleSheet.container} testID=\"podcast-popin-intro\">\n <View style={styleSheet.wrapper}>\n <MoonRocket style={styleSheet.icon} color=\"#06265B\" />\n <Text style={styleSheet.content}>{content}</Text>\n <Text style={styleSheet.descriptionText}>{descriptionText}</Text>\n </View>\n <View style={styleSheet.buttonContainer}>\n <Touchable\n style={styleSheet.secondButton}\n onPress={secondButton?.handleOnclick}\n accessibilityLabel={secondButton?.['aria-label']}\n testID=\"second-button\"\n >\n <Text style={[styleSheet.buttonText, styleSheet.secondButtonText]}>\n {secondButton?.label}\n </Text>\n </Touchable>\n <Touchable\n style={styleSheet.firstButton}\n isHighlight\n onPress={firstButton?.handleOnclick}\n accessibilityLabel={firstButton?.['aria-label']}\n testID=\"first-button\"\n >\n <Text style={[styleSheet.buttonText, styleSheet.firstButtonText]}>\n {firstButton?.label}\n </Text>\n </Touchable>\n </View>\n </Modal>\n );\n};\n\nexport default QuitPopinReview;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,IAAR,EAAyBC,UAAzB,EAAqCC,IAArC,QAA2D,cAA3D;AACA,OAAOC,KAAP,MAAkB,oBAAlB;AACA,SAAQC,wBAAwB,IAAIC,UAApC,QAAqD,0BAArD;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;;AAiBA,MAAMC,gBAAgB,GAAIC,KAAD,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EAAxB,GAA0CA,eAA1C,CAHF,CADF,eAME,oBAAC,IAAD;IAAM,KAAK,EAAEgB,UAAU,CAACb;EAAxB,gBACE,oBAAC,SAAD;IACE,KAAK,EAAEa,UAAU,CAACX,YADpB;IAEE,OAAO,EAAEA,YAAY,EAAEe,aAFzB;IAGE,kBAAkB,EAAEf,YAAY,GAAG,YAAH,CAHlC;IAIE,MAAM,EAAC;EAJT,gBAME,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACW,UAAU,CAACZ,UAAZ,EAAwBY,UAAU,CAACP,gBAAnC;EAAb,GACGJ,YAAY,EAAEgB,KADjB,CANF,CADF,eAWE,oBAAC,SAAD;IACE,KAAK,EAAEL,UAAU,CAACL,WADpB;IAEE,WAAW,MAFb;IAGE,OAAO,EAAEA,WAAW,EAAES,aAHxB;IAIE,kBAAkB,EAAET,WAAW,GAAG,YAAH,CAJjC;IAKE,MAAM,EAAC;EALT,gBAOE,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACK,UAAU,CAACZ,UAAZ,EAAwBY,UAAU,CAACJ,eAAnC;EAAb,GACGD,WAAW,EAAEU,KADhB,CAPF,CAXF,CANF,CADF;AAgCD,CAhDD;;AAkDA,eAAeR,eAAf"}
|
|
@@ -49,7 +49,7 @@ declare const propTypes: {
|
|
|
49
49
|
requiredSelection: PropTypes.Requireable<boolean>;
|
|
50
50
|
}> | null | undefined)[]>;
|
|
51
51
|
};
|
|
52
|
-
declare type QuitPopinButton = {
|
|
52
|
+
export declare type QuitPopinButton = {
|
|
53
53
|
'aria-label'?: string;
|
|
54
54
|
label: string;
|
|
55
55
|
type: string;
|
|
@@ -64,8 +64,8 @@ export declare type CMPopinProps = {
|
|
|
64
64
|
icon: string;
|
|
65
65
|
mode: string;
|
|
66
66
|
descriptionText: string;
|
|
67
|
-
firstButton
|
|
68
|
-
secondButton
|
|
67
|
+
firstButton?: QuitPopinButton;
|
|
68
|
+
secondButton?: QuitPopinButton;
|
|
69
69
|
};
|
|
70
70
|
export default propTypes;
|
|
71
71
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCd,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;CAChC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","Cta","InputSwitch","propTypes","content","string","mode","oneOf","header","firstButton","shape","label","handleOnclick","func","largeButton","bool","type","customStyle","secondButton","thirdButton","onClose","icon","backgroundImageUrl","descriptionText","cookieTitle","descriptionBtnTxt","listBtnSwicth","arrayOf"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Cta from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: Cta.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))\n};\n\
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","Cta","InputSwitch","propTypes","content","string","mode","oneOf","header","firstButton","shape","label","handleOnclick","func","largeButton","bool","type","customStyle","secondButton","thirdButton","onClose","icon","backgroundImageUrl","descriptionText","cookieTitle","descriptionBtnTxt","listBtnSwicth","arrayOf"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Cta from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: Cta.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))\n};\n\nexport type QuitPopinButton = {\n 'aria-label'?: string;\n label: string;\n type: string;\n customStyle?: {\n backgroundColor?: string;\n color?: string;\n };\n handleOnclick: () => void;\n};\n\nexport type CMPopinProps = {\n content: string;\n icon: string;\n mode: string;\n descriptionText: string;\n firstButton?: QuitPopinButton;\n secondButton?: QuitPopinButton;\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AAEA,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEJ,SAAS,CAACK,MADH;EAEhBC,IAAI,EAAEN,SAAS,CAACO,KAAV,CAAgB,CAAC,OAAD,EAAU,aAAV,EAAyB,QAAzB,CAAhB,CAFU;EAGhBC,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8BhBiB,kBAAkB,EAAEtB,SAAS,CAACK,MA9Bd;EA+BhBkB,eAAe,EAAEvB,SAAS,CAACK,MA/BX;EAgChBmB,WAAW,EAAExB,SAAS,CAACK,MAhCP;EAiChBoB,iBAAiB,EAAEzB,SAAS,CAACK,MAjCb;EAkChBqB,aAAa,EAAE1B,SAAS,CAAC2B,OAAV,CAAkB3B,SAAS,CAACU,KAAV,CAAgBR,WAAW,CAACC,SAA5B,CAAlB;AAlCC,CAAlB;AAyDA,eAAeA,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-post/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-post/index.js"],"names":[],"mappings":";AAUA,kEAkJC"}
|
|
@@ -113,7 +113,8 @@ const ForumPost = (props, context) => {
|
|
|
113
113
|
display: rejectable ? 'block' : 'none'
|
|
114
114
|
}
|
|
115
115
|
}, rejected ? putBackLabel : rejectLabel), /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
className: messageClassName
|
|
116
|
+
className: messageClassName,
|
|
117
|
+
role: "status"
|
|
117
118
|
}, deleted ? infoDeleted : message), /*#__PURE__*/React.createElement("div", {
|
|
118
119
|
className: `${style.edition} ${showEditBox ? style.visible : ''}`
|
|
119
120
|
}, /*#__PURE__*/React.createElement(ForumComment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","PropTypes","SrcPropType","Provider","Picture","ForumComment","style","ForumPost","props","context","translate","skin","id","author","avatar","avatarAlt","profileAvatarAlt","date","message","answer","answerPostDisabled","answerTextareaDisabled","answerAvatar","answerable","editable","rejectable","mainPost","rejected","deleted","edition","editionPostDisabled","editionTextareaDisabled","showAnswerBox","showEditBox","onAnswer","onEdit","onPostAnswer","onPostEdition","onChangeAnswer","onChangeEdition","onModerate","onDelete","color","infoDeleted","answerLabel","editLabel","deleteLabel","rejectLabel","putBackLabel","messageClassName","deletedMessage","hiddenMessage","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","childContextTypes","propTypes","string","bool","func"],"sources":["../../../../src/molecule/forum/forum-post/index.js"],"sourcesContent":["import React from 'react';\nimport {get, identity} from 'lodash/fp';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Picture from '../../../atom/picture';\nimport ForumComment from '../forum-comment';\nimport style from './style.css';\n\nconst ForumPost = (props, context) => {\n const {translate, skin} = context;\n const {\n id,\n author,\n avatar,\n avatarAlt,\n profileAvatarAlt,\n date,\n message,\n answer,\n answerPostDisabled = false,\n answerTextareaDisabled = false,\n answerAvatar,\n answerable = true,\n editable = false,\n rejectable = false,\n mainPost = false,\n rejected = false,\n deleted = false,\n edition,\n editionPostDisabled = false,\n editionTextareaDisabled = false,\n showAnswerBox = false,\n showEditBox = false,\n onAnswer = identity,\n onEdit = identity,\n onPostAnswer = identity,\n onPostEdition = identity,\n onChangeAnswer = identity,\n onChangeEdition = identity,\n onModerate,\n onDelete\n } = props;\n const color = get('common.primary', skin);\n\n const infoDeleted = translate('This message has been removed by its author');\n const answerLabel = translate('Answer');\n const editLabel = translate('Edit');\n const deleteLabel = translate('Delete');\n const rejectLabel = translate('Reject');\n const putBackLabel = translate('Put back');\n let messageClassName = style.message;\n if (deleted) {\n messageClassName = style.deletedMessage;\n } else if (showEditBox) {\n messageClassName = style.hiddenMessage;\n }\n\n return (\n <div\n data-name=\"forumPost\"\n id={`forum-post-${id || 'to-be-posted'}`}\n className={classnames(\n mainPost ? style.mainPost : null,\n rejected ? style.rejected : style.post\n )}\n >\n <div className={style.avatarWrapper}>\n <div className={style.image}>\n <Picture src={avatar} className={style.avatar} alt={avatarAlt} />\n </div>\n <span data-name=\"author\" className={style.author}>\n {author}\n </span>\n </div>\n <div className={style.content}>\n <div>\n <span className={style.date}>{date}</span>\n </div>\n <div className={style.body}>\n <span\n className={style.action}\n onClick={onAnswer}\n style={{\n color,\n display: answerable && !deleted && !rejected ? 'block' : 'none'\n }}\n >\n {answerLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onEdit}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {editLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onDelete}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {deleteLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onModerate}\n style={{\n color,\n display: rejectable ? 'block' : 'none'\n }}\n >\n {rejected ? putBackLabel : rejectLabel}\n </span>\n\n <div className={messageClassName}>{deleted ? infoDeleted : message}</div>\n\n <div className={`${style.edition} ${showEditBox ? style.visible : ''}`}>\n <ForumComment\n avatar={null}\n profileAvatarAlt={profileAvatarAlt}\n value={edition}\n textareaDisabled={editionTextareaDisabled}\n postDisabled={editionPostDisabled}\n onPost={onPostEdition}\n onChange={onChangeEdition}\n />\n </div>\n\n <div className={`${style.answer} ${showAnswerBox ? style.visible : ''}`}>\n <ForumComment\n avatar={answerAvatar}\n profileAvatarAlt={profileAvatarAlt}\n textareaDisabled={answerTextareaDisabled}\n postDisabled={answerPostDisabled}\n value={answer}\n onPost={onPostAnswer}\n onChange={onChangeAnswer}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nForumPost.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumPost.propTypes = {\n id: PropTypes.string,\n author: PropTypes.string,\n avatarAlt: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n date: PropTypes.string,\n message: PropTypes.string,\n avatar: SrcPropType,\n answerAvatar: SrcPropType,\n answer: PropTypes.string,\n edition: PropTypes.string,\n showAnswerBox: PropTypes.bool,\n showEditBox: PropTypes.bool,\n mainPost: PropTypes.bool,\n onAnswer: PropTypes.func,\n onEdit: PropTypes.func,\n onPostAnswer: PropTypes.func,\n onPostEdition: PropTypes.func,\n onChangeAnswer: PropTypes.func,\n onChangeEdition: PropTypes.func,\n onModerate: PropTypes.func,\n onDelete: PropTypes.func,\n answerPostDisabled: PropTypes.bool,\n answerTextareaDisabled: PropTypes.bool,\n answerable: PropTypes.bool,\n editable: PropTypes.bool,\n rejectable: PropTypes.bool,\n rejected: PropTypes.bool,\n deleted: PropTypes.bool,\n editionPostDisabled: PropTypes.bool,\n editionTextareaDisabled: PropTypes.bool\n};\n\nexport default ForumPost;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,WAAR,QAA0B,yBAA1B;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,EADI;IAEJC,MAFI;IAGJC,MAHI;IAIJC,SAJI;IAKJC,gBALI;IAMJC,IANI;IAOJC,OAPI;IAQJC,MARI;IASJC,kBAAkB,GAAG,KATjB;IAUJC,sBAAsB,GAAG,KAVrB;IAWJC,YAXI;IAYJC,UAAU,GAAG,IAZT;IAaJC,QAAQ,GAAG,KAbP;IAcJC,UAAU,GAAG,KAdT;IAeJC,QAAQ,GAAG,KAfP;IAgBJC,QAAQ,GAAG,KAhBP;IAiBJC,OAAO,GAAG,KAjBN;IAkBJC,OAlBI;IAmBJC,mBAAmB,GAAG,KAnBlB;IAoBJC,uBAAuB,GAAG,KApBtB;IAqBJC,aAAa,GAAG,KArBZ;IAsBJC,WAAW,GAAG,KAtBV;IAuBJC,QAAQ,YAvBJ;IAwBJC,MAAM,YAxBF;IAyBJC,YAAY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AapBtC,QAAQ,EAAEzB,SAAS,CAAC+D,IAbA;EAcpB9B,QAAQ,EAAEjC,SAAS,CAACgE,IAdA;EAepB9B,MAAM,EAAElC,SAAS,CAACgE,IAfE;EAgBpB7B,YAAY,EAAEnC,SAAS,CAACgE,IAhBJ;EAiBpB5B,aAAa,EAAEpC,SAAS,CAACgE,IAjBL;EAkBpB3B,cAAc,EAAErC,SAAS,CAACgE,IAlBN;EAmBpB1B,eAAe,EAAEtC,SAAS,CAACgE,IAnBP;EAoBpBzB,UAAU,EAAEvC,SAAS,CAACgE,IApBF;EAqBpBxB,QAAQ,EAAExC,SAAS,CAACgE,IArBA;EAsBpB7C,kBAAkB,EAAEnB,SAAS,CAAC+D,IAtBV;EAuBpB3C,sBAAsB,EAAEpB,SAAS,CAAC+D,IAvBd;EAwBpBzC,UAAU,EAAEtB,SAAS,CAAC+D,IAxBF;EAyBpBxC,QAAQ,EAAEvB,SAAS,CAAC+D,IAzBA;EA0BpBvC,UAAU,EAAExB,SAAS,CAAC+D,IA1BF;EA2BpBrC,QAAQ,EAAE1B,SAAS,CAAC+D,IA3BA;EA4BpBpC,OAAO,EAAE3B,SAAS,CAAC+D,IA5BC;EA6BpBlC,mBAAmB,EAAE7B,SAAS,CAAC+D,IA7BX;EA8BpBjC,uBAAuB,EAAE9B,SAAS,CAAC+D;AA9Bf,CAAtB;AAiCA,eAAezD,SAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","PropTypes","SrcPropType","Provider","Picture","ForumComment","style","ForumPost","props","context","translate","skin","id","author","avatar","avatarAlt","profileAvatarAlt","date","message","answer","answerPostDisabled","answerTextareaDisabled","answerAvatar","answerable","editable","rejectable","mainPost","rejected","deleted","edition","editionPostDisabled","editionTextareaDisabled","showAnswerBox","showEditBox","onAnswer","onEdit","onPostAnswer","onPostEdition","onChangeAnswer","onChangeEdition","onModerate","onDelete","color","infoDeleted","answerLabel","editLabel","deleteLabel","rejectLabel","putBackLabel","messageClassName","deletedMessage","hiddenMessage","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","childContextTypes","propTypes","string","bool","func"],"sources":["../../../../src/molecule/forum/forum-post/index.js"],"sourcesContent":["import React from 'react';\nimport {get, identity} from 'lodash/fp';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Picture from '../../../atom/picture';\nimport ForumComment from '../forum-comment';\nimport style from './style.css';\n\nconst ForumPost = (props, context) => {\n const {translate, skin} = context;\n const {\n id,\n author,\n avatar,\n avatarAlt,\n profileAvatarAlt,\n date,\n message,\n answer,\n answerPostDisabled = false,\n answerTextareaDisabled = false,\n answerAvatar,\n answerable = true,\n editable = false,\n rejectable = false,\n mainPost = false,\n rejected = false,\n deleted = false,\n edition,\n editionPostDisabled = false,\n editionTextareaDisabled = false,\n showAnswerBox = false,\n showEditBox = false,\n onAnswer = identity,\n onEdit = identity,\n onPostAnswer = identity,\n onPostEdition = identity,\n onChangeAnswer = identity,\n onChangeEdition = identity,\n onModerate,\n onDelete\n } = props;\n const color = get('common.primary', skin);\n\n const infoDeleted = translate('This message has been removed by its author');\n const answerLabel = translate('Answer');\n const editLabel = translate('Edit');\n const deleteLabel = translate('Delete');\n const rejectLabel = translate('Reject');\n const putBackLabel = translate('Put back');\n let messageClassName = style.message;\n if (deleted) {\n messageClassName = style.deletedMessage;\n } else if (showEditBox) {\n messageClassName = style.hiddenMessage;\n }\n\n return (\n <div\n data-name=\"forumPost\"\n id={`forum-post-${id || 'to-be-posted'}`}\n className={classnames(\n mainPost ? style.mainPost : null,\n rejected ? style.rejected : style.post\n )}\n >\n <div className={style.avatarWrapper}>\n <div className={style.image}>\n <Picture src={avatar} className={style.avatar} alt={avatarAlt} />\n </div>\n <span data-name=\"author\" className={style.author}>\n {author}\n </span>\n </div>\n <div className={style.content}>\n <div>\n <span className={style.date}>{date}</span>\n </div>\n <div className={style.body}>\n <span\n className={style.action}\n onClick={onAnswer}\n style={{\n color,\n display: answerable && !deleted && !rejected ? 'block' : 'none'\n }}\n >\n {answerLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onEdit}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {editLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onDelete}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {deleteLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onModerate}\n style={{\n color,\n display: rejectable ? 'block' : 'none'\n }}\n >\n {rejected ? putBackLabel : rejectLabel}\n </span>\n\n <div className={messageClassName} role=\"status\">\n {deleted ? infoDeleted : message}\n </div>\n\n <div className={`${style.edition} ${showEditBox ? style.visible : ''}`}>\n <ForumComment\n avatar={null}\n profileAvatarAlt={profileAvatarAlt}\n value={edition}\n textareaDisabled={editionTextareaDisabled}\n postDisabled={editionPostDisabled}\n onPost={onPostEdition}\n onChange={onChangeEdition}\n />\n </div>\n\n <div className={`${style.answer} ${showAnswerBox ? style.visible : ''}`}>\n <ForumComment\n avatar={answerAvatar}\n profileAvatarAlt={profileAvatarAlt}\n textareaDisabled={answerTextareaDisabled}\n postDisabled={answerPostDisabled}\n value={answer}\n onPost={onPostAnswer}\n onChange={onChangeAnswer}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nForumPost.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumPost.propTypes = {\n id: PropTypes.string,\n author: PropTypes.string,\n avatarAlt: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n date: PropTypes.string,\n message: PropTypes.string,\n avatar: SrcPropType,\n answerAvatar: SrcPropType,\n answer: PropTypes.string,\n edition: PropTypes.string,\n showAnswerBox: PropTypes.bool,\n showEditBox: PropTypes.bool,\n mainPost: PropTypes.bool,\n onAnswer: PropTypes.func,\n onEdit: PropTypes.func,\n onPostAnswer: PropTypes.func,\n onPostEdition: PropTypes.func,\n onChangeAnswer: PropTypes.func,\n onChangeEdition: PropTypes.func,\n onModerate: PropTypes.func,\n onDelete: PropTypes.func,\n answerPostDisabled: PropTypes.bool,\n answerTextareaDisabled: PropTypes.bool,\n answerable: PropTypes.bool,\n editable: PropTypes.bool,\n rejectable: PropTypes.bool,\n rejected: PropTypes.bool,\n deleted: PropTypes.bool,\n editionPostDisabled: PropTypes.bool,\n editionTextareaDisabled: PropTypes.bool\n};\n\nexport default ForumPost;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,WAAR,QAA0B,yBAA1B;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,EADI;IAEJC,MAFI;IAGJC,MAHI;IAIJC,SAJI;IAKJC,gBALI;IAMJC,IANI;IAOJC,OAPI;IAQJC,MARI;IASJC,kBAAkB,GAAG,KATjB;IAUJC,sBAAsB,GAAG,KAVrB;IAWJC,YAXI;IAYJC,UAAU,GAAG,IAZT;IAaJC,QAAQ,GAAG,KAbP;IAcJC,UAAU,GAAG,KAdT;IAeJC,QAAQ,GAAG,KAfP;IAgBJC,QAAQ,GAAG,KAhBP;IAiBJC,OAAO,GAAG,KAjBN;IAkBJC,OAlBI;IAmBJC,mBAAmB,GAAG,KAnBlB;IAoBJC,uBAAuB,GAAG,KApBtB;IAqBJC,aAAa,GAAG,KArBZ;IAsBJC,WAAW,GAAG,KAtBV;IAuBJC,QAAQ,YAvBJ;IAwBJC,MAAM,YAxBF;IAyBJC,YAAY,YAzBR;IA0BJC,aAAa,YA1BT;IA2BJC,cAAc,YA3BV;I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,CAAC+D,IAbA;EAcpB9B,QAAQ,EAAEjC,SAAS,CAACgE,IAdA;EAepB9B,MAAM,EAAElC,SAAS,CAACgE,IAfE;EAgBpB7B,YAAY,EAAEnC,SAAS,CAACgE,IAhBJ;EAiBpB5B,aAAa,EAAEpC,SAAS,CAACgE,IAjBL;EAkBpB3B,cAAc,EAAErC,SAAS,CAACgE,IAlBN;EAmBpB1B,eAAe,EAAEtC,SAAS,CAACgE,IAnBP;EAoBpBzB,UAAU,EAAEvC,SAAS,CAACgE,IApBF;EAqBpBxB,QAAQ,EAAExC,SAAS,CAACgE,IArBA;EAsBpB7C,kBAAkB,EAAEnB,SAAS,CAAC+D,IAtBV;EAuBpB3C,sBAAsB,EAAEpB,SAAS,CAAC+D,IAvBd;EAwBpBzC,UAAU,EAAEtB,SAAS,CAAC+D,IAxBF;EAyBpBxC,QAAQ,EAAEvB,SAAS,CAAC+D,IAzBA;EA0BpBvC,UAAU,EAAExB,SAAS,CAAC+D,IA1BF;EA2BpBrC,QAAQ,EAAE1B,SAAS,CAAC+D,IA3BA;EA4BpBpC,OAAO,EAAE3B,SAAS,CAAC+D,IA5BC;EA6BpBlC,mBAAmB,EAAE7B,SAAS,CAAC+D,IA7BX;EA8BpBjC,uBAAuB,EAAE9B,SAAS,CAAC+D;AA9Bf,CAAtB;AAiCA,eAAezD,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/free-text/index.js"],"names":[],"mappings":";AAOA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/free-text/index.js"],"names":[],"mappings":";AAOA,uEAkDC"}
|
|
@@ -32,8 +32,7 @@ const FreeText = (props, legacyContext) => {
|
|
|
32
32
|
onMouseLeave: handleMouseLeave,
|
|
33
33
|
style: _extends({}, value && {
|
|
34
34
|
boxShadow: hovered ? 'none' : `0 4px 16px ${shadowBoxPrimaryColor}`
|
|
35
|
-
})
|
|
36
|
-
role: "group"
|
|
35
|
+
})
|
|
37
36
|
}, /*#__PURE__*/React.createElement("input", {
|
|
38
37
|
"data-name": "free-text-input",
|
|
39
38
|
type: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","convert","Provider","GetSkinFromContext","style","FreeText","props","legacyContext","skin","placeholder","value","onChange","ariaLabel","hovered","setHovered","handleChange","e","target","primarySkinColor","handleMouseOver","handleMouseLeave","shadowBoxPrimaryColor","wrapper","boxShadow","freeText","color","contextTypes","childContextTypes","propTypes","string","func"],"sources":["../../../../src/molecule/questions/free-text/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, getOr} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport style from './style.css';\n\nconst FreeText = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const {placeholder = '', value = '', onChange = noop, 'aria-label': ariaLabel} = props;\n const [hovered, setHovered] = useState(false);\n\n const handleChange = useCallback(e => onChange(e.target.value), [onChange]);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const shadowBoxPrimaryColor = useMemo(\n () => convert(`color(${primarySkinColor} a(12%))`),\n [primarySkinColor]\n );\n\n return (\n <div\n data-name=\"freeText\"\n className={style.wrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n style={{\n ...(value && {\n boxShadow: hovered ? 'none' : `0 4px 16px ${shadowBoxPrimaryColor}`\n })\n }}\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","convert","Provider","GetSkinFromContext","style","FreeText","props","legacyContext","skin","placeholder","value","onChange","ariaLabel","hovered","setHovered","handleChange","e","target","primarySkinColor","handleMouseOver","handleMouseLeave","shadowBoxPrimaryColor","wrapper","boxShadow","freeText","color","contextTypes","childContextTypes","propTypes","string","func"],"sources":["../../../../src/molecule/questions/free-text/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, getOr} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport style from './style.css';\n\nconst FreeText = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const {placeholder = '', value = '', onChange = noop, 'aria-label': ariaLabel} = props;\n const [hovered, setHovered] = useState(false);\n\n const handleChange = useCallback(e => onChange(e.target.value), [onChange]);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const shadowBoxPrimaryColor = useMemo(\n () => convert(`color(${primarySkinColor} a(12%))`),\n [primarySkinColor]\n );\n\n return (\n <div\n data-name=\"freeText\"\n className={style.wrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n style={{\n ...(value && {\n boxShadow: hovered ? 'none' : `0 4px 16px ${shadowBoxPrimaryColor}`\n })\n }}\n >\n <input\n data-name=\"free-text-input\"\n type=\"text\"\n aria-label={ariaLabel || value || placeholder}\n className={style.freeText}\n placeholder={placeholder}\n value={value}\n onInput={handleChange}\n onChange={noop}\n style={{\n boxShadow: `0 4px 16px ${shadowBoxPrimaryColor}`,\n ...(value && {\n boxShadow: `0 4px 16px ${\n hovered ? convert(`color(${primarySkinColor} a(20%))`) : shadowBoxPrimaryColor\n }`\n }),\n color: primarySkinColor\n }}\n />\n </div>\n );\n};\n\nFreeText.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nFreeText.propTypes = {\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n 'aria-label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AIE,YAAY,EAAEC,gBAJhB;IAKE,KAAK,eACCV,KAAK,IAAI;MACXa,SAAS,EAAEV,OAAO,GAAG,MAAH,GAAa,cAAaQ,qBAAsB;IADvD,CADV;EALP,gBAWE;IACE,aAAU,iBADZ;IAEE,IAAI,EAAC,MAFP;IAGE,cAAYT,SAAS,IAAIF,KAAb,IAAsBD,WAHpC;IAIE,SAAS,EAAEL,KAAK,CAACoB,QAJnB;IAKE,WAAW,EAAEf,WALf;IAME,KAAK,EAAEC,KANT;IAOE,OAAO,EAAEK,YAPX;IAQE,QAAQ,OARV;IASE,KAAK;MACHQ,SAAS,EAAG,cAAaF,qBAAsB;IAD5C,GAECX,KAAK,IAAI;MACXa,SAAS,EAAG,cACVV,OAAO,GAAGZ,OAAO,CAAE,SAAQiB,gBAAiB,UAA3B,CAAV,GAAkDG,qBAC1D;IAHU,CAFV;MAOHI,KAAK,EAAEP;IAPJ;EATP,EAXF,CADF;AAiCD,CAlDD;;AAoDAb,QAAQ,CAACqB,YAAT,GAAwB;EACtBlB,IAAI,EAAEN,QAAQ,CAACyB,iBAAT,CAA2BnB;AADX,CAAxB;AAIAH,QAAQ,CAACuB,SAAT,2CAAqB;EACnBnB,WAAW,EAAET,SAAS,CAAC6B,MADJ;EAEnBnB,KAAK,EAAEV,SAAS,CAAC6B,MAFE;EAGnBlB,QAAQ,EAAEX,SAAS,CAAC8B,IAHD;EAInB,cAAc9B,SAAS,CAAC6B;AAJL,CAArB;AAOA,eAAexB,QAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/share/index.js"],"names":[],"mappings":"AAkDO;;gBAcN;;;;;;AAEM;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/share/index.js"],"names":[],"mappings":"AAkDO;;gBAcN;;;;;;AAEM;;;uBAoBN;;;;;;;;;;AAED;;;;gBA8BC"}
|
|
@@ -74,7 +74,11 @@ export const ShareFeedback = ({
|
|
|
74
74
|
className: styles.checkIcon,
|
|
75
75
|
width: 13,
|
|
76
76
|
height: 13
|
|
77
|
-
}), /*#__PURE__*/React.createElement("p",
|
|
77
|
+
}), status === SHARE_STATUS.SUCCESS ? /*#__PURE__*/React.createElement("p", {
|
|
78
|
+
role: "status"
|
|
79
|
+
}, successWording) : /*#__PURE__*/React.createElement("p", {
|
|
80
|
+
role: "alert"
|
|
81
|
+
}, errorWording));
|
|
78
82
|
};
|
|
79
83
|
|
|
80
84
|
const Share = ({
|