@coorpacademy/components 10.30.10-alpha.3 → 10.30.10-alpha.3.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/behaviours/use-translate-vertically.native.d.ts +16 -0
- package/es/behaviours/use-translate-vertically.native.d.ts.map +1 -0
- package/es/behaviours/use-translate-vertically.native.js +44 -0
- package/es/behaviours/use-translate-vertically.native.js.map +1 -0
- package/es/behaviours/use-update-opacity.native.d.ts +14 -0
- package/es/behaviours/use-update-opacity.native.d.ts.map +1 -0
- package/es/behaviours/use-update-opacity.native.js +55 -0
- package/es/behaviours/use-update-opacity.native.js.map +1 -0
- package/es/molecule/card-congrats/index.native.js +2 -2
- package/es/molecule/card-congrats/index.native.js.map +1 -1
- package/es/molecule/card-congrats/types.d.ts +1 -1
- package/es/molecule/card-congrats/types.d.ts.map +1 -1
- package/es/molecule/card-congrats/types.js.map +1 -1
- package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.native.js +12 -25
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/organism/get-the-app/index.d.ts.map +1 -1
- package/es/organism/get-the-app/index.js +10 -5
- package/es/organism/get-the-app/index.js.map +1 -1
- package/es/organism/mooc-footer/index.d.ts.map +1 -1
- package/es/organism/mooc-footer/index.js +3 -2
- package/es/organism/mooc-footer/index.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +6 -6
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-congrats/index.native.d.ts.map +1 -1
- package/es/organism/review-congrats/index.native.js +91 -15
- package/es/organism/review-congrats/index.native.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +10 -22
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +17 -4
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/behaviours/use-translate-vertically.native.d.ts +16 -0
- package/lib/behaviours/use-translate-vertically.native.d.ts.map +1 -0
- package/lib/behaviours/use-translate-vertically.native.js +51 -0
- package/lib/behaviours/use-translate-vertically.native.js.map +1 -0
- package/lib/behaviours/use-update-opacity.native.d.ts +14 -0
- package/lib/behaviours/use-update-opacity.native.d.ts.map +1 -0
- package/lib/behaviours/use-update-opacity.native.js +62 -0
- package/lib/behaviours/use-update-opacity.native.js.map +1 -0
- package/lib/molecule/card-congrats/index.native.js +2 -2
- package/lib/molecule/card-congrats/index.native.js.map +1 -1
- package/lib/molecule/card-congrats/types.d.ts +1 -1
- package/lib/molecule/card-congrats/types.d.ts.map +1 -1
- package/lib/molecule/card-congrats/types.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.js +12 -24
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/organism/get-the-app/index.d.ts.map +1 -1
- package/lib/organism/get-the-app/index.js +11 -5
- package/lib/organism/get-the-app/index.js.map +1 -1
- package/lib/organism/mooc-footer/index.d.ts.map +1 -1
- package/lib/organism/mooc-footer/index.js +4 -2
- package/lib/organism/mooc-footer/index.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +6 -6
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
- package/lib/organism/review-congrats/index.native.js +91 -13
- package/lib/organism/review-congrats/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +10 -21
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +21 -3
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet,
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Animated, StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
3
|
import keys from 'lodash/fp/keys';
|
|
4
4
|
import Slide from '../review-slide/index.native';
|
|
5
|
+
import useTranslateVertically from '../../behaviours/use-translate-vertically.native';
|
|
5
6
|
export const TOTAL_SLIDES_STACK = 5;
|
|
6
7
|
const style = StyleSheet.create({
|
|
7
8
|
slides: {
|
|
@@ -12,11 +13,23 @@ const style = StyleSheet.create({
|
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
const StackedSlides = props => {
|
|
16
|
+
const {
|
|
17
|
+
height: windowHeight
|
|
18
|
+
} = useWindowDimensions();
|
|
15
19
|
const {
|
|
16
20
|
slides,
|
|
17
21
|
validateButton,
|
|
18
22
|
correctionPopinProps
|
|
19
23
|
} = props;
|
|
24
|
+
const {
|
|
25
|
+
translate,
|
|
26
|
+
animatedY
|
|
27
|
+
} = useTranslateVertically({
|
|
28
|
+
fromValue: 0,
|
|
29
|
+
toValue: windowHeight,
|
|
30
|
+
duration: 800
|
|
31
|
+
});
|
|
32
|
+
useEffect(translate, [translate]);
|
|
20
33
|
const indexes = keys(slides).reverse();
|
|
21
34
|
const stackedSlides = indexes.map(slideIndex => {
|
|
22
35
|
const slide = slides[slideIndex];
|
|
@@ -29,8 +42,8 @@ const StackedSlides = props => {
|
|
|
29
42
|
key: slideIndex
|
|
30
43
|
});
|
|
31
44
|
});
|
|
32
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
33
|
-
style: style.slides
|
|
45
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
46
|
+
style: [style.slides, animatedY]
|
|
34
47
|
}, stackedSlides);
|
|
35
48
|
};
|
|
36
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","StyleSheet","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","Animated","StyleSheet","useWindowDimensions","keys","Slide","useTranslateVertically","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","StackedSlides","props","windowHeight","validateButton","correctionPopinProps","translate","animatedY","fromValue","toValue","duration","indexes","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React, {useEffect} from 'react';\nimport {Animated, StyleSheet, useWindowDimensions} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport {ReviewStackProps} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: ReviewStackProps) => {\n const {height: windowHeight} = useWindowDimensions();\n const {slides, validateButton, correctionPopinProps} = props;\n\n const {translate, animatedY} = useTranslateVertically({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n useEffect(translate, [translate]);\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <Animated.View style={[style.slides, animatedY]}>{stackedSlides}</Animated.View>;\n};\n\nexport default StackedSlides;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,QAA+B,OAA/B;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,mBAA9B,QAAwD,cAAxD;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,KAAP,MAAkB,8BAAlB;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AAGA,OAAO,MAAMC,kBAAkB,GAAG,CAA3B;AAEP,MAAMC,KAAK,GAAGN,UAAU,CAACO,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AAQA,MAAMC,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM;IAACH,MAAM,EAAEI;EAAT,IAAyBb,mBAAmB,EAAlD;EACA,MAAM;IAACO,MAAD;IAASO,cAAT;IAAyBC;EAAzB,IAAiDH,KAAvD;EAEA,MAAM;IAACI,SAAD;IAAYC;EAAZ,IAAyBd,sBAAsB,CAAC;IACpDe,SAAS,EAAE,CADyC;IAEpDC,OAAO,EAAEN,YAF2C;IAGpDO,QAAQ,EAAE;EAH0C,CAAD,CAArD;EAMAvB,SAAS,CAACmB,SAAD,EAAY,CAACA,SAAD,CAAZ,CAAT;EAEA,MAAMK,OAAO,GAAGpB,IAAI,CAACM,MAAD,CAAJ,CAAae,OAAb,EAAhB;EACA,MAAMC,aAAa,GAAGF,OAAO,CAACG,GAAR,CAAYC,UAAU,IAAI;IAC9C,MAAMC,KAAK,GAAGnB,MAAM,CAACkB,UAAD,CAApB;IAEA,oBACE,oBAAC,KAAD;MAEIE,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CAFT;MAGIA,UAHJ;MAIIC,KAJJ;MAKIZ,cALJ;MAMIC,oBANJ;MAQE,GAAG,EAAEU;IARP,EADF;EAYD,CAfqB,CAAtB;EAiBA,oBAAO,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACpB,KAAK,CAACE,MAAP,EAAeU,SAAf;EAAtB,GAAkDM,aAAlD,CAAP;AACD,CA/BD;;AAiCA,eAAeZ,aAAf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
declare type Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {
|
|
3
|
+
onFinished?: () => void;
|
|
4
|
+
fromValue?: number;
|
|
5
|
+
toValue?: Animated.TimingAnimationConfig['toValue'];
|
|
6
|
+
};
|
|
7
|
+
declare const useTranslateVertically: (params?: Params) => {
|
|
8
|
+
translate: () => void;
|
|
9
|
+
animatedY: {
|
|
10
|
+
transform: {
|
|
11
|
+
translateY: Animated.Value;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default useTranslateVertically;
|
|
16
|
+
//# sourceMappingURL=use-translate-vertically.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-translate-vertically.native.d.ts","sourceRoot":"","sources":["../../src/behaviours/use-translate-vertically.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,aAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IAClF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;CACrD,CAAC;AAEF,QAAA,MAAM,sBAAsB,YAAY,MAAM;;;;;;;CAkB7C,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const _excluded = ["fromValue", "toValue", "duration", "onFinished"];
|
|
11
|
+
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
|
|
16
|
+
const useTranslateVertically = (params = {}) => {
|
|
17
|
+
const {
|
|
18
|
+
fromValue = 0,
|
|
19
|
+
toValue = 100,
|
|
20
|
+
duration = 550,
|
|
21
|
+
onFinished
|
|
22
|
+
} = params,
|
|
23
|
+
othersParams = _objectWithoutPropertiesLoose(params, _excluded);
|
|
24
|
+
|
|
25
|
+
const translateY = (0, _react.useRef)(new _reactNative.Animated.Value(fromValue)).current;
|
|
26
|
+
const translate = (0, _react.useCallback)(() => {
|
|
27
|
+
_reactNative.Animated.timing(translateY, _extends({}, othersParams, {
|
|
28
|
+
toValue,
|
|
29
|
+
duration,
|
|
30
|
+
useNativeDriver: true
|
|
31
|
+
})).start(({
|
|
32
|
+
finished
|
|
33
|
+
}) => {
|
|
34
|
+
if (finished) {
|
|
35
|
+
onFinished?.();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}, [onFinished, duration, othersParams, toValue, translateY]);
|
|
39
|
+
return {
|
|
40
|
+
translate,
|
|
41
|
+
animatedY: {
|
|
42
|
+
transform: [{
|
|
43
|
+
translateY
|
|
44
|
+
}]
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var _default = useTranslateVertically;
|
|
50
|
+
exports.default = _default;
|
|
51
|
+
//# sourceMappingURL=use-translate-vertically.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-translate-vertically.native.js","names":["useTranslateVertically","params","fromValue","toValue","duration","onFinished","othersParams","translateY","useRef","Animated","Value","current","translate","useCallback","timing","useNativeDriver","start","finished","animatedY","transform"],"sources":["../../src/behaviours/use-translate-vertically.native.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react';\nimport {Animated} from 'react-native';\n\ntype Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {\n onFinished?: () => void;\n fromValue?: number;\n toValue?: Animated.TimingAnimationConfig['toValue'];\n};\n\nconst useTranslateVertically = (params: Params = {}) => {\n const {fromValue = 0, toValue = 100, duration = 550, onFinished, ...othersParams} = params;\n const translateY = useRef(new Animated.Value(fromValue)).current;\n\n const translate = useCallback(() => {\n Animated.timing(translateY, {\n ...othersParams,\n toValue,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFinished?.();\n }\n });\n }, [onFinished, duration, othersParams, toValue, translateY]);\n\n return {translate, animatedY: {transform: [{translateY}]}};\n};\n\nexport default useTranslateVertically;\n"],"mappings":";;;;;AAAA;;AACA;;;;;;;;AAQA,MAAMA,sBAAsB,GAAG,CAACC,MAAc,GAAG,EAAlB,KAAyB;EACtD,MAAM;IAACC,SAAS,GAAG,CAAb;IAAgBC,OAAO,GAAG,GAA1B;IAA+BC,QAAQ,GAAG,GAA1C;IAA+CC;EAA/C,IAA8EJ,MAApF;EAAA,MAAoEK,YAApE,iCAAoFL,MAApF;;EACA,MAAMM,UAAU,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmBR,SAAnB,CAAP,EAAsCS,OAAzD;EAEA,MAAMC,SAAS,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAClCJ,qBAAA,CAASK,MAAT,CAAgBP,UAAhB,eACKD,YADL;MAEEH,OAFF;MAGEC,QAHF;MAIEW,eAAe,EAAE;IAJnB,IAKGC,KALH,CAKS,CAAC;MAACC;IAAD,CAAD,KAAgB;MACvB,IAAIA,QAAJ,EAAc;QACZZ,UAAU;MACX;IACF,CATD;EAUD,CAXiB,EAWf,CAACA,UAAD,EAAaD,QAAb,EAAuBE,YAAvB,EAAqCH,OAArC,EAA8CI,UAA9C,CAXe,CAAlB;EAaA,OAAO;IAACK,SAAD;IAAYM,SAAS,EAAE;MAACC,SAAS,EAAE,CAAC;QAACZ;MAAD,CAAD;IAAZ;EAAvB,CAAP;AACD,CAlBD;;eAoBeP,sB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
declare type Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {
|
|
3
|
+
onFadeInFinished?: () => void;
|
|
4
|
+
onFadeOutFinished?: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare const useUpdateOpacity: (params?: Params) => {
|
|
7
|
+
fadeIn: () => void;
|
|
8
|
+
fadeOut: () => void;
|
|
9
|
+
animatedOpacity: {
|
|
10
|
+
opacity: Animated.Value;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default useUpdateOpacity;
|
|
14
|
+
//# sourceMappingURL=use-update-opacity.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-update-opacity.native.d.ts","sourceRoot":"","sources":["../../src/behaviours/use-update-opacity.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,aAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IAClF,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,gBAAgB,YAAY,MAAM;;;;;;CAgCvC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const _excluded = ["duration", "onFadeInFinished", "onFadeOutFinished"];
|
|
11
|
+
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
|
|
16
|
+
const useUpdateOpacity = (params = {}) => {
|
|
17
|
+
const {
|
|
18
|
+
duration = 750,
|
|
19
|
+
onFadeInFinished,
|
|
20
|
+
onFadeOutFinished
|
|
21
|
+
} = params,
|
|
22
|
+
othersParams = _objectWithoutPropertiesLoose(params, _excluded);
|
|
23
|
+
|
|
24
|
+
const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
25
|
+
const fadeIn = (0, _react.useCallback)(() => {
|
|
26
|
+
_reactNative.Animated.timing(fadeAnim, _extends({}, othersParams, {
|
|
27
|
+
toValue: 1,
|
|
28
|
+
duration,
|
|
29
|
+
useNativeDriver: true
|
|
30
|
+
})).start(({
|
|
31
|
+
finished
|
|
32
|
+
}) => {
|
|
33
|
+
if (finished) {
|
|
34
|
+
onFadeInFinished?.();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}, [duration, fadeAnim, onFadeInFinished, othersParams]);
|
|
38
|
+
const fadeOut = (0, _react.useCallback)(() => {
|
|
39
|
+
_reactNative.Animated.timing(fadeAnim, _extends({}, othersParams, {
|
|
40
|
+
toValue: 0,
|
|
41
|
+
duration,
|
|
42
|
+
useNativeDriver: true
|
|
43
|
+
})).start(({
|
|
44
|
+
finished
|
|
45
|
+
}) => {
|
|
46
|
+
if (finished) {
|
|
47
|
+
onFadeOutFinished?.();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}, [duration, fadeAnim, onFadeOutFinished, othersParams]);
|
|
51
|
+
return {
|
|
52
|
+
fadeIn,
|
|
53
|
+
fadeOut,
|
|
54
|
+
animatedOpacity: {
|
|
55
|
+
opacity: fadeAnim
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var _default = useUpdateOpacity;
|
|
61
|
+
exports.default = _default;
|
|
62
|
+
//# sourceMappingURL=use-update-opacity.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-update-opacity.native.js","names":["useUpdateOpacity","params","duration","onFadeInFinished","onFadeOutFinished","othersParams","fadeAnim","useRef","Animated","Value","current","fadeIn","useCallback","timing","toValue","useNativeDriver","start","finished","fadeOut","animatedOpacity","opacity"],"sources":["../../src/behaviours/use-update-opacity.native.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react';\nimport {Animated} from 'react-native';\n\ntype Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {\n onFadeInFinished?: () => void;\n onFadeOutFinished?: () => void;\n};\n\nconst useUpdateOpacity = (params: Params = {}) => {\n const {duration = 750, onFadeInFinished, onFadeOutFinished, ...othersParams} = params;\n\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const fadeIn = useCallback(() => {\n Animated.timing(fadeAnim, {\n ...othersParams,\n toValue: 1,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFadeInFinished?.();\n }\n });\n }, [duration, fadeAnim, onFadeInFinished, othersParams]);\n\n const fadeOut = useCallback(() => {\n Animated.timing(fadeAnim, {\n ...othersParams,\n toValue: 0,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFadeOutFinished?.();\n }\n });\n }, [duration, fadeAnim, onFadeOutFinished, othersParams]);\n\n return {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D;;eAkCeN,gB"}
|
|
@@ -91,13 +91,13 @@ const CardCongrats = ({
|
|
|
91
91
|
style: styleSheet.card
|
|
92
92
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
93
93
|
style: styleSheet.animation
|
|
94
|
-
}, /*#__PURE__*/_react.default.createElement(_lottieReactNative.default, {
|
|
94
|
+
}, animationUri ? /*#__PURE__*/_react.default.createElement(_lottieReactNative.default, {
|
|
95
95
|
source: {
|
|
96
96
|
uri: animationUri
|
|
97
97
|
},
|
|
98
98
|
autoPlay: true,
|
|
99
99
|
loop: false
|
|
100
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
100
|
+
}) : null), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
101
101
|
style: styleSheet.cardTitle
|
|
102
102
|
}, text), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
103
103
|
style: [styleSheet.reward, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","animation","marginBottom","width","height","card","alignItems","paddingTop","paddingBottom","borderRadius","margin","BOX_STYLE","backgroundColor","colors","white","cardTitle","fontWeight","fontSize","lineHeight","color","text","primary","reward","rewardText","marginHorizontal","iconBig","iconSmall","CardCongrats","animationUri","Icon","value","iconColor","textColor","direction","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","uri","flexDirection"],"sources":["../../../src/molecule/card-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport {CardCongratsProps} from './types';\n\ntype StyleSheetType = {\n animation: ViewStyle;\n card: ViewStyle;\n cardTitle: TextStyle;\n iconBig: ViewStyle;\n iconSmall: ViewStyle;\n reward: ViewStyle;\n rewardText: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n animation: {\n marginBottom: 12,\n width: 132,\n height: 132\n },\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n card: {\n alignItems: 'center',\n paddingTop: 32,\n paddingBottom: 24,\n borderRadius: 24,\n margin: 10,\n width: 280,\n height: 317,\n ...BOX_STYLE,\n backgroundColor: theme.colors.white\n },\n cardTitle: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n color: theme.colors.text.primary\n },\n reward: {\n alignItems: 'center'\n },\n rewardText: {\n fontWeight: '700',\n fontSize: 64,\n lineHeight: 77,\n marginHorizontal: 10\n },\n iconBig: {\n width: 70,\n height: 70\n },\n iconSmall: {\n width: 53,\n height: 53\n }\n });\n\nconst CardCongrats = ({\n animationUri,\n Icon,\n value,\n text,\n iconColor,\n textColor,\n direction\n}: CardCongratsProps) => {\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\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 <View style={styleSheet.card}>\n <View style={styleSheet.animation}>\n <LottieView source={{uri: animationUri}} autoPlay loop={false}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","animation","marginBottom","width","height","card","alignItems","paddingTop","paddingBottom","borderRadius","margin","BOX_STYLE","backgroundColor","colors","white","cardTitle","fontWeight","fontSize","lineHeight","color","text","primary","reward","rewardText","marginHorizontal","iconBig","iconSmall","CardCongrats","animationUri","Icon","value","iconColor","textColor","direction","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","uri","flexDirection"],"sources":["../../../src/molecule/card-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport {CardCongratsProps} from './types';\n\ntype StyleSheetType = {\n animation: ViewStyle;\n card: ViewStyle;\n cardTitle: TextStyle;\n iconBig: ViewStyle;\n iconSmall: ViewStyle;\n reward: ViewStyle;\n rewardText: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n animation: {\n marginBottom: 12,\n width: 132,\n height: 132\n },\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n card: {\n alignItems: 'center',\n paddingTop: 32,\n paddingBottom: 24,\n borderRadius: 24,\n margin: 10,\n width: 280,\n height: 317,\n ...BOX_STYLE,\n backgroundColor: theme.colors.white\n },\n cardTitle: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n color: theme.colors.text.primary\n },\n reward: {\n alignItems: 'center'\n },\n rewardText: {\n fontWeight: '700',\n fontSize: 64,\n lineHeight: 77,\n marginHorizontal: 10\n },\n iconBig: {\n width: 70,\n height: 70\n },\n iconSmall: {\n width: 53,\n height: 53\n }\n });\n\nconst CardCongrats = ({\n animationUri,\n Icon,\n value,\n text,\n iconColor,\n textColor,\n direction\n}: CardCongratsProps) => {\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\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 <View style={styleSheet.card}>\n <View style={styleSheet.animation}>\n {animationUri ? <LottieView source={{uri: animationUri}} autoPlay loop={false} /> : null}\n </View>\n <Text style={styleSheet.cardTitle}>{text}</Text>\n <View style={[styleSheet.reward, {flexDirection: direction}]}>\n <Text style={[styleSheet.rewardText, {color: textColor}]}>{value}</Text>\n <Icon style={styleSheet.iconSm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,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/card-congrats/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAEnD,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAAC,KAAK,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAC,CAAC,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/molecule/card-congrats/types.ts"],"sourcesContent":["import {ColorValue, ViewStyle} from 'react-native';\n\nexport type CardCongratsProps = {\n animationUri: string;\n Icon: React.FC<{style: ViewStyle; color: ColorValue}>;\n value: string;\n text: string;\n iconColor: ColorValue;\n textColor: ColorValue;\n direction: ViewStyle['flexDirection'];\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/molecule/card-congrats/types.ts"],"sourcesContent":["import {ColorValue, ViewStyle} from 'react-native';\n\nexport type CardCongratsProps = {\n animationUri: string | null;\n Icon: React.FC<{style: ViewStyle; color: ColorValue}>;\n value: string;\n text: string;\n iconColor: ColorValue;\n textColor: ColorValue;\n direction: ViewStyle['flexDirection'];\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAgC,0BAA0B,EAAC,MAAM,cAAc,CAAC;AAyPvF,QAAA,MAAM,qBAAqB,kDAMxB,0BAA0B,uBAiD5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -17,6 +17,8 @@ var _index3 = _interopRequireDefault(require("../../hoc/touchable/index.native")
|
|
|
17
17
|
|
|
18
18
|
var _templateContext = require("../../template/app-review/template-context");
|
|
19
19
|
|
|
20
|
+
var _useUpdateOpacity = _interopRequireDefault(require("../../behaviours/use-update-opacity.native"));
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -71,8 +73,7 @@ const createStyleSheet = (theme, type) => _reactNative.StyleSheet.create({
|
|
|
71
73
|
fontWeight: '600',
|
|
72
74
|
lineHeight: 24,
|
|
73
75
|
marginLeft: 12,
|
|
74
|
-
textTransform: 'uppercase'
|
|
75
|
-
wordBreak: 'break-word'
|
|
76
|
+
textTransform: 'uppercase'
|
|
76
77
|
},
|
|
77
78
|
feedbackSection: {
|
|
78
79
|
marginVertical: theme.spacing.medium
|
|
@@ -89,8 +90,7 @@ const createStyleSheet = (theme, type) => _reactNative.StyleSheet.create({
|
|
|
89
90
|
color: theme.colors.white,
|
|
90
91
|
fontSize: 14,
|
|
91
92
|
fontWeight: theme.fontWeight.extraBold,
|
|
92
|
-
lineHeight: 17
|
|
93
|
-
wordBreak: 'break-word'
|
|
93
|
+
lineHeight: 17
|
|
94
94
|
},
|
|
95
95
|
htmlInfoMessage: {
|
|
96
96
|
color: theme.colors.white,
|
|
@@ -198,23 +198,13 @@ const KlfButton = ({
|
|
|
198
198
|
styleSheet
|
|
199
199
|
}) => {
|
|
200
200
|
const [displayTooltip, setDisplayTooltip] = (0, _react.useState)(false);
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}).start();
|
|
209
|
-
}, [fadeAnim]);
|
|
210
|
-
const fadeOut = (0, _react.useCallback)(() => {
|
|
211
|
-
_reactNative.Animated.timing(fadeAnim, {
|
|
212
|
-
toValue: 0,
|
|
213
|
-
duration: 500,
|
|
214
|
-
easing: _reactNative.Easing.bezier(0.25, 1, 0.5, 1),
|
|
215
|
-
useNativeDriver: true
|
|
216
|
-
}).start();
|
|
217
|
-
}, [fadeAnim]);
|
|
201
|
+
const {
|
|
202
|
+
fadeIn,
|
|
203
|
+
fadeOut,
|
|
204
|
+
animatedOpacity
|
|
205
|
+
} = (0, _useUpdateOpacity.default)({
|
|
206
|
+
easing: _reactNative.Easing.bezier(0.25, 1, 0.5, 1)
|
|
207
|
+
});
|
|
218
208
|
const handlePressKey = (0, _react.useCallback)(() => {
|
|
219
209
|
setDisplayTooltip(!displayTooltip);
|
|
220
210
|
!displayTooltip ? fadeIn() : fadeOut();
|
|
@@ -237,9 +227,7 @@ const KlfButton = ({
|
|
|
237
227
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
238
228
|
style: containerButtonKlf
|
|
239
229
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
240
|
-
style: [containerTooltip,
|
|
241
|
-
opacity: fadeAnim
|
|
242
|
-
}]
|
|
230
|
+
style: [containerTooltip, animatedOpacity]
|
|
243
231
|
}, /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
244
232
|
style: buttonTooltip,
|
|
245
233
|
accessibilityLabel: `aria-label-tooltip`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","type","StyleSheet","create","wrapper","height","color","colors","white","display","popin","padding","spacing","medium","borderRadius","flexDirection","alignItems","backgroundColor","negative","positive","shadowColor","shadowOpacity","shadowOffset","width","shadowRadius","elevation","correctionSection","iconCircle","justifyContent","opacity","icon","resultLabel","fontSize","fontWeight","lineHeight","marginLeft","textTransform","wordBreak","feedbackSection","marginVertical","labelContainer","alignSelf","paddingHorizontal","tiny","paddingVertical","micro","marginBottom","label","extraBold","htmlInfoMessage","button","base","small","buttonText","cta","bold","textAlign","containerButtonKlf","buttonKlf","buttonKlfActive","buttonKlfText","iconKey","marginRight","containerTooltip","zIndex","position","black","buttonTooltip","bottom","right","htmlTooltipText","text","primary","triangleTooltip","borderStyle","borderLeftWidth","borderRightWidth","borderBottomWidth","borderTopWidth","borderLeftColor","borderTopColor","borderRightColor","borderBottomColor","transform","rotate","left","top","KlfButton","klf","styleSheet","displayTooltip","setDisplayTooltip","useState","fadeAnim","useRef","Animated","Value","current","fadeIn","useCallback","timing","toValue","duration","easing","Easing","bezier","useNativeDriver","start","fadeOut","handlePressKey","tooltip","ICONS","RightIcon","wrong","WrongIcon","ReviewCorrectionPopin","information","next","templateContext","useTemplateContext","setStylesheet","handlePressNext","onClick","Icon","useEffect","_stylesheet","message"],"sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport {Animated, Easing, TextStyle, StyleSheet, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon,\n NovaLineLoginKey1 as KlfIcon\n} from '@coorpacademy/nova-icons';\nimport Html from '../../atom/html/index.native';\nimport {Theme} from '../../variables/theme.native';\nimport Text from '../../atom/text/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ReviewCorrectionPopinKLFProps, ReviewCorrectionPopinProps} from './prop-types';\n\ninterface StyleSheetType {\n wrapper: ViewStyle;\n popin: ViewStyle;\n correctionSection: ViewStyle;\n iconCircle: ViewStyle;\n icon: ViewStyle;\n resultLabel: TextStyle;\n feedbackSection: ViewStyle;\n labelContainer: ViewStyle;\n label: TextStyle;\n htmlInfoMessage: TextStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n buttonKlf: ViewStyle;\n buttonKlfActive: TextStyle;\n buttonKlfText: TextStyle;\n iconKey: ViewStyle;\n containerTooltip: ViewStyle;\n buttonTooltip: ViewStyle;\n containerButtonKlf: ViewStyle;\n triangleTooltip: ViewStyle;\n htmlTooltipText: TextStyle;\n}\n\nconst createStyleSheet = (theme: Theme, type: string): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n height: 'auto',\n color: theme.colors.white,\n display: 'flex'\n },\n popin: {\n padding: theme.spacing.medium,\n borderRadius: 16,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n backgroundColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowOpacity: 0.5,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 15,\n elevation: 4\n },\n correctionSection: {\n flexDirection: 'row',\n alignItems: 'center',\n width: '80%'\n },\n iconCircle: {\n width: 60,\n height: 60,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n opacity: 0.7,\n borderRadius: 50\n },\n icon: {\n height: 30,\n width: 30\n },\n resultLabel: {\n color: theme.colors.white,\n fontSize: 24,\n fontWeight: '600',\n lineHeight: 24,\n marginLeft: 12,\n textTransform: 'uppercase',\n wordBreak: 'break-word'\n },\n feedbackSection: {\n marginVertical: theme.spacing.medium\n },\n labelContainer: {\n alignSelf: 'flex-start',\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n borderRadius: 56,\n paddingHorizontal: theme.spacing.tiny,\n paddingVertical: theme.spacing.micro,\n marginBottom: 8\n },\n label: {\n color: theme.colors.white,\n fontSize: 14,\n fontWeight: theme.fontWeight.extraBold,\n lineHeight: 17,\n wordBreak: 'break-word'\n },\n htmlInfoMessage: {\n color: theme.colors.white,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 19\n },\n button: {\n alignSelf: 'stretch',\n backgroundColor: theme.colors.white,\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small\n },\n buttonText: {\n color: theme.colors.cta,\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n containerButtonKlf: {\n width: '100%'\n },\n buttonKlf: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small,\n marginBottom: theme.spacing.tiny\n },\n buttonKlfActive: {\n backgroundColor:\n 'linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), rgba(255, 255, 255, 0.1)'\n },\n buttonKlfText: {\n color: 'white',\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n iconKey: {\n width: 12,\n height: 12,\n marginRight: theme.spacing.tiny\n },\n containerTooltip: {\n zIndex: 30,\n position: 'relative',\n shadowColor: theme.colors.black,\n shadowOpacity: 0.3,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 8\n },\n buttonTooltip: {\n flexDirection: 'column',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n borderRadius: 15,\n padding: theme.spacing.small,\n width: '112%',\n position: 'absolute',\n bottom: 4,\n right: -15,\n zIndex: 20\n },\n htmlTooltipText: {\n color: theme.colors.text.primary,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 22,\n textAlign: 'center'\n },\n triangleTooltip: {\n width: 0,\n height: 0,\n backgroundColor: 'transparent',\n borderStyle: 'solid',\n borderLeftWidth: 13,\n borderRightWidth: 13,\n borderBottomWidth: 13,\n borderTopWidth: 13,\n borderLeftColor: 'transparent',\n borderTopColor: 'transparent',\n borderRightColor: theme.colors.white,\n borderBottomColor: theme.colors.white,\n transform: [{rotate: '45deg'}],\n position: 'absolute',\n left: 110,\n top: -20,\n borderRadius: 4\n }\n });\n\nconst KlfButton = ({\n klf,\n styleSheet\n}: {\n klf: ReviewCorrectionPopinKLFProps;\n styleSheet: StyleSheetType;\n}) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const fadeIn = useCallback(() => {\n Animated.timing(fadeAnim, {\n toValue: 1,\n duration: 1000,\n easing: Easing.bezier(0.25, 1, 0.5, 1),\n useNativeDriver: true\n }).start();\n }, [fadeAnim]);\n\n const fadeOut = useCallback(() => {\n Animated.timing(fadeAnim, {\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.25, 1, 0.5, 1),\n useNativeDriver: true\n }).start();\n }, [fadeAnim]);\n\n const handlePressKey = useCallback(() => {\n setDisplayTooltip(!displayTooltip);\n !displayTooltip ? fadeIn() : fadeOut();\n }, [displayTooltip, fadeIn, fadeOut]);\n\n const {\n buttonKlf,\n buttonKlfActive,\n buttonKlfText,\n containerButtonKlf,\n containerTooltip,\n buttonTooltip,\n htmlTooltipText,\n iconKey,\n triangleTooltip\n } = styleSheet;\n\n const {label, tooltip} = klf;\n\n return (\n <View style={containerButtonKlf}>\n <Animated.View style={[containerTooltip, {opacity: fadeAnim}]}>\n <Touchable\n style={buttonTooltip}\n accessibilityLabel={`aria-label-tooltip`}\n isHighlight\n onPress={handlePressKey}\n testID=\"button-tooltip\"\n >\n <Html style={htmlTooltipText}>{tooltip}</Html>\n </Touchable>\n <View style={triangleTooltip} />\n </Animated.View>\n <Touchable\n style={displayTooltip ? {...buttonKlf, ...buttonKlfActive} : buttonKlf}\n accessibilityLabel={`aria-label-${label}`}\n onPress={handlePressKey}\n testID=\"button-klf\"\n >\n <KlfIcon style={iconKey} color=\"white\" />\n <Text style={buttonKlfText}>{label}</Text>\n </Touchable>\n </View>\n );\n};\n\nconst ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n};\n\nconst ReviewCorrectionPopin = ({\n information,\n klf,\n next,\n type,\n resultLabel\n}: ReviewCorrectionPopinProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n const handlePressNext = next.onClick;\n\n const Icon = ICONS[type];\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, type);\n setStylesheet(_stylesheet);\n }, [theme, type]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.wrapper}>\n <View style={styleSheet.popin}>\n <View style={styleSheet.correctionSection}>\n <View style={styleSheet.iconCircle}>\n <Icon\n style={styleSheet.icon}\n color={type === 'wrong' ? theme.colors.negative : theme.colors.positive}\n />\n </View>\n <Text style={styleSheet.resultLabel}>{resultLabel}</Text>\n </View>\n <View style={styleSheet.feedbackSection} accessibilityLabel=\"answer-information\">\n <View style={styleSheet.labelContainer} needsOffscreenAlphaCompositing>\n <Text accessibilityLabel={information.label} style={styleSheet.label}>\n {information.label}\n </Text>\n </View>\n <Html style={styleSheet.htmlInfoMessage}>{information.message}</Html>\n </View>\n {klf && type === 'wrong' ? <KlfButton styleSheet={styleSheet} klf={klf} /> : null}\n <Touchable\n style={styleSheet.button}\n onPress={handlePressNext}\n accessibilityLabel={next['aria-label']}\n testID={next['data-name']}\n >\n <Text style={styleSheet.buttonText}>{next.label}</Text>\n </Touchable>\n </View>\n </View>\n );\n};\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,IAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,MAAM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E,6BAAC,eAAD;IACE,KAAK,EAAEC,UAAU,CAACvC,MADpB;IAEE,OAAO,EAAEuE,eAFX;IAGE,kBAAkB,EAAEJ,IAAI,CAAC,YAAD,CAH1B;IAIE,MAAM,EAAEA,IAAI,CAAC,WAAD;EAJd,gBAME,6BAAC,eAAD;IAAM,KAAK,EAAE5B,UAAU,CAACpC;EAAxB,GAAqCgE,IAAI,CAACtE,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;eAyDeoE,qB"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","type","StyleSheet","create","wrapper","height","color","colors","white","display","popin","padding","spacing","medium","borderRadius","flexDirection","alignItems","backgroundColor","negative","positive","shadowColor","shadowOpacity","shadowOffset","width","shadowRadius","elevation","correctionSection","iconCircle","justifyContent","opacity","icon","resultLabel","fontSize","fontWeight","lineHeight","marginLeft","textTransform","feedbackSection","marginVertical","labelContainer","alignSelf","paddingHorizontal","tiny","paddingVertical","micro","marginBottom","label","extraBold","htmlInfoMessage","button","base","small","buttonText","cta","bold","textAlign","containerButtonKlf","buttonKlf","buttonKlfActive","buttonKlfText","iconKey","marginRight","containerTooltip","zIndex","position","black","buttonTooltip","bottom","right","htmlTooltipText","text","primary","triangleTooltip","borderStyle","borderLeftWidth","borderRightWidth","borderBottomWidth","borderTopWidth","borderLeftColor","borderTopColor","borderRightColor","borderBottomColor","transform","rotate","left","top","KlfButton","klf","styleSheet","displayTooltip","setDisplayTooltip","useState","fadeIn","fadeOut","animatedOpacity","useUpdateOpacity","easing","Easing","bezier","handlePressKey","useCallback","tooltip","ICONS","RightIcon","wrong","WrongIcon","ReviewCorrectionPopin","information","next","templateContext","useTemplateContext","setStylesheet","handlePressNext","onClick","Icon","useEffect","_stylesheet","message"],"sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\nimport {Animated, Easing, TextStyle, StyleSheet, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon,\n NovaLineLoginKey1 as KlfIcon\n} from '@coorpacademy/nova-icons';\nimport Html from '../../atom/html/index.native';\nimport {Theme} from '../../variables/theme.native';\nimport Text from '../../atom/text/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport useUpdateOpacity from '../../behaviours/use-update-opacity.native';\nimport {ReviewCorrectionPopinKLFProps, ReviewCorrectionPopinProps} from './prop-types';\n\ninterface StyleSheetType {\n wrapper: ViewStyle;\n popin: ViewStyle;\n correctionSection: ViewStyle;\n iconCircle: ViewStyle;\n icon: ViewStyle;\n resultLabel: TextStyle;\n feedbackSection: ViewStyle;\n labelContainer: ViewStyle;\n label: TextStyle;\n htmlInfoMessage: TextStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n buttonKlf: ViewStyle;\n buttonKlfActive: TextStyle;\n buttonKlfText: TextStyle;\n iconKey: ViewStyle;\n containerTooltip: ViewStyle;\n buttonTooltip: ViewStyle;\n containerButtonKlf: ViewStyle;\n triangleTooltip: ViewStyle;\n htmlTooltipText: TextStyle;\n}\n\nconst createStyleSheet = (theme: Theme, type: string): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n height: 'auto',\n color: theme.colors.white,\n display: 'flex'\n },\n popin: {\n padding: theme.spacing.medium,\n borderRadius: 16,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n backgroundColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowOpacity: 0.5,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 15,\n elevation: 4\n },\n correctionSection: {\n flexDirection: 'row',\n alignItems: 'center',\n width: '80%'\n },\n iconCircle: {\n width: 60,\n height: 60,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n opacity: 0.7,\n borderRadius: 50\n },\n icon: {\n height: 30,\n width: 30\n },\n resultLabel: {\n color: theme.colors.white,\n fontSize: 24,\n fontWeight: '600',\n lineHeight: 24,\n marginLeft: 12,\n textTransform: 'uppercase'\n },\n feedbackSection: {\n marginVertical: theme.spacing.medium\n },\n labelContainer: {\n alignSelf: 'flex-start',\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n borderRadius: 56,\n paddingHorizontal: theme.spacing.tiny,\n paddingVertical: theme.spacing.micro,\n marginBottom: 8\n },\n label: {\n color: theme.colors.white,\n fontSize: 14,\n fontWeight: theme.fontWeight.extraBold,\n lineHeight: 17\n },\n htmlInfoMessage: {\n color: theme.colors.white,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 19\n },\n button: {\n alignSelf: 'stretch',\n backgroundColor: theme.colors.white,\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small\n },\n buttonText: {\n color: theme.colors.cta,\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n containerButtonKlf: {\n width: '100%'\n },\n buttonKlf: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small,\n marginBottom: theme.spacing.tiny\n },\n buttonKlfActive: {\n backgroundColor:\n 'linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), rgba(255, 255, 255, 0.1)'\n },\n buttonKlfText: {\n color: 'white',\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n iconKey: {\n width: 12,\n height: 12,\n marginRight: theme.spacing.tiny\n },\n containerTooltip: {\n zIndex: 30,\n position: 'relative',\n shadowColor: theme.colors.black,\n shadowOpacity: 0.3,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 8\n },\n buttonTooltip: {\n flexDirection: 'column',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n borderRadius: 15,\n padding: theme.spacing.small,\n width: '112%',\n position: 'absolute',\n bottom: 4,\n right: -15,\n zIndex: 20\n },\n htmlTooltipText: {\n color: theme.colors.text.primary,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 22,\n textAlign: 'center'\n },\n triangleTooltip: {\n width: 0,\n height: 0,\n backgroundColor: 'transparent',\n borderStyle: 'solid',\n borderLeftWidth: 13,\n borderRightWidth: 13,\n borderBottomWidth: 13,\n borderTopWidth: 13,\n borderLeftColor: 'transparent',\n borderTopColor: 'transparent',\n borderRightColor: theme.colors.white,\n borderBottomColor: theme.colors.white,\n transform: [{rotate: '45deg'}],\n position: 'absolute',\n left: 110,\n top: -20,\n borderRadius: 4\n }\n });\n\nconst KlfButton = ({\n klf,\n styleSheet\n}: {\n klf: ReviewCorrectionPopinKLFProps;\n styleSheet: StyleSheetType;\n}) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const {fadeIn, fadeOut, animatedOpacity} = useUpdateOpacity({\n easing: Easing.bezier(0.25, 1, 0.5, 1)\n });\n\n const handlePressKey = useCallback(() => {\n setDisplayTooltip(!displayTooltip);\n !displayTooltip ? fadeIn() : fadeOut();\n }, [displayTooltip, fadeIn, fadeOut]);\n\n const {\n buttonKlf,\n buttonKlfActive,\n buttonKlfText,\n containerButtonKlf,\n containerTooltip,\n buttonTooltip,\n htmlTooltipText,\n iconKey,\n triangleTooltip\n } = styleSheet;\n\n const {label, tooltip} = klf;\n\n return (\n <View style={containerButtonKlf}>\n <Animated.View style={[containerTooltip, animatedOpacity]}>\n <Touchable\n style={buttonTooltip}\n accessibilityLabel={`aria-label-tooltip`}\n isHighlight\n onPress={handlePressKey}\n testID=\"button-tooltip\"\n >\n <Html style={htmlTooltipText}>{tooltip}</Html>\n </Touchable>\n <View style={triangleTooltip} />\n </Animated.View>\n <Touchable\n style={displayTooltip ? {...buttonKlf, ...buttonKlfActive} : buttonKlf}\n accessibilityLabel={`aria-label-${label}`}\n onPress={handlePressKey}\n testID=\"button-klf\"\n >\n <KlfIcon style={iconKey} color=\"white\" />\n <Text style={buttonKlfText}>{label}</Text>\n </Touchable>\n </View>\n );\n};\n\nconst ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n};\n\nconst ReviewCorrectionPopin = ({\n information,\n klf,\n next,\n type,\n resultLabel\n}: ReviewCorrectionPopinProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n const handlePressNext = next.onClick;\n\n const Icon = ICONS[type];\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, type);\n setStylesheet(_stylesheet);\n }, [theme, type]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.wrapper}>\n <View style={styleSheet.popin}>\n <View style={styleSheet.correctionSection}>\n <View style={styleSheet.iconCircle}>\n <Icon\n style={styleSheet.icon}\n color={type === 'wrong' ? theme.colors.negative : theme.colors.positive}\n />\n </View>\n <Text style={styleSheet.resultLabel}>{resultLabel}</Text>\n </View>\n <View style={styleSheet.feedbackSection} accessibilityLabel=\"answer-information\">\n <View style={styleSheet.labelContainer} needsOffscreenAlphaCompositing>\n <Text accessibilityLabel={information.label} style={styleSheet.label}>\n {information.label}\n </Text>\n </View>\n <Html style={styleSheet.htmlInfoMessage}>{information.message}</Html>\n </View>\n {klf && type === 'wrong' ? <KlfButton styleSheet={styleSheet} klf={klf} /> : null}\n <Touchable\n style={styleSheet.button}\n onPress={handlePressNext}\n accessibilityLabel={next['aria-label']}\n testID={next['data-name']}\n >\n <Text style={styleSheet.buttonText}>{next.label}</Text>\n </Touchable>\n </View>\n </View>\n );\n};\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,IAAf,KACvBC,uBAAA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zD;EAAxB,GAAsCA,WAAtC,CAPF,CADF,eAUE,6BAAC,iBAAD;IAAM,KAAK,EAAEyD,UAAU,CAACnD,eAAxB;IAAyC,kBAAkB,EAAC;EAA5D,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEmD,UAAU,CAACjD,cAAxB;IAAwC,8BAA8B;EAAtE,gBACE,6BAAC,eAAD;IAAM,kBAAkB,EAAEoE,WAAW,CAAC7D,KAAtC;IAA6C,KAAK,EAAE0C,UAAU,CAAC1C;EAA/D,GACG6D,WAAW,CAAC7D,KADf,CADF,CADF,eAME,6BAAC,cAAD;IAAM,KAAK,EAAE0C,UAAU,CAACxC;EAAxB,GAA0C2D,WAAW,CAACU,OAAtD,CANF,CAVF,EAkBG9B,GAAG,IAAItF,IAAI,KAAK,OAAhB,gBAA0B,6BAAC,SAAD;IAAW,UAAU,EAAEuF,UAAvB;IAAmC,GAAG,EAAED;EAAxC,EAA1B,GAA4E,IAlB/E,eAmBE,6BAAC,eAAD;IACE,KAAK,EAAEC,UAAU,CAACvC,MADpB;IAEE,OAAO,EAAE+D,eAFX;IAGE,kBAAkB,EAAEJ,IAAI,CAAC,YAAD,CAH1B;IAIE,MAAM,EAAEA,IAAI,CAAC,WAAD;EAJd,gBAME,6BAAC,eAAD;IAAM,KAAK,EAAEpB,UAAU,CAACpC;EAAxB,GAAqCwD,IAAI,CAAC9D,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;eAyDe4D,qB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/get-the-app/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/get-the-app/index.js"],"names":[],"mappings":";AAoIA,kEA+DC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3ED;;gBAMC"}
|
|
@@ -13,6 +13,8 @@ var _novaIcons = require("@coorpacademy/nova-icons");
|
|
|
13
13
|
|
|
14
14
|
var _button = _interopRequireDefault(require("../../atom/button"));
|
|
15
15
|
|
|
16
|
+
var _picture = _interopRequireDefault(require("../../atom/picture"));
|
|
17
|
+
|
|
16
18
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -104,17 +106,21 @@ const StoresLinks = ({
|
|
|
104
106
|
onAppStoreButtonClick,
|
|
105
107
|
appStoreButtonImageUrl,
|
|
106
108
|
playStoreButtonImageUrl,
|
|
107
|
-
onPlayStoreButtonClick
|
|
109
|
+
onPlayStoreButtonClick,
|
|
110
|
+
'android-alt': androidAlt,
|
|
111
|
+
'ios-alt': iosAlt
|
|
108
112
|
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
109
113
|
className: _style.default.storeLinksContainer
|
|
110
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
111
115
|
className: _style.default.img,
|
|
112
116
|
src: appStoreButtonImageUrl,
|
|
113
|
-
onClick: onAppStoreButtonClick
|
|
114
|
-
|
|
117
|
+
onClick: onAppStoreButtonClick,
|
|
118
|
+
alt: iosAlt
|
|
119
|
+
}), /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
115
120
|
className: _style.default.img,
|
|
116
121
|
src: playStoreButtonImageUrl,
|
|
117
|
-
onClick: onPlayStoreButtonClick
|
|
122
|
+
onClick: onPlayStoreButtonClick,
|
|
123
|
+
alt: androidAlt
|
|
118
124
|
}));
|
|
119
125
|
|
|
120
126
|
StoresLinks.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Header","step","header","subHeader","style","headerContainer","headerWrapper","propTypes","PropTypes","string","QrCodeImage","showMobileAppAccess","qrCodeImageUrl","preMessage","linkMessage","endMessage","qrcodeWrapper","qrcodeOverlay","qrcodeModal","qrcodeModalLink","bool","MagicLink","disabled","submitValue","magicLinkUrl","color","buttonWrapper","iconWrapper","magicLinkIcon","StoresLinks","onAppStoreButtonClick","appStoreButtonImageUrl","playStoreButtonImageUrl","onPlayStoreButtonClick","storeLinksContainer","img","func","Divider","word","dividerWrapper","divider","GetTheApp","props","context","storeStep","connectionStep","qrCodeStep","magicLinkStep","diviserWord","skin","primaryColor","container","coorpAppLogoWrapper","coorpAppLogo","store","secondStepWrapper","connectionWrapper","wrapper","shape"],"sources":["../../../src/organism/get-the-app/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyMagicWand as MagicWand,\n NovaCompositionCoorpacademyCoorpApp as CoorpAppLogo\n} from '@coorpacademy/nova-icons';\nimport {get} from 'lodash/fp';\nimport Button from '../../atom/button';\nimport style from './style.css';\n\nconst Header = ({step, header, subHeader}) => (\n <div className={style.headerContainer}>\n {step ? (\n <div className={style.headerWrapper}>\n <h1 className={style.step}>{step}</h1>\n <h1 className={style.header}>{header}</h1>\n </div>\n ) : (\n <h1 className={style.header}>{header} </h1>\n )}\n {subHeader ? <h4 className={style.subHeader}>{subHeader} </h4> : null}\n </div>\n);\n\nHeader.propTypes = {\n step: PropTypes.string,\n header: PropTypes.string,\n subHeader: PropTypes.string\n};\n\nconst QrCodeImage = ({\n showMobileAppAccess,\n qrCodeImageUrl,\n preMessage,\n linkMessage,\n endMessage\n}) => {\n return (\n <div className={style.qrcodeWrapper}>\n <img src={qrCodeImageUrl} />\n {showMobileAppAccess ? (\n <div className={style.qrcodeOverlay}>\n <div className={style.qrcodeModal}>\n <span>{preMessage} </span>\n <a href=\"mailto:assistance@coorpacademy.com\" className={style.qrcodeModalLink}>\n <span>{linkMessage} </span>\n </a>\n <span>{endMessage} </span>\n </div>\n </div>\n ) : null}\n </div>\n );\n};\nQrCodeImage.propTypes = {\n showMobileAppAccess: PropTypes.bool,\n qrCodeImageUrl: PropTypes.string,\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string\n};\n\nconst MagicLink = ({disabled, submitValue, magicLinkUrl, color}) => {\n return (\n <div className={style.buttonWrapper}>\n <Button\n color={color}\n disabled={disabled}\n isLinkDisabled={disabled}\n href={magicLinkUrl}\n type=\"link\"\n submitValue={null}\n >\n <div className={style.iconWrapper}>\n <MagicWand className={style.magicLinkIcon} />\n <p>{submitValue}</p>\n </div>\n </Button>\n </div>\n );\n};\n\nMagicLink.propTypes = {\n magicLinkUrl: PropTypes.string,\n disabled: PropTypes.bool,\n submitValue: PropTypes.string\n};\n\nconst StoresLinks = ({\n onAppStoreButtonClick,\n appStoreButtonImageUrl,\n playStoreButtonImageUrl,\n onPlayStoreButtonClick\n}) => (\n <div className={style.storeLinksContainer}>\n <img className={style.img} src={appStoreButtonImageUrl} onClick={onAppStoreButtonClick} />\n <img className={style.img} src={playStoreButtonImageUrl} onClick={onPlayStoreButtonClick} />\n </div>\n);\n\nStoresLinks.propTypes = {\n onAppStoreButtonClick: PropTypes.func,\n appStoreButtonImageUrl: PropTypes.string,\n playStoreButtonImageUrl: PropTypes.string,\n onPlayStoreButtonClick: PropTypes.func\n};\n\nconst Divider = ({word}) => (\n <div className={style.dividerWrapper}>\n <div className={style.divider} />\n <p>{word}</p>\n <div className={style.divider} />\n </div>\n);\n\nDivider.propTypes = {\n word: PropTypes.string\n};\n\nconst GetTheApp = (props, context) => {\n const {\n onAppStoreButtonClick,\n appStoreButtonImageUrl,\n playStoreButtonImageUrl,\n onPlayStoreButtonClick,\n storeStep,\n connectionStep,\n qrCodeStep,\n magicLinkStep,\n diviserWord,\n qrCodeImageUrl,\n magicLinkUrl,\n disabled,\n showMobileAppAccess,\n submitValue,\n preMessage,\n linkMessage,\n endMessage\n } = props;\n const {skin} = context;\n const primaryColor = get('common.primary', skin);\n return (\n <div className={style.container}>\n <div className={style.coorpAppLogoWrapper}>\n <CoorpAppLogo height={51} width={250} className={style.coorpAppLogo} />\n </div>\n <div className={style.store}>\n <Header {...storeStep} />\n <StoresLinks\n onAppStoreButtonClick={onAppStoreButtonClick}\n appStoreButtonImageUrl={appStoreButtonImageUrl}\n playStoreButtonImageUrl={playStoreButtonImageUrl}\n onPlayStoreButtonClick={onPlayStoreButtonClick}\n />\n </div>\n <div className={style.secondStepWrapper}>\n <Header {...connectionStep} />\n <div className={style.connectionWrapper}>\n <div className={style.wrapper}>\n <Header {...qrCodeStep} />\n <QrCodeImage\n showMobileAppAccess={showMobileAppAccess}\n qrCodeImageUrl={qrCodeImageUrl}\n preMessage={preMessage}\n linkMessage={linkMessage}\n endMessage={endMessage}\n />\n </div>\n <Divider word={diviserWord} />\n <div className={style.wrapper}>\n <Header {...magicLinkStep} />\n <MagicLink\n color={primaryColor}\n submitValue={submitValue}\n disabled={disabled}\n magicLinkUrl={magicLinkUrl}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nGetTheApp.propTypes = {\n ...StoresLinks.propTypes,\n storeStep: PropTypes.shape(Header.propTypes),\n connectionStep: PropTypes.shape(Header.propTypes),\n qrCodeStep: PropTypes.shape(Header.propTypes),\n magicLinkStep: PropTypes.shape(Header.propTypes),\n ...QrCodeImage.propTypes,\n diviserWord: Divider.propTypes.word,\n ...MagicLink.propTypes\n};\n\nexport default GetTheApp;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAKA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAG,CAAC;EAACC,IAAD;EAAOC,MAAP;EAAeC;AAAf,CAAD,kBACb;EAAK,SAAS,EAAEC,cAAA,CAAMC;AAAtB,GACGJ,IAAI,gBACH;EAAK,SAAS,EAAEG,cAAA,CAAME;AAAtB,gBACE;EAAI,SAAS,EAAEF,cAAA,CAAMH;AAArB,GAA4BA,IAA5B,CADF,eAEE;EAAI,SAAS,EAAEG,cAAA,CAAMF;AAArB,GAA8BA,MAA9B,CAFF,CADG,gBAMH;EAAI,SAAS,EAAEE,cAAA,CAAMF;AA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cAAA,CAAMqD;EAAtB,gBACE,6BAAC,MAAD,EAAYX,UAAZ,CADF,eAEE,6BAAC,WAAD;IACE,mBAAmB,EAAEnC,mBADvB;IAEE,cAAc,EAAEC,cAFlB;IAGE,UAAU,EAAEC,UAHd;IAIE,WAAW,EAAEC,WAJf;IAKE,UAAU,EAAEC;EALd,EAFF,CADF,eAWE,6BAAC,OAAD;IAAS,IAAI,EAAEiC;EAAf,EAXF,eAYE;IAAK,SAAS,EAAE5C,cAAA,CAAMqD;EAAtB,gBACE,6BAAC,MAAD,EAAYV,aAAZ,CADF,eAEE,6BAAC,SAAD;IACE,KAAK,EAAEG,YADT;IAEE,WAAW,EAAE3B,WAFf;IAGE,QAAQ,EAAED,QAHZ;IAIE,YAAY,EAAEE;EAJhB,EAFF,CAZF,CAFF,CAbF,CADF;AAyCD,CA/DD;;AAiEAiB,SAAS,CAAClC,SAAV,wDACKsB,WAAW,CAACtB,SADjB;EAEEqC,SAAS,EAAEpC,kBAAA,CAAUkD,KAAV,CAAgB1D,MAAM,CAACO,SAAvB,CAFb;EAGEsC,cAAc,EAAErC,kBAAA,CAAUkD,KAAV,CAAgB1D,MAAM,CAACO,SAAvB,CAHlB;EAIEuC,UAAU,EAAEtC,kBAAA,CAAUkD,KAAV,CAAgB1D,MAAM,CAACO,SAAvB,CAJd;EAKEwC,aAAa,EAAEvC,kBAAA,CAAUkD,KAAV,CAAgB1D,MAAM,CAACO,SAAvB;AALjB,GAMKG,WAAW,CAACH,SANjB;EAOEyC,WAAW,EAAEX,OAAO,CAAC9B,SAAR,CAAkB+B;AAPjC,GAQKjB,SAAS,CAACd,SARf;eAWekC,S"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Header","step","header","subHeader","style","headerContainer","headerWrapper","propTypes","PropTypes","string","QrCodeImage","showMobileAppAccess","qrCodeImageUrl","preMessage","linkMessage","endMessage","qrcodeWrapper","qrcodeOverlay","qrcodeModal","qrcodeModalLink","bool","MagicLink","disabled","submitValue","magicLinkUrl","color","buttonWrapper","iconWrapper","magicLinkIcon","StoresLinks","onAppStoreButtonClick","appStoreButtonImageUrl","playStoreButtonImageUrl","onPlayStoreButtonClick","androidAlt","iosAlt","storeLinksContainer","img","func","Divider","word","dividerWrapper","divider","GetTheApp","props","context","storeStep","connectionStep","qrCodeStep","magicLinkStep","diviserWord","skin","primaryColor","container","coorpAppLogoWrapper","coorpAppLogo","store","secondStepWrapper","connectionWrapper","wrapper","shape"],"sources":["../../../src/organism/get-the-app/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyMagicWand as MagicWand,\n NovaCompositionCoorpacademyCoorpApp as CoorpAppLogo\n} from '@coorpacademy/nova-icons';\nimport {get} from 'lodash/fp';\nimport Button from '../../atom/button';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst Header = ({step, header, subHeader}) => (\n <div className={style.headerContainer}>\n {step ? (\n <div className={style.headerWrapper}>\n <h1 className={style.step}>{step}</h1>\n <h1 className={style.header}>{header}</h1>\n </div>\n ) : (\n <h1 className={style.header}>{header} </h1>\n )}\n {subHeader ? <h4 className={style.subHeader}>{subHeader} </h4> : null}\n </div>\n);\n\nHeader.propTypes = {\n step: PropTypes.string,\n header: PropTypes.string,\n subHeader: PropTypes.string\n};\n\nconst QrCodeImage = ({\n showMobileAppAccess,\n qrCodeImageUrl,\n preMessage,\n linkMessage,\n endMessage\n}) => {\n return (\n <div className={style.qrcodeWrapper}>\n <img src={qrCodeImageUrl} />\n {showMobileAppAccess ? (\n <div className={style.qrcodeOverlay}>\n <div className={style.qrcodeModal}>\n <span>{preMessage} </span>\n <a href=\"mailto:assistance@coorpacademy.com\" className={style.qrcodeModalLink}>\n <span>{linkMessage} </span>\n </a>\n <span>{endMessage} </span>\n </div>\n </div>\n ) : null}\n </div>\n );\n};\nQrCodeImage.propTypes = {\n showMobileAppAccess: PropTypes.bool,\n qrCodeImageUrl: PropTypes.string,\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string\n};\n\nconst MagicLink = ({disabled, submitValue, magicLinkUrl, color}) => {\n return (\n <div className={style.buttonWrapper}>\n <Button\n color={color}\n disabled={disabled}\n isLinkDisabled={disabled}\n href={magicLinkUrl}\n type=\"link\"\n submitValue={null}\n >\n <div className={style.iconWrapper}>\n <MagicWand className={style.magicLinkIcon} />\n <p>{submitValue}</p>\n </div>\n </Button>\n </div>\n );\n};\n\nMagicLink.propTypes = {\n magicLinkUrl: PropTypes.string,\n disabled: PropTypes.bool,\n submitValue: PropTypes.string\n};\n\nconst StoresLinks = ({\n onAppStoreButtonClick,\n appStoreButtonImageUrl,\n playStoreButtonImageUrl,\n onPlayStoreButtonClick,\n 'android-alt': androidAlt,\n 'ios-alt': iosAlt\n}) => (\n <div className={style.storeLinksContainer}>\n <Picture\n className={style.img}\n src={appStoreButtonImageUrl}\n onClick={onAppStoreButtonClick}\n alt={iosAlt}\n />\n <Picture\n className={style.img}\n src={playStoreButtonImageUrl}\n onClick={onPlayStoreButtonClick}\n alt={androidAlt}\n />\n </div>\n);\n\nStoresLinks.propTypes = {\n onAppStoreButtonClick: PropTypes.func,\n appStoreButtonImageUrl: PropTypes.string,\n playStoreButtonImageUrl: PropTypes.string,\n onPlayStoreButtonClick: PropTypes.func\n};\n\nconst Divider = ({word}) => (\n <div className={style.dividerWrapper}>\n <div className={style.divider} />\n <p>{word}</p>\n <div className={style.divider} />\n </div>\n);\n\nDivider.propTypes = {\n word: PropTypes.string\n};\n\nconst GetTheApp = (props, context) => {\n const {\n onAppStoreButtonClick,\n appStoreButtonImageUrl,\n playStoreButtonImageUrl,\n onPlayStoreButtonClick,\n storeStep,\n connectionStep,\n qrCodeStep,\n magicLinkStep,\n diviserWord,\n qrCodeImageUrl,\n magicLinkUrl,\n disabled,\n showMobileAppAccess,\n submitValue,\n preMessage,\n linkMessage,\n endMessage\n } = props;\n const {skin} = context;\n const primaryColor = get('common.primary', skin);\n return (\n <div className={style.container}>\n <div className={style.coorpAppLogoWrapper}>\n <CoorpAppLogo height={51} width={250} className={style.coorpAppLogo} />\n </div>\n <div className={style.store}>\n <Header {...storeStep} />\n <StoresLinks\n onAppStoreButtonClick={onAppStoreButtonClick}\n appStoreButtonImageUrl={appStoreButtonImageUrl}\n playStoreButtonImageUrl={playStoreButtonImageUrl}\n onPlayStoreButtonClick={onPlayStoreButtonClick}\n />\n </div>\n <div className={style.secondStepWrapper}>\n <Header {...connectionStep} />\n <div className={style.connectionWrapper}>\n <div className={style.wrapper}>\n <Header {...qrCodeStep} />\n <QrCodeImage\n showMobileAppAccess={showMobileAppAccess}\n qrCodeImageUrl={qrCodeImageUrl}\n preMessage={preMessage}\n linkMessage={linkMessage}\n endMessage={endMessage}\n />\n </div>\n <Divider word={diviserWord} />\n <div className={style.wrapper}>\n <Header {...magicLinkStep} />\n <MagicLink\n color={primaryColor}\n submitValue={submitValue}\n disabled={disabled}\n magicLinkUrl={magicLinkUrl}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nGetTheApp.propTypes = {\n ...StoresLinks.propTypes,\n storeStep: PropTypes.shape(Header.propTypes),\n connectionStep: PropTypes.shape(Header.propTypes),\n qrCodeStep: PropTypes.shape(Header.propTypes),\n magicLinkStep: PropTypes.shape(Header.propTypes),\n ...QrCodeImage.propTypes,\n diviserWord: Divider.propTypes.word,\n ...MagicLink.propTypes\n};\n\nexport default GetTheApp;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAKA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAG,CAAC;EAACC,IAAD;EAAOC,MAAP;EAAeC;AAAf,CAAD,kBACb;EAAK,SAAS,EAAEC,cAAA,CAAMC;AAAtB,GACGJ,IAAI,gBACH;EAAK,SAAS,EAAEG,cAAA,CAAME;AAAtB,gBACE;EAAI,SAAS,EAAEF,cAAA,CAAMH;AAArB,GAA4BA,IAA5B,CADF,eAEE;EAAI,SAAS,EAAEG,cAAA,CAAMF;AAArB,GAA8BA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"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-footer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-footer/index.js"],"names":[],"mappings":";AA+CA,qDA+HC"}
|
|
@@ -15,6 +15,8 @@ var _link = _interopRequireDefault(require("../../atom/link"));
|
|
|
15
15
|
|
|
16
16
|
var _socialLink = _interopRequireDefault(require("../../atom/social-link"));
|
|
17
17
|
|
|
18
|
+
var _picture = _interopRequireDefault(require("../../atom/picture"));
|
|
19
|
+
|
|
18
20
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -30,12 +32,12 @@ const StoresLinks = ({
|
|
|
30
32
|
'ios-alt': iosAlt
|
|
31
33
|
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
32
34
|
className: _style.default.storeLinksContainer
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
34
36
|
className: _style.default.imgApple,
|
|
35
37
|
src: appStoreButtonImageUrl,
|
|
36
38
|
onClick: onAppStoreButtonClick,
|
|
37
39
|
alt: iosAlt
|
|
38
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
40
|
+
}), /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
39
41
|
className: _style.default.img,
|
|
40
42
|
src: playStoreButtonImageUrl,
|
|
41
43
|
onClick: onPlayStoreButtonClick,
|