@coorpacademy/components 10.30.12-alpha.3 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/molecule/card-congrats/index.native.d.ts.map +1 -1
- package/es/molecule/card-congrats/index.native.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 +8 -9
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/organism/review-congrats/index.native.d.ts.map +1 -1
- package/es/organism/review-congrats/index.native.js +60 -67
- 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 +4 -3
- 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 +4 -7
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/template/activity/engine-stars.css +5 -4
- package/es/template/activity/stars-summary.css +12 -3
- package/es/template/activity/style.css +1 -4
- package/lib/molecule/card-congrats/index.native.d.ts.map +1 -1
- package/lib/molecule/card-congrats/index.native.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 +9 -10
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
- package/lib/organism/review-congrats/index.native.js +60 -68
- 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 +5 -4
- 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 +5 -8
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/template/activity/engine-stars.css +5 -4
- package/lib/template/activity/stars-summary.css +12 -3
- package/lib/template/activity/style.css +1 -4
- package/locales/.mtslconfig.json +1 -0
- package/package.json +4 -3
- package/es/behaviours/use-translate-vertically.native.d.ts +0 -16
- package/es/behaviours/use-translate-vertically.native.d.ts.map +0 -1
- package/es/behaviours/use-translate-vertically.native.js +0 -44
- package/es/behaviours/use-translate-vertically.native.js.map +0 -1
- package/es/behaviours/use-update-opacity.native.d.ts +0 -14
- package/es/behaviours/use-update-opacity.native.d.ts.map +0 -1
- package/es/behaviours/use-update-opacity.native.js +0 -55
- package/es/behaviours/use-update-opacity.native.js.map +0 -1
- package/lib/behaviours/use-translate-vertically.native.d.ts +0 -16
- package/lib/behaviours/use-translate-vertically.native.d.ts.map +0 -1
- package/lib/behaviours/use-translate-vertically.native.js +0 -51
- package/lib/behaviours/use-translate-vertically.native.js.map +0 -1
- package/lib/behaviours/use-update-opacity.native.d.ts +0 -14
- package/lib/behaviours/use-update-opacity.native.d.ts.map +0 -1
- package/lib/behaviours/use-update-opacity.native.js +0 -62
- package/lib/behaviours/use-update-opacity.native.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { Animated, StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
3
|
import keys from 'lodash/fp/keys';
|
|
4
|
+
import { useTranslateY } from '@coorpacademy/react-native-animation';
|
|
4
5
|
import Slide from '../review-slide/index.native';
|
|
5
|
-
import useTranslateVertically from '../../behaviours/use-translate-vertically.native';
|
|
6
6
|
export const TOTAL_SLIDES_STACK = 5;
|
|
7
7
|
const style = StyleSheet.create({
|
|
8
8
|
slides: {
|
|
@@ -21,15 +21,12 @@ const StackedSlides = props => {
|
|
|
21
21
|
validateButton,
|
|
22
22
|
correctionPopinProps
|
|
23
23
|
} = props;
|
|
24
|
-
const {
|
|
25
|
-
translate,
|
|
26
|
-
animatedY
|
|
27
|
-
} = useTranslateVertically({
|
|
24
|
+
const hideSlides = useTranslateY({
|
|
28
25
|
fromValue: 0,
|
|
29
26
|
toValue: windowHeight,
|
|
30
27
|
duration: 800
|
|
31
28
|
});
|
|
32
|
-
useEffect(
|
|
29
|
+
useEffect(() => hideSlides.start(), []);
|
|
33
30
|
const indexes = keys(slides).reverse();
|
|
34
31
|
const stackedSlides = indexes.map(slideIndex => {
|
|
35
32
|
const slide = slides[slideIndex];
|
|
@@ -43,7 +40,7 @@ const StackedSlides = props => {
|
|
|
43
40
|
});
|
|
44
41
|
});
|
|
45
42
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
46
|
-
style: [style.slides,
|
|
43
|
+
style: [style.slides, hideSlides.animatedStyle]
|
|
47
44
|
}, stackedSlides);
|
|
48
45
|
};
|
|
49
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","Animated","StyleSheet","useWindowDimensions","keys","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","Animated","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","StackedSlides","props","windowHeight","validateButton","correctionPopinProps","hideSlides","fromValue","toValue","duration","start","indexes","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt","animatedStyle"],"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 {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Slide from '../review-slide/index.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 hideSlides = useTranslateY({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n useEffect(() => hideSlides.start(), []);\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 (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>{stackedSlides}</Animated.View>\n );\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,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,KAAP,MAAkB,8BAAlB;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,MAAMI,UAAU,GAAGd,aAAa,CAAC;IAC/Be,SAAS,EAAE,CADoB;IAE/BC,OAAO,EAAEL,YAFsB;IAG/BM,QAAQ,EAAE;EAHqB,CAAD,CAAhC;EAMAtB,SAAS,CAAC,MAAMmB,UAAU,CAACI,KAAX,EAAP,EAA2B,EAA3B,CAAT;EAEA,MAAMC,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,oBACE,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACpB,KAAK,CAACE,MAAP,EAAeS,UAAU,CAACc,aAA1B;EAAtB,GAAiEP,aAAjE,CADF;AAGD,CAjCD;;AAmCA,eAAeZ,aAAf"}
|
|
@@ -211,9 +211,9 @@
|
|
|
211
211
|
@media tablet, mobile {
|
|
212
212
|
.engineStars {
|
|
213
213
|
width: auto;
|
|
214
|
-
height:
|
|
214
|
+
height: 75px;
|
|
215
215
|
flex: 1 2;
|
|
216
|
-
justify-content: flex-
|
|
216
|
+
justify-content: flex-end;
|
|
217
217
|
padding-bottom: 8px;
|
|
218
218
|
overflow: none;
|
|
219
219
|
top: 0;
|
|
@@ -223,8 +223,8 @@
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
.engineIcon {
|
|
226
|
-
width:
|
|
227
|
-
height:
|
|
226
|
+
width: 30px;
|
|
227
|
+
height: 25px;
|
|
228
228
|
right: 5px;
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -235,6 +235,7 @@
|
|
|
235
235
|
align-items: flex-end;
|
|
236
236
|
align-content: flex-end;
|
|
237
237
|
padding: 0;
|
|
238
|
+
margin: 0;
|
|
238
239
|
box-sizing: border-box;
|
|
239
240
|
}
|
|
240
241
|
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.myStarsWrapper {
|
|
37
|
+
display: inline-block;
|
|
37
38
|
max-width: 690px;
|
|
39
|
+
float: right;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.footerSummaryStars{
|
|
@@ -143,8 +145,7 @@
|
|
|
143
145
|
@media tablet, mobile {
|
|
144
146
|
.myStars,
|
|
145
147
|
.allStars,
|
|
146
|
-
.totalStars
|
|
147
|
-
.myStarsWrapper {
|
|
148
|
+
.totalStars {
|
|
148
149
|
width: 100%;
|
|
149
150
|
}
|
|
150
151
|
|
|
@@ -169,7 +170,15 @@
|
|
|
169
170
|
overflow: hidden;
|
|
170
171
|
overflow-x: auto;
|
|
171
172
|
}
|
|
172
|
-
|
|
173
|
+
|
|
174
|
+
.navigationLeft {
|
|
175
|
+
display: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.navigationRight {
|
|
179
|
+
display: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
173
182
|
.iconHeader {
|
|
174
183
|
width: 13px;
|
|
175
184
|
height: 13px;
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
.recommendationWrapper {
|
|
126
|
-
|
|
126
|
+
display: none;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.wrapperCta {
|
|
@@ -142,9 +142,6 @@
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.select {
|
|
145
|
-
margin-left: 24px;
|
|
146
|
-
margin-right: 40px;
|
|
147
|
-
margin-top: 30px;
|
|
148
145
|
padding-bottom: 0;
|
|
149
146
|
}
|
|
150
147
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/card-congrats/index.native.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAwD1C,QAAA,MAAM,YAAY,yEAQf,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/card-congrats/index.native.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAwD1C,QAAA,MAAM,YAAY,yEAQf,iBAAiB,uBAyBnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -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
|
|
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 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.iconSmall} color={iconColor} />\n </View>\n </View>\n );\n};\n\nexport default CardCongrats;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAaA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,YAAY,EAAE,EADL;IAETC,KAAK,EAAE,GAFE;IAGTC,MAAM,EAAE;EAHC,CADK;EAMhB;EACAC,IAAI;IACFC,UAAU,EAAE,QADV;IAEFC,UAAU,EAAE,EAFV;IAGFC,aAAa,EAAE,EAHb;IAIFC,YAAY,EAAE,EAJZ;IAKFC,MAAM,EAAE,EALN;IAMFP,KAAK,EAAE,GANL;IAOFC,MAAM,EAAE;EAPN,GAQCO,iBARD;IASFC,eAAe,EAAEd,KAAK,CAACe,MAAN,CAAaC;EAT5B,EAPY;EAkBhBC,SAAS,EAAE;IACTC,UAAU,EAAE,KADH;IAETC,QAAQ,EAAE,EAFD;IAGTC,UAAU,EAAE,EAHH;IAITC,KAAK,EAAErB,KAAK,CAACe,MAAN,CAAaO,IAAb,CAAkBC;EAJhB,CAlBK;EAwBhBC,MAAM,EAAE;IACNhB,UAAU,EA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AZ,EAAoB;MAACmB,aAAa,EAAER;IAAhB,CAApB;EAAb,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAE,CAACE,UAAU,CAACZ,UAAZ,EAAwB;MAACJ,KAAK,EAAEa;IAAR,CAAxB;EAAb,GAA2DF,KAA3D,CADF,eAEE,6BAAC,IAAD;IAAM,KAAK,EAAEK,UAAU,CAACT,SAAxB;IAAmC,KAAK,EAAEK;EAA1C,EAFF,CALF,CADF;AAYD,CAjCD;;eAmCeJ,Y"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AA4PvF,QAAA,MAAM,qBAAqB,kDAMxB,0BAA0B,uBAiD5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -9,6 +9,8 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
|
|
10
10
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
11
11
|
|
|
12
|
+
var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
|
|
13
|
+
|
|
12
14
|
var _index = _interopRequireDefault(require("../../atom/html/index.native"));
|
|
13
15
|
|
|
14
16
|
var _index2 = _interopRequireDefault(require("../../atom/text/index.native"));
|
|
@@ -17,8 +19,6 @@ var _index3 = _interopRequireDefault(require("../../hoc/touchable/index.native")
|
|
|
17
19
|
|
|
18
20
|
var _templateContext = require("../../template/app-review/template-context");
|
|
19
21
|
|
|
20
|
-
var _useUpdateOpacity = _interopRequireDefault(require("../../behaviours/use-update-opacity.native"));
|
|
21
|
-
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
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); }
|
|
@@ -198,17 +198,16 @@ const KlfButton = ({
|
|
|
198
198
|
styleSheet
|
|
199
199
|
}) => {
|
|
200
200
|
const [displayTooltip, setDisplayTooltip] = (0, _react.useState)(false);
|
|
201
|
-
const {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
} = (0, _useUpdateOpacity.default)({
|
|
201
|
+
const fadeIn = (0, _reactNativeAnimation.useAnimateProp)({
|
|
202
|
+
property: 'opacity',
|
|
203
|
+
fromValue: 0,
|
|
204
|
+
toValue: 1,
|
|
206
205
|
easing: _reactNative.Easing.bezier(0.25, 1, 0.5, 1)
|
|
207
206
|
});
|
|
208
207
|
const handlePressKey = (0, _react.useCallback)(() => {
|
|
209
208
|
setDisplayTooltip(!displayTooltip);
|
|
210
|
-
!displayTooltip ? fadeIn() :
|
|
211
|
-
}, [displayTooltip, fadeIn
|
|
209
|
+
!displayTooltip ? fadeIn.start() : fadeIn.revert();
|
|
210
|
+
}, [displayTooltip, fadeIn]);
|
|
212
211
|
const {
|
|
213
212
|
buttonKlf,
|
|
214
213
|
buttonKlfActive,
|
|
@@ -227,7 +226,7 @@ const KlfButton = ({
|
|
|
227
226
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
228
227
|
style: containerButtonKlf
|
|
229
228
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
230
|
-
style: [containerTooltip,
|
|
229
|
+
style: [containerTooltip, fadeIn.animatedStyle]
|
|
231
230
|
}, /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
232
231
|
style: buttonTooltip,
|
|
233
232
|
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","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,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,MAAM,EAAE,MADD;IAEPC,KAAK,EAAEN,KAAK,CAACO,MAAN,CAAaC,KAFb;IAGPC,OAAO,EAAE;EAHF,CADO;EAMhBC,KAAK,EAAE;IACLC,OAAO,EAAEX,KAAK,CAACY,OAAN,CAAcC,MADlB;IAELC,YAAY,EAAE,EAFT;IAGLL,OAAO,EAAE,MAHJ;IAILM,aAAa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A6C,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
|
+
{"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","useAnimateProp","property","fromValue","toValue","easing","Easing","bezier","handlePressKey","useCallback","start","revert","tooltip","animatedStyle","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 {useAnimateProp} from '@coorpacademy/react-native-animation';\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 },\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 = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n easing: Easing.bezier(0.25, 1, 0.5, 1)\n });\n\n const handlePressKey = useCallback(() => {\n setDisplayTooltip(!displayTooltip);\n !displayTooltip ? fadeIn.start() : fadeIn.revert();\n }, [displayTooltip, fadeIn]);\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, fadeIn.animatedStyle]}>\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;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,IAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,MAAM,EAAE,MADD;IAEPC,KAAK,EAAEN,KAAK,CAACO,MAAN,CAAaC,KAFb;IAGPC,OAAO,EAAE;EAHF,CADO;EAMhBC,KAAK,EAAE;IACLC,OAAO,EAAEX,KAAK,CAACY,OAAN,CAAcC,MADlB;IAELC,YAAY,EAAE,EAFT;IAGLL,OAAO,EAAE,MAHJ;IAILM,aAAa,EAAE,QAJV;IAKLC,UAAU,EAAE,YALP;IAMLC,eAAe,EAAEhB,IAAI,KAAK,OAAT,GAAmBD,KAAK,CAACO,MAAN,CAAaW,QAAhC,GAA2ClB,KAAK,CAACO,MAAN,CAAaY,QANpE;IAOLC,WAAW,EAAEnB,IAAI,KAAK,OAAT,GAAmBD,KAAK,CAACO,MAAN,CAAaW,QAAhC,GAA2ClB,KAAK,CAACO,MAAN,CAAaY,QAPhE;IAQLE,aAAa,EAAE,GARV;IASLC,YAAY,EAAE;MAACC,KAAK,EAAE,CAAR;MAAWlB,MAAM,EAAE;IAAnB,CATT;IAULmB,YAAY,EAAE,EAVT;IAWLC,SAAS,EAAE;EAXN,CANS;EAmBhBC,iBAAiB,EAAE;IACjBX,aAAa,EAAE,KADE;IAEjBC,UAAU,EAAE,QAFK;IAGjBO,KAAK,EAAE;EAHU,CAnBH;EAwBhBI,UAAU,EAAE;IACVJ,KAAK,EAAE,EADG;IAEVlB,MAAM,EAA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AACpC;EAAxB,GAAqC4D,IAAI,CAAClE,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;eAyDegE,qB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-congrats/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-congrats/index.native.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAkEjD,QAAA,MAAM,cAAc,UAAW,mBAAmB,uBA+JjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -13,6 +13,8 @@ var _lottieReactNative = _interopRequireDefault(require("lottie-react-native"));
|
|
|
13
13
|
|
|
14
14
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
15
15
|
|
|
16
|
+
var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
|
|
17
|
+
|
|
16
18
|
var _templateContext = require("../../template/app-review/template-context");
|
|
17
19
|
|
|
18
20
|
var _index = _interopRequireDefault(require("../../atom/button/index.native"));
|
|
@@ -21,10 +23,6 @@ var _shadow = require("../../variables/shadow");
|
|
|
21
23
|
|
|
22
24
|
var _index2 = _interopRequireDefault(require("../../molecule/card-congrats/index.native"));
|
|
23
25
|
|
|
24
|
-
var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
|
|
25
|
-
|
|
26
|
-
var _useUpdateOpacity = _interopRequireDefault(require("../../behaviours/use-update-opacity.native"));
|
|
27
|
-
|
|
28
26
|
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); }
|
|
29
27
|
|
|
30
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -73,6 +71,19 @@ const createStyleSheet = theme => _reactNative.StyleSheet.create({
|
|
|
73
71
|
}
|
|
74
72
|
});
|
|
75
73
|
|
|
74
|
+
const fadeIn = {
|
|
75
|
+
property: 'opacity',
|
|
76
|
+
fromValue: 0,
|
|
77
|
+
toValue: 1,
|
|
78
|
+
duration: 350
|
|
79
|
+
};
|
|
80
|
+
const translateHorizontally = {
|
|
81
|
+
property: 'translateX',
|
|
82
|
+
fromValue: 180,
|
|
83
|
+
toValue: 0,
|
|
84
|
+
duration: 800
|
|
85
|
+
};
|
|
86
|
+
|
|
76
87
|
const ReviewCongrats = props => {
|
|
77
88
|
const {
|
|
78
89
|
'aria-label': ariaLabel,
|
|
@@ -86,76 +97,53 @@ const ReviewCongrats = props => {
|
|
|
86
97
|
const {
|
|
87
98
|
theme
|
|
88
99
|
} = (0, _templateContext.useTemplateContext)();
|
|
89
|
-
const {
|
|
90
|
-
height: windowHeight
|
|
91
|
-
} = (0, _reactNative.useWindowDimensions)();
|
|
92
100
|
const [styleSheet, setStylesheet] = (0, _react.useState)(null);
|
|
93
101
|
const [isCongratsTranslationDone, setCongratsTranslationDone] = (0, _react.useState)(false);
|
|
94
102
|
const [isRankShown, setRankShown] = (0, _react.useState)(false);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
onFinished: () => {
|
|
103
|
+
const scrollViewRef = (0, _react.useRef)(null);
|
|
104
|
+
const showCongrats = (0, _reactNativeAnimation.useAnimateProp)({
|
|
105
|
+
property: 'opacity',
|
|
106
|
+
fromValue: 0,
|
|
107
|
+
toValue: 1,
|
|
108
|
+
duration: 950,
|
|
109
|
+
onComplete: () => {
|
|
103
110
|
setCongratsTranslationDone(true);
|
|
104
111
|
}
|
|
105
112
|
});
|
|
106
|
-
const {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
fromValue: 150,
|
|
111
|
-
duration: 750,
|
|
112
|
-
toValue: 0
|
|
113
|
+
const translateCongrats = (0, _reactNativeAnimation.useTranslateY)({
|
|
114
|
+
fromValue: 100,
|
|
115
|
+
toValue: 0,
|
|
116
|
+
duration: 550
|
|
113
117
|
});
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
onFadeInFinished: () => {
|
|
118
|
+
const showConfettis = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
|
|
119
|
+
const fadeInRank = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
|
|
120
|
+
const translateRank = (0, _reactNativeAnimation.useTranslateX)(_extends({}, translateHorizontally, {
|
|
121
|
+
onComplete: () => {
|
|
119
122
|
setRankShown(true);
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
scrollViewRef?.current?.scrollToEnd();
|
|
125
|
+
}, 700);
|
|
120
126
|
}
|
|
121
|
-
});
|
|
122
|
-
const
|
|
123
|
-
const {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
delay: 250
|
|
137
|
-
});
|
|
127
|
+
}));
|
|
128
|
+
const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];
|
|
129
|
+
const fadeInStars = (0, _reactNativeAnimation.useAnimateProp)(_extends({}, fadeIn, {
|
|
130
|
+
delay: 1000
|
|
131
|
+
}));
|
|
132
|
+
const translateStars = (0, _reactNativeAnimation.useTranslateX)(_extends({}, translateHorizontally, {
|
|
133
|
+
delay: 1000
|
|
134
|
+
}));
|
|
135
|
+
const showButton1 = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
|
|
136
|
+
const showButton2 = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
|
|
137
|
+
const congratsSequence = (0, _reactNativeAnimation.sequence)([(0, _reactNativeAnimation.parallel)([showCongrats, translateCongrats]), (0, _reactNativeAnimation.parallel)([showConfettis, fadeInRank, translateRank]), (0, _reactNativeAnimation.parallel)([fadeInStars, translateStars]), (0, _reactNativeAnimation.sequence)([showButton1, showButton2])]);
|
|
138
|
+
(0, _react.useEffect)(() => {
|
|
139
|
+
congratsSequence.start(); // (required only once on mount)
|
|
140
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
|
+
}, []);
|
|
138
142
|
(0, _react.useEffect)(() => {
|
|
139
143
|
const _stylesheet = createStyleSheet(theme);
|
|
140
144
|
|
|
141
145
|
setStylesheet(_stylesheet);
|
|
142
146
|
}, [theme]);
|
|
143
|
-
(0, _react.useEffect)(() => {
|
|
144
|
-
translateCongratsUp();
|
|
145
|
-
}, []);
|
|
146
|
-
(0, _react.useEffect)(() => {
|
|
147
|
-
if (isCongratsTranslationDone) {
|
|
148
|
-
showRank();
|
|
149
|
-
translateRankUp();
|
|
150
|
-
}
|
|
151
|
-
}, [isCongratsTranslationDone, showRank, translateRankUp]);
|
|
152
|
-
(0, _react.useEffect)(() => {
|
|
153
|
-
if (isRankShown) {
|
|
154
|
-
scrollViewRef?.current?.scrollToEnd();
|
|
155
|
-
translateStarsUp();
|
|
156
|
-
showStars();
|
|
157
|
-
}
|
|
158
|
-
}, [isRankShown, translateStarsUp, showStars]);
|
|
159
147
|
|
|
160
148
|
if (!styleSheet) {
|
|
161
149
|
return null;
|
|
@@ -164,7 +152,7 @@ const ReviewCongrats = props => {
|
|
|
164
152
|
const handleContinueRevisingPress = buttonRevising?.onClick || _noop2.default;
|
|
165
153
|
const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || _noop2.default;
|
|
166
154
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
167
|
-
style: [styleSheet.congrats,
|
|
155
|
+
style: [styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle],
|
|
168
156
|
accessibilityLabel: ariaLabel
|
|
169
157
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
170
158
|
style: styleSheet.title
|
|
@@ -175,7 +163,7 @@ const ReviewCongrats = props => {
|
|
|
175
163
|
style: styleSheet.scrollView,
|
|
176
164
|
contentContainerStyle: styleSheet.scrollViewContent
|
|
177
165
|
}, cardCongratsRank ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
178
|
-
style:
|
|
166
|
+
style: animatedRank
|
|
179
167
|
}, /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
180
168
|
animationUri: cardCongratsRank.animationLottie.animationSrc,
|
|
181
169
|
text: cardCongratsRank.reviewCardTitle,
|
|
@@ -185,7 +173,7 @@ const ReviewCongrats = props => {
|
|
|
185
173
|
textColor: theme.colors.text.primary,
|
|
186
174
|
direction: "row-reverse"
|
|
187
175
|
})) : null, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
188
|
-
style: [
|
|
176
|
+
style: [fadeInStars.animatedStyle, translateStars.animatedStyle]
|
|
189
177
|
}, /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
190
178
|
animationUri: isRankShown ? cardCongratsStar.animationLottie.animationSrc : null,
|
|
191
179
|
Icon: _novaIcons.NovaCompositionCoorpacademyStar,
|
|
@@ -194,9 +182,11 @@ const ReviewCongrats = props => {
|
|
|
194
182
|
iconColor: theme.colors.battle,
|
|
195
183
|
textColor: theme.colors.battle,
|
|
196
184
|
direction: "row"
|
|
197
|
-
}))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
185
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
198
186
|
style: styleSheet.buttons
|
|
199
|
-
}, buttonRevisingSkill ? /*#__PURE__*/_react.default.createElement(
|
|
187
|
+
}, buttonRevisingSkill ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
188
|
+
style: showButton1.animatedStyle
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
200
190
|
onPress: handleReviseAnotherSkillPress,
|
|
201
191
|
accessibilityLabel: buttonRevisingSkill['aria-label'],
|
|
202
192
|
submitValue: buttonRevisingSkill.label,
|
|
@@ -206,13 +196,15 @@ const ReviewCongrats = props => {
|
|
|
206
196
|
textStyle: {
|
|
207
197
|
color: '#123'
|
|
208
198
|
}
|
|
209
|
-
}) : null, buttonRevising ? /*#__PURE__*/_react.default.createElement(
|
|
199
|
+
})) : null, buttonRevising ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
200
|
+
style: showButton2.animatedStyle
|
|
201
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
210
202
|
onPress: handleContinueRevisingPress,
|
|
211
203
|
accessibilityLabel: buttonRevising['aria-label'],
|
|
212
204
|
submitValue: buttonRevising.label
|
|
213
|
-
}) : null), isCongratsTranslationDone ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
205
|
+
})) : null), isCongratsTranslationDone ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
214
206
|
pointerEvents: "none",
|
|
215
|
-
style: styleSheet.confettis
|
|
207
|
+
style: [styleSheet.confettis, showConfettis.animatedStyle]
|
|
216
208
|
}, /*#__PURE__*/_react.default.createElement(_lottieReactNative.default, {
|
|
217
209
|
source: {
|
|
218
210
|
uri: animationLottie.animationSrc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","windowHeight","useWindowDimensions","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","translate","translateCongratsUp","animatedY","animatedCongratsY","useTranslateVertically","fromValue","toValue","delay","onFinished","translateRankUp","animatedRankY","duration","fadeIn","showRank","animatedOpacity","animatedRankOpacity","useUpdateOpacity","onFadeInFinished","scrollViewRef","useRef","translateStarsUp","animatedStarsY","showStars","animatedStarsOpacity","useEffect","_stylesheet","current","scrollToEnd","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {\n Animated,\n ScrollView,\n StyleSheet,\n Text,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport useUpdateOpacity from '../../behaviours/use-update-opacity.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n const {height: windowHeight} = useWindowDimensions();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const {translate: translateCongratsUp, animatedY: animatedCongratsY} = useTranslateVertically({\n fromValue: windowHeight,\n toValue: 0,\n delay: 750,\n onFinished: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const {translate: translateRankUp, animatedY: animatedRankY} = useTranslateVertically({\n fromValue: 150,\n duration: 750,\n toValue: 0\n });\n\n const {fadeIn: showRank, animatedOpacity: animatedRankOpacity} = useUpdateOpacity({\n onFadeInFinished: () => {\n setRankShown(true);\n }\n });\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const {translate: translateStarsUp, animatedY: animatedStarsY} = useTranslateVertically({\n fromValue: 150,\n toValue: 0,\n duration: 750,\n delay: 250\n });\n\n const {fadeIn: showStars, animatedOpacity: animatedStarsOpacity} = useUpdateOpacity({\n delay: 250\n });\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n useEffect(() => {\n translateCongratsUp();\n }, []);\n\n useEffect(() => {\n if (isCongratsTranslationDone) {\n showRank();\n translateRankUp();\n }\n }, [isCongratsTranslationDone, showRank, translateRankUp]);\n\n useEffect(() => {\n if (isRankShown) {\n scrollViewRef?.current?.scrollToEnd();\n translateStarsUp();\n showStars();\n }\n }, [isRankShown, translateStarsUp, showStars]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <Animated.View style={[styleSheet.congrats, animatedCongratsY]} accessibilityLabel={ariaLabel}>\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={[animatedRankOpacity, animatedRankY]}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[animatedStarsOpacity, animatedStarsY]}>\n <CardCongrats\n animationUri={isRankShown ? cardCongratsStar.animationLottie.animationSrc : null}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n ) : null}\n {buttonRevising ? (\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n ) : null}\n </View>\n\n {isCongratsTranslationDone ? (\n <View pointerEvents=\"none\" style={styleSheet.confettis}>\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;AAEA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,aAAa,EAAE,QAJP;IAKRC,UAAU,EAAE,QALJ;IAMRC,eAAe,EAAE,EANT;IAORC,IAAI,EAAE;EAPE,CADM;EAUhBC,OAAO,EAAE;IACPN,KAAK,EAAE,MADA;IAEPO,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,EAAE,QAHR;IAIPM,cAAc,EAAE,eAJT;IAKPH,IAAI,EAAE;EALC,CAVO;EAiBhBI,KAAK,EAAE;IACLC,UAAU,EAAE,KADP;IAELC,QAAQ,EAAE,EAFL;IAGLC,UAAU,EAAE,EAHP;IAILC,cAAc,EAAE,EAJX;IAKLC,KAAK,EAAEnB,KAAK,CAACoB,MAAN,CAAaC,IAAb,CAAkBC;EALpB,CAjBS;EAwBhBC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vB,WAAW,GAAGZ,gBAAgB,CAACD,eAAjB,CAAiC8C,YAApC,GAAmD,IAD9E;IAEE,IAAI,EAAEM,0CAFR;IAGE,IAAI,EAAEnD,gBAAgB,CAAC8C,eAHzB;IAIE,KAAK,EAAE9C,gBAAgB,CAAC+C,eAJ1B;IAKE,SAAS,EAAE/E,KAAK,CAACoB,MAAN,CAAagE,MAL1B;IAME,SAAS,EAAEpF,KAAK,CAACoB,MAAN,CAAagE,MAN1B;IAOE,SAAS,EAAC;EAPZ,EADF,CApBF,CAFF,eAmCE,6BAAC,iBAAD;IAAM,KAAK,EAAE7C,UAAU,CAAC5B;EAAxB,GACGwB,mBAAmB,gBAClB,6BAAC,cAAD;IACE,OAAO,EAAEyC,6BADX;IAEE,kBAAkB,EAAEzC,mBAAmB,CAAC,YAAD,CAFzC;IAGE,WAAW,EAAEA,mBAAmB,CAACkD,KAHnC;IAIE,KAAK,eAAMC,iBAAN;MAAiBC,eAAe,EAAE;IAAlC,EAJP;IAKE,SAAS,EAAE;MAACpE,KAAK,EAAE;IAAR;EALb,EADkB,GAQhB,IATN,EAUGe,cAAc,gBACb,6BAAC,cAAD;IACE,OAAO,EAAEwC,2BADX;IAEE,kBAAkB,EAAExC,cAAc,CAAC,YAAD,CAFpC;IAGE,WAAW,EAAEA,cAAc,CAACmD;EAH9B,EADa,GAMX,IAhBN,CAnCF,EAsDG3C,yBAAyB,gBACxB,6BAAC,iBAAD;IAAM,aAAa,EAAC,MAApB;IAA2B,KAAK,EAAEH,UAAU,CAAChB;EAA7C,gBACE,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAACiE,GAAG,EAAEzD,eAAe,CAAC8C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EADF,CADwB,GAItB,IA1DN,CADF;AA8DD,CAjJD;;eAmJejD,c"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","fadeIn","property","fromValue","toValue","duration","translateHorizontally","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","useRef","showCongrats","useAnimateProp","onComplete","translateCongrats","useTranslateY","showConfettis","fadeInRank","translateRank","useTranslateX","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","sequence","parallel","useEffect","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, ScrollView, StyleSheet, Text, TextStyle, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport {\n sequence,\n parallel,\n useAnimateProp,\n useTranslateY,\n useTranslateX\n} from '@coorpacademy/react-native-animation';\nimport type {AnimatePropParams} from '@coorpacademy/react-native-animation/es/use-animate-prop';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst fadeIn: AnimatePropParams = {\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 350\n};\n\nconst translateHorizontally = {\n property: 'translateX',\n fromValue: 180,\n toValue: 0,\n duration: 800\n};\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const showCongrats = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 950,\n onComplete: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const translateCongrats = useTranslateY({\n fromValue: 100,\n toValue: 0,\n duration: 550\n });\n\n const showConfettis = useAnimateProp(fadeIn);\n const fadeInRank = useAnimateProp(fadeIn);\n const translateRank = useTranslateX({\n ...translateHorizontally,\n onComplete: () => {\n setRankShown(true);\n setTimeout(() => {\n scrollViewRef?.current?.scrollToEnd();\n }, 700);\n }\n });\n\n const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];\n\n const fadeInStars = useAnimateProp({\n ...fadeIn,\n delay: 1000\n });\n\n const translateStars = useTranslateX({\n ...translateHorizontally,\n delay: 1000\n });\n\n const showButton1 = useAnimateProp(fadeIn);\n const showButton2 = useAnimateProp(fadeIn);\n\n const congratsSequence = sequence([\n parallel([showCongrats, translateCongrats]),\n parallel([showConfettis, fadeInRank, translateRank]),\n parallel([fadeInStars, translateStars]),\n sequence([showButton1, showButton2])\n ]);\n\n useEffect(() => {\n congratsSequence.start();\n // (required only once on mount)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <Animated.View\n style={[styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle]}\n accessibilityLabel={ariaLabel}\n >\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={animatedRank}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[fadeInStars.animatedStyle, translateStars.animatedStyle]}>\n <CardCongrats\n animationUri={isRankShown ? cardCongratsStar.animationLottie.animationSrc : null}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <Animated.View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Animated.View style={showButton1.animatedStyle}>\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n </Animated.View>\n ) : null}\n {buttonRevising ? (\n <Animated.View style={showButton2.animatedStyle}>\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n </Animated.View>\n ) : null}\n </Animated.View>\n\n {isCongratsTranslationDone ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[styleSheet.confettis, showConfettis.animatedStyle]}\n >\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </Animated.View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AASA;;AAEA;;AACA;;AACA;;;;;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,aAAa,EAAE,QAJP;IAKRC,UAAU,EAAE,QALJ;IAMRC,eAAe,EAAE,EANT;IAORC,IAAI,EAAE;EAPE,CADM;EAUhBC,OAAO,EAAE;IACPN,KAAK,EAAE,MADA;IAEPO,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,EAAE,QAHR;IAIPM,cAAc,EAAE,eAJT;IAKPH,IAAI,EAAE;EALC,CAVO;EAiBhBI,KAAK,EAAE;I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AE;IAAlC,EAJP;IAKE,SAAS,EAAE;MAACvE,KAAK,EAAE;IAAR;EALb,EADF,CADkB,GAUhB,IAXN,EAYGqB,cAAc,gBACb,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE8B,WAAW,CAACL;EAAlC,gBACE,6BAAC,cAAD;IACE,OAAO,EAAEY,2BADX;IAEE,kBAAkB,EAAErC,cAAc,CAAC,YAAD,CAFpC;IAGE,WAAW,EAAEA,cAAc,CAACgD;EAH9B,EADF,CADa,GAQX,IApBN,CAtCF,EA6DG1C,yBAAyB,gBACxB,6BAAC,qBAAD,CAAU,IAAV;IACE,aAAa,EAAC,MADhB;IAEE,KAAK,EAAE,CAACH,UAAU,CAACpB,SAAZ,EAAuBkC,aAAa,CAACQ,aAArC;EAFT,gBAIE,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAAC0B,GAAG,EAAEtD,eAAe,CAAC2C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EAJF,CADwB,GAOtB,IApEN,CADF;AAwED,CA/JD;;eAiKe9C,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA+JtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|