@coorpacademy/components 11.0.0 → 11.0.2-alpha.3

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.
Files changed (87) hide show
  1. package/es/atom/picture/index.js +5 -8
  2. package/es/atom/picture/index.js.map +1 -1
  3. package/es/molecule/card-congrats/index.native.d.ts.map +1 -1
  4. package/es/molecule/card-congrats/index.native.js.map +1 -1
  5. package/es/molecule/discipline-partners/index.js +2 -1
  6. package/es/molecule/discipline-partners/index.js.map +1 -1
  7. package/es/molecule/discipline-scope/index.d.ts +1 -0
  8. package/es/molecule/forum/forum-comment/index.d.ts +1 -0
  9. package/es/molecule/forum/forum-comment/index.d.ts.map +1 -1
  10. package/es/molecule/forum/forum-comment/index.js +5 -2
  11. package/es/molecule/forum/forum-comment/index.js.map +1 -1
  12. package/es/molecule/forum/forum-post/index.d.ts +2 -0
  13. package/es/molecule/forum/forum-post/index.d.ts.map +1 -1
  14. package/es/molecule/forum/forum-post/index.js +8 -1
  15. package/es/molecule/forum/forum-post/index.js.map +1 -1
  16. package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  17. package/es/molecule/review-correction-popin/index.native.js +8 -9
  18. package/es/molecule/review-correction-popin/index.native.js.map +1 -1
  19. package/es/molecule/scope-content/index.d.ts +1 -0
  20. package/es/organism/discussion/index.d.ts +1 -0
  21. package/es/organism/discussion/index.d.ts.map +1 -1
  22. package/es/organism/discussion/index.js +4 -1
  23. package/es/organism/discussion/index.js.map +1 -1
  24. package/es/organism/review-congrats/index.native.d.ts.map +1 -1
  25. package/es/organism/review-congrats/index.native.js +60 -67
  26. package/es/organism/review-congrats/index.native.js.map +1 -1
  27. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  28. package/es/organism/review-slide/index.native.js +4 -3
  29. package/es/organism/review-slide/index.native.js.map +1 -1
  30. package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  31. package/es/organism/review-stacked-slides/index.native.js +4 -7
  32. package/es/organism/review-stacked-slides/index.native.js.map +1 -1
  33. package/es/template/app-player/popin-end/index.d.ts +1 -0
  34. package/es/template/app-player/popin-end/summary.d.ts +1 -0
  35. package/es/template/common/discipline/index.d.ts +1 -0
  36. package/lib/atom/picture/index.js +5 -8
  37. package/lib/atom/picture/index.js.map +1 -1
  38. package/lib/molecule/card-congrats/index.native.d.ts.map +1 -1
  39. package/lib/molecule/card-congrats/index.native.js.map +1 -1
  40. package/lib/molecule/discipline-partners/index.js +2 -1
  41. package/lib/molecule/discipline-partners/index.js.map +1 -1
  42. package/lib/molecule/discipline-scope/index.d.ts +1 -0
  43. package/lib/molecule/forum/forum-comment/index.d.ts +1 -0
  44. package/lib/molecule/forum/forum-comment/index.d.ts.map +1 -1
  45. package/lib/molecule/forum/forum-comment/index.js +5 -2
  46. package/lib/molecule/forum/forum-comment/index.js.map +1 -1
  47. package/lib/molecule/forum/forum-post/index.d.ts +2 -0
  48. package/lib/molecule/forum/forum-post/index.d.ts.map +1 -1
  49. package/lib/molecule/forum/forum-post/index.js +8 -1
  50. package/lib/molecule/forum/forum-post/index.js.map +1 -1
  51. package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  52. package/lib/molecule/review-correction-popin/index.native.js +9 -10
  53. package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
  54. package/lib/molecule/scope-content/index.d.ts +1 -0
  55. package/lib/organism/discussion/index.d.ts +1 -0
  56. package/lib/organism/discussion/index.d.ts.map +1 -1
  57. package/lib/organism/discussion/index.js +4 -1
  58. package/lib/organism/discussion/index.js.map +1 -1
  59. package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
  60. package/lib/organism/review-congrats/index.native.js +60 -68
  61. package/lib/organism/review-congrats/index.native.js.map +1 -1
  62. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  63. package/lib/organism/review-slide/index.native.js +5 -4
  64. package/lib/organism/review-slide/index.native.js.map +1 -1
  65. package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  66. package/lib/organism/review-stacked-slides/index.native.js +5 -8
  67. package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
  68. package/lib/template/app-player/popin-end/index.d.ts +1 -0
  69. package/lib/template/app-player/popin-end/summary.d.ts +1 -0
  70. package/lib/template/common/discipline/index.d.ts +1 -0
  71. package/package.json +3 -2
  72. package/es/behaviours/use-translate-vertically.native.d.ts +0 -16
  73. package/es/behaviours/use-translate-vertically.native.d.ts.map +0 -1
  74. package/es/behaviours/use-translate-vertically.native.js +0 -44
  75. package/es/behaviours/use-translate-vertically.native.js.map +0 -1
  76. package/es/behaviours/use-update-opacity.native.d.ts +0 -14
  77. package/es/behaviours/use-update-opacity.native.d.ts.map +0 -1
  78. package/es/behaviours/use-update-opacity.native.js +0 -55
  79. package/es/behaviours/use-update-opacity.native.js.map +0 -1
  80. package/lib/behaviours/use-translate-vertically.native.d.ts +0 -16
  81. package/lib/behaviours/use-translate-vertically.native.d.ts.map +0 -1
  82. package/lib/behaviours/use-translate-vertically.native.js +0 -51
  83. package/lib/behaviours/use-translate-vertically.native.js.map +0 -1
  84. package/lib/behaviours/use-update-opacity.native.d.ts +0 -14
  85. package/lib/behaviours/use-update-opacity.native.d.ts.map +0 -1
  86. package/lib/behaviours/use-update-opacity.native.js +0 -62
  87. package/lib/behaviours/use-update-opacity.native.js.map +0 -1
@@ -3,15 +3,14 @@ import _noop from "lodash/fp/noop";
3
3
  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); }
4
4
 
5
5
  import React, { useEffect, useRef, useState } from 'react';
6
- import { Animated, ScrollView, StyleSheet, Text, useWindowDimensions, View } from 'react-native';
6
+ import { Animated, ScrollView, StyleSheet, Text } from 'react-native';
7
7
  import LottieView from 'lottie-react-native';
8
8
  import { NovaCompositionCoorpacademyStar as StarIcon, NovaSolidVoteRewardsRewardsBadge5 as RankIcon } from '@coorpacademy/nova-icons';
9
+ import { sequence, parallel, useAnimateProp, useTranslateY, useTranslateX } from '@coorpacademy/react-native-animation';
9
10
  import { useTemplateContext } from '../../template/app-review/template-context';
10
11
  import Button from '../../atom/button/index.native';
11
12
  import { BOX_STYLE } from '../../variables/shadow';
12
13
  import CardCongrats from '../../molecule/card-congrats/index.native';
13
- import useTranslateVertically from '../../behaviours/use-translate-vertically.native';
14
- import useUpdateOpacity from '../../behaviours/use-update-opacity.native';
15
14
 
16
15
  const createStyleSheet = theme => StyleSheet.create({
17
16
  congrats: {
@@ -53,6 +52,19 @@ const createStyleSheet = theme => StyleSheet.create({
53
52
  }
54
53
  });
55
54
 
55
+ const fadeIn = {
56
+ property: 'opacity',
57
+ fromValue: 0,
58
+ toValue: 1,
59
+ duration: 350
60
+ };
61
+ const translateHorizontally = {
62
+ property: 'translateX',
63
+ fromValue: 180,
64
+ toValue: 0,
65
+ duration: 800
66
+ };
67
+
56
68
  const ReviewCongrats = props => {
57
69
  const {
58
70
  'aria-label': ariaLabel,
@@ -66,76 +78,53 @@ const ReviewCongrats = props => {
66
78
  const {
67
79
  theme
68
80
  } = useTemplateContext();
69
- const {
70
- height: windowHeight
71
- } = useWindowDimensions();
72
81
  const [styleSheet, setStylesheet] = useState(null);
73
82
  const [isCongratsTranslationDone, setCongratsTranslationDone] = useState(false);
74
83
  const [isRankShown, setRankShown] = useState(false);
75
- const {
76
- translate: translateCongratsUp,
77
- animatedY: animatedCongratsY
78
- } = useTranslateVertically({
79
- fromValue: windowHeight,
80
- toValue: 0,
81
- delay: 750,
82
- onFinished: () => {
84
+ const scrollViewRef = useRef(null);
85
+ const showCongrats = useAnimateProp({
86
+ property: 'opacity',
87
+ fromValue: 0,
88
+ toValue: 1,
89
+ duration: 950,
90
+ onComplete: () => {
83
91
  setCongratsTranslationDone(true);
84
92
  }
85
93
  });
86
- const {
87
- translate: translateRankUp,
88
- animatedY: animatedRankY
89
- } = useTranslateVertically({
90
- fromValue: 150,
91
- duration: 750,
92
- toValue: 0
94
+ const translateCongrats = useTranslateY({
95
+ fromValue: 100,
96
+ toValue: 0,
97
+ duration: 550
93
98
  });
94
- const {
95
- fadeIn: showRank,
96
- animatedOpacity: animatedRankOpacity
97
- } = useUpdateOpacity({
98
- onFadeInFinished: () => {
99
+ const showConfettis = useAnimateProp(fadeIn);
100
+ const fadeInRank = useAnimateProp(fadeIn);
101
+ const translateRank = useTranslateX(_extends({}, translateHorizontally, {
102
+ onComplete: () => {
99
103
  setRankShown(true);
104
+ setTimeout(() => {
105
+ scrollViewRef?.current?.scrollToEnd();
106
+ }, 700);
100
107
  }
101
- });
102
- const scrollViewRef = useRef(null);
103
- const {
104
- translate: translateStarsUp,
105
- animatedY: animatedStarsY
106
- } = useTranslateVertically({
107
- fromValue: 150,
108
- toValue: 0,
109
- duration: 750,
110
- delay: 250
111
- });
112
- const {
113
- fadeIn: showStars,
114
- animatedOpacity: animatedStarsOpacity
115
- } = useUpdateOpacity({
116
- delay: 250
117
- });
108
+ }));
109
+ const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];
110
+ const fadeInStars = useAnimateProp(_extends({}, fadeIn, {
111
+ delay: 1000
112
+ }));
113
+ const translateStars = useTranslateX(_extends({}, translateHorizontally, {
114
+ delay: 1000
115
+ }));
116
+ const showButton1 = useAnimateProp(fadeIn);
117
+ const showButton2 = useAnimateProp(fadeIn);
118
+ const congratsSequence = sequence([parallel([showCongrats, translateCongrats]), parallel([showConfettis, fadeInRank, translateRank]), parallel([fadeInStars, translateStars]), sequence([showButton1, showButton2])]);
119
+ useEffect(() => {
120
+ congratsSequence.start(); // (required only once on mount)
121
+ // eslint-disable-next-line react-hooks/exhaustive-deps
122
+ }, []);
118
123
  useEffect(() => {
119
124
  const _stylesheet = createStyleSheet(theme);
120
125
 
121
126
  setStylesheet(_stylesheet);
122
127
  }, [theme]);
123
- useEffect(() => {
124
- translateCongratsUp();
125
- }, []);
126
- useEffect(() => {
127
- if (isCongratsTranslationDone) {
128
- showRank();
129
- translateRankUp();
130
- }
131
- }, [isCongratsTranslationDone, showRank, translateRankUp]);
132
- useEffect(() => {
133
- if (isRankShown) {
134
- scrollViewRef?.current?.scrollToEnd();
135
- translateStarsUp();
136
- showStars();
137
- }
138
- }, [isRankShown, translateStarsUp, showStars]);
139
128
 
140
129
  if (!styleSheet) {
141
130
  return null;
@@ -144,7 +133,7 @@ const ReviewCongrats = props => {
144
133
  const handleContinueRevisingPress = buttonRevising?.onClick || _noop;
145
134
  const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || _noop;
146
135
  return /*#__PURE__*/React.createElement(Animated.View, {
147
- style: [styleSheet.congrats, animatedCongratsY],
136
+ style: [styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle],
148
137
  accessibilityLabel: ariaLabel
149
138
  }, /*#__PURE__*/React.createElement(Text, {
150
139
  style: styleSheet.title
@@ -155,7 +144,7 @@ const ReviewCongrats = props => {
155
144
  style: styleSheet.scrollView,
156
145
  contentContainerStyle: styleSheet.scrollViewContent
157
146
  }, cardCongratsRank ? /*#__PURE__*/React.createElement(Animated.View, {
158
- style: [animatedRankOpacity, animatedRankY]
147
+ style: animatedRank
159
148
  }, /*#__PURE__*/React.createElement(CardCongrats, {
160
149
  animationUri: cardCongratsRank.animationLottie.animationSrc,
161
150
  text: cardCongratsRank.reviewCardTitle,
@@ -165,7 +154,7 @@ const ReviewCongrats = props => {
165
154
  textColor: theme.colors.text.primary,
166
155
  direction: "row-reverse"
167
156
  })) : null, /*#__PURE__*/React.createElement(Animated.View, {
168
- style: [animatedStarsOpacity, animatedStarsY]
157
+ style: [fadeInStars.animatedStyle, translateStars.animatedStyle]
169
158
  }, /*#__PURE__*/React.createElement(CardCongrats, {
170
159
  animationUri: isRankShown ? cardCongratsStar.animationLottie.animationSrc : null,
171
160
  Icon: StarIcon,
@@ -174,9 +163,11 @@ const ReviewCongrats = props => {
174
163
  iconColor: theme.colors.battle,
175
164
  textColor: theme.colors.battle,
176
165
  direction: "row"
177
- }))), /*#__PURE__*/React.createElement(View, {
166
+ }))), /*#__PURE__*/React.createElement(Animated.View, {
178
167
  style: styleSheet.buttons
179
- }, buttonRevisingSkill ? /*#__PURE__*/React.createElement(Button, {
168
+ }, buttonRevisingSkill ? /*#__PURE__*/React.createElement(Animated.View, {
169
+ style: showButton1.animatedStyle
170
+ }, /*#__PURE__*/React.createElement(Button, {
180
171
  onPress: handleReviseAnotherSkillPress,
181
172
  accessibilityLabel: buttonRevisingSkill['aria-label'],
182
173
  submitValue: buttonRevisingSkill.label,
@@ -186,13 +177,15 @@ const ReviewCongrats = props => {
186
177
  textStyle: {
187
178
  color: '#123'
188
179
  }
189
- }) : null, buttonRevising ? /*#__PURE__*/React.createElement(Button, {
180
+ })) : null, buttonRevising ? /*#__PURE__*/React.createElement(Animated.View, {
181
+ style: showButton2.animatedStyle
182
+ }, /*#__PURE__*/React.createElement(Button, {
190
183
  onPress: handleContinueRevisingPress,
191
184
  accessibilityLabel: buttonRevising['aria-label'],
192
185
  submitValue: buttonRevising.label
193
- }) : null), isCongratsTranslationDone ? /*#__PURE__*/React.createElement(View, {
186
+ })) : null), isCongratsTranslationDone ? /*#__PURE__*/React.createElement(Animated.View, {
194
187
  pointerEvents: "none",
195
- style: styleSheet.confettis
188
+ style: [styleSheet.confettis, showConfettis.animatedStyle]
196
189
  }, /*#__PURE__*/React.createElement(LottieView, {
197
190
  source: {
198
191
  uri: animationLottie.animationSrc
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["React","useEffect","useRef","useState","Animated","ScrollView","StyleSheet","Text","useWindowDimensions","View","LottieView","NovaCompositionCoorpacademyStar","StarIcon","NovaSolidVoteRewardsRewardsBadge5","RankIcon","useTemplateContext","Button","BOX_STYLE","CardCongrats","useTranslateVertically","useUpdateOpacity","createStyleSheet","theme","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","windowHeight","styleSheet","setStylesheet","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","translate","translateCongratsUp","animatedY","animatedCongratsY","fromValue","toValue","delay","onFinished","translateRankUp","animatedRankY","duration","fadeIn","showRank","animatedOpacity","animatedRankOpacity","onFadeInFinished","scrollViewRef","translateStarsUp","animatedStarsY","showStars","animatedStarsOpacity","_stylesheet","current","scrollToEnd","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","positive","battle","label","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,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,QAAiD,OAAjD;AACA,SACEC,QADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,IAJF,EAMEC,mBANF,EAOEC,IAPF,QASO,cATP;AAUA,OAAOC,UAAP,MAAuB,qBAAvB;AAEA,SACEC,+BAA+B,IAAIC,QADrC,EAEEC,iCAAiC,IAAIC,QAFvC,QAGO,0BAHP;AAKA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,SAAQC,SAAR,QAAwB,wBAAxB;AACA,OAAOC,YAAP,MAAyB,2CAAzB;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AACA,OAAOC,gBAAP,MAA6B,4CAA7B;;AAYA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBhB,UAAU,CAACiB,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,UA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JD;;AAmJA,eAAe1C,cAAf"}
1
+ {"version":3,"file":"index.native.js","names":["React","useEffect","useRef","useState","Animated","ScrollView","StyleSheet","Text","LottieView","NovaCompositionCoorpacademyStar","StarIcon","NovaSolidVoteRewardsRewardsBadge5","RankIcon","sequence","parallel","useAnimateProp","useTranslateY","useTranslateX","useTemplateContext","Button","BOX_STYLE","CardCongrats","createStyleSheet","theme","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","styleSheet","setStylesheet","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","showCongrats","onComplete","translateCongrats","showConfettis","fadeInRank","translateRank","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","positive","battle","label","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,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,QAAiD,OAAjD;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,UAA9B,EAA0CC,IAA1C,QAA2E,cAA3E;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AAEA,SACEC,+BAA+B,IAAIC,QADrC,EAEEC,iCAAiC,IAAIC,QAFvC,QAGO,0BAHP;AAIA,SACEC,QADF,EAEEC,QAFF,EAGEC,cAHF,EAIEC,aAJF,E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ourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA6JtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,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"}
@@ -2,12 +2,12 @@ import React, { useEffect, useState } from 'react';
2
2
  import { Animated, Easing, StyleSheet, useWindowDimensions, View } from 'react-native';
3
3
  import get from 'lodash/fp/get';
4
4
  import getOr from 'lodash/fp/getOr';
5
+ import { useTranslateY } from '@coorpacademy/react-native-animation';
5
6
  import Text from '../../atom/text/index.native';
6
7
  import Answer from '../../molecule/answer/index.native';
7
8
  import ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';
8
9
  import { useTemplateContext } from '../../template/app-review/template-context';
9
10
  import Button from '../../atom/button/index.native';
10
- import useTranslateVertically from '../../behaviours/use-translate-vertically.native';
11
11
  const styles = StyleSheet.create({
12
12
  correctionPopinWrapper: {
13
13
  position: 'absolute',
@@ -22,12 +22,13 @@ const CorrectionPopin = ({
22
22
  showCorrectionPopin,
23
23
  animateCorrectionPopin
24
24
  }) => {
25
- const translateUp = useTranslateVertically({
25
+ const translateUp = useTranslateY({
26
26
  fromValue: 1000,
27
27
  toValue: 0,
28
28
  duration: 800,
29
29
  easing: Easing.bezier(0.37, 0, 0.63, 1)
30
30
  });
31
+ useEffect(() => translateUp.start(), []);
31
32
  if (!showCorrectionPopin) return null;
32
33
  const klf = getOr(undefined, 'klf', correctionPopinProps);
33
34
  const information = getOr({
@@ -48,7 +49,7 @@ const CorrectionPopin = ({
48
49
  type: correctionPopinProps.type,
49
50
  resultLabel: correctionPopinProps.resultLabel
50
51
  };
51
- const style = animateCorrectionPopin ? [styles.correctionPopinWrapper, translateUp.animatedY] : styles.correctionPopinWrapper;
52
+ const style = animateCorrectionPopin ? [styles.correctionPopinWrapper, translateUp.animatedStyle] : styles.correctionPopinWrapper;
52
53
  return /*#__PURE__*/React.createElement(Animated.View, {
53
54
  style: style
54
55
  }, /*#__PURE__*/React.createElement(ReviewCorrectionPopin, _correctionPopinProps));
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","useTranslateVertically","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","style","animatedY","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateVertically({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedY]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,UAHF,EAKEC,mBALF,EAMEC,IANF,QAQO,cARP;AASA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AAGA,MAAMC,MAAM,GAAGX,UAAU,CAACY,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAGZ,sBAAsB,CAAC;IACzCa,SAAS,EAAE,IAD8B;IAEzCC,OAAO,EAAE,CAFgC;IAGzCC,QAAQ,EAAE,GAH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","useState","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\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,IAAUf,mBAAmB,EAAnC;EACA,MAAMuF,UAAU,GAAGlB,gBAAgB,CAACC,GAAD,EAAMvD,KAAN,CAAnC;EAEA,MAAM;IACJyE,OADI;IAEJC,kBAFI;IAGJhC,YAHI;IAIJS,QAJI;IAKJ/C,mBALI;IAMJC;EANI,IAOFqD,KAPJ;;EASA,IAAIe,OAAJ,EAAa;IACX,oBAAO,oBAAC,IAAD,yBAAoBlB,GAApB,CAAP;EACD;;EAED,MAAM;IAACpC,OAAO,EAAEwD;EAAV,IAAiCJ,cAAvC;EAEA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEC,UAAU,CAACd;EAAxB,gBACE,oBAAC,QAAD;IACE,cAAc,EAAEgB,kBADlB;IAEE,YAAY,EAAEhC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,oBAAC,MAAD;IACE,QAAQ,EAAEoB,cAAc,CAACK,QAD3B;IAEE,WAAW,EAAEL,cAAc,CAACvD,KAF9B;IAGE,OAAO,EAAE2D,mBAHX;IAIE,MAAM,EAAG,yBAAwBxE,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;AAgDA,eAAeiE,KAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAUpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA+B7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAUpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBAiC7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -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(translate, [translate]);
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, animatedY]
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","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"}
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"}
@@ -65,6 +65,7 @@ declare namespace PopinEnd {
65
65
  avatar: PropTypes.Requireable<any>;
66
66
  loading: PropTypes.Requireable<boolean>;
67
67
  value: PropTypes.Requireable<string>;
68
+ profileAvatarAlt: PropTypes.Requireable<string>;
68
69
  title: PropTypes.Requireable<string>;
69
70
  onPost: PropTypes.Requireable<(...args: any[]) => any>;
70
71
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -71,6 +71,7 @@ declare namespace Summary {
71
71
  avatar: PropTypes.Requireable<any>;
72
72
  loading: PropTypes.Requireable<boolean>;
73
73
  value: PropTypes.Requireable<string>;
74
+ profileAvatarAlt: PropTypes.Requireable<string>;
74
75
  title: PropTypes.Requireable<string>;
75
76
  onPost: PropTypes.Requireable<(...args: any[]) => any>;
76
77
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -78,6 +78,7 @@ declare namespace Discipline {
78
78
  avatar: PropTypes.Requireable<any>;
79
79
  loading: PropTypes.Requireable<boolean>;
80
80
  value: PropTypes.Requireable<string>;
81
+ profileAvatarAlt: PropTypes.Requireable<string>;
81
82
  title: PropTypes.Requireable<string>;
82
83
  onPost: PropTypes.Requireable<(...args: any[]) => any>;
83
84
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -33,16 +33,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
33
33
 
34
34
  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); }
35
35
 
36
- const toSrcSet = ({
37
- src
38
- }) => {
36
+ const toSrcSet = src => {
39
37
  if (!(0, _isObject2.default)(src)) return {};
40
38
  return (0, _pipe2.default)((0, _set2.default)('srcSet', (0, _pipe2.default)(_toPairs2.default, (0, _filter2.default)(([key, url]) => url), (0, _map2.default)(([key, url]) => `${url} ${key}`), (0, _join2.default)(','))(src)), (0, _set2.default)('src', (0, _get2.default)('1x', src)))({});
41
39
  };
42
40
 
43
- const toSetAlt = ({
44
- alt
45
- }) => {
41
+ const toSetAlt = alt => {
46
42
  return alt ? {
47
43
  alt
48
44
  } : {
@@ -53,7 +49,8 @@ const toSetAlt = ({
53
49
 
54
50
  const Picture = props => {
55
51
  const {
56
- src
52
+ src,
53
+ alt
57
54
  } = props;
58
55
 
59
56
  if ((0, _isNil2.default)(src)) {
@@ -62,7 +59,7 @@ const Picture = props => {
62
59
  });
63
60
  }
64
61
 
65
- return /*#__PURE__*/_react.default.createElement("img", _extends({}, props, toSrcSet(props), toSetAlt(props)));
62
+ return /*#__PURE__*/_react.default.createElement("img", _extends({}, props, toSrcSet(src), toSetAlt(alt)));
66
63
  };
67
64
 
68
65
  Picture.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["toSrcSet","src","key","url","toSetAlt","alt","Picture","props","style","empty","propTypes","PropTypes","oneOfType","SrcPropType","objectOf","string"],"sources":["../../../src/atom/picture/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {filter, get, isNil, isObject, join, map, pipe, set, toPairs} from 'lodash/fp';\nimport {SrcPropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst toSrcSet = ({src}) => {\n if (!isObject(src)) return {};\n return pipe(\n set(\n 'srcSet',\n pipe(\n toPairs,\n filter(([key, url]) => url),\n map(([key, url]) => `${url} ${key}`),\n join(',')\n )(src)\n ),\n set('src', get('1x', src))\n )({});\n};\n\nconst toSetAlt = ({alt}) => {\n return alt ? {alt} : {alt: '', 'aria-hidden': true};\n};\n\nconst Picture = props => {\n const {src} = props;\n if (isNil(src)) {\n return <div className={style.empty} />;\n }\n return <img {...props} {...toSrcSet(props)} {...toSetAlt(props)} />;\n};\n\nPicture.propTypes = {\n src: PropTypes.oneOfType([SrcPropType, PropTypes.objectOf(SrcPropType)]),\n alt: PropTypes.string\n};\n\nexport default Picture;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAAC;EAACC;AAAD,CAAD,KAAW;EAC1B,IAAI,CAAC,wBAASA,GAAT,CAAL,EAAoB,OAAO,EAAP;EACpB,OAAO,oBACL,mBACE,QADF,EAEE,uCAEE,sBAAO,CAAC,CAACC,GAAD,EAAMC,GAAN,CAAD,KAAgBA,GAAvB,CAFF,EAGE,mBAAI,CAAC,CAACD,GAAD,EAAMC,GAAN,CAAD,KAAiB,GAAEA,GAAI,IAAGD,GAAI,EAAlC,CAHF,EAIE,oBAAK,GAAL,CAJF,EAKED,GALF,CAFF,CADK,EAUL,mBAAI,KAAJ,EAAW,mBAAI,IAAJ,EAAUA,GAAV,CAAX,CAVK,EAWL,EAXK,CAAP;AAYD,CAdD;;AAgBA,MAAMG,QAAQ,GAAG,CAAC;EAACC;AAAD,CAAD,KAAW;EAC1B,OAAOA,GAAG,GAAG;IAACA;EAAD,CAAH,GAAW;IAACA,GAAG,EAAE,EAAN;IAAU,eAAe;EAAzB,CAArB;AACD,CAFD;;AAIA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IAACN;EAAD,IAAQM,KAAd;;EACA,IAAI,qBAAMN,GAAN,CAAJ,EAAgB;IACd,oBAAO;MAAK,SAAS,EAAEO,cAAA,CAAMC;IAAtB,EAAP;EACD;;EACD,oBAAO,iDAASF,KAAT,EAAoBP,QAAQ,CAACO,KAAD,CAA5B,EAAyCH,QAAQ,CAACG,KAAD,CAAjD,EAAP;AACD,CAND;;AAQAD,OAAO,CAACI,SAAR,2CAAoB;EAClBT,GAAG,EAAEU,kBAAA,CAAUC,SAAV,CAAoB,CAACC,sBAAD,EAAcF,kBAAA,CAAUG,QAAV,CAAmBD,sBAAnB,CAAd,CAApB,CADa;EAElBR,GAAG,EAAEM,kBAAA,CAAUI;AAFG,CAApB;eAKeT,O"}
1
+ {"version":3,"file":"index.js","names":["toSrcSet","src","key","url","toSetAlt","alt","Picture","props","style","empty","propTypes","PropTypes","oneOfType","SrcPropType","objectOf","string"],"sources":["../../../src/atom/picture/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {filter, get, isNil, isObject, join, map, pipe, set, toPairs} from 'lodash/fp';\nimport {SrcPropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst toSrcSet = src => {\n if (!isObject(src)) return {};\n return pipe(\n set(\n 'srcSet',\n pipe(\n toPairs,\n filter(([key, url]) => url),\n map(([key, url]) => `${url} ${key}`),\n join(',')\n )(src)\n ),\n set('src', get('1x', src))\n )({});\n};\n\nconst toSetAlt = alt => {\n return alt ? {alt} : {alt: '', 'aria-hidden': true};\n};\n\nconst Picture = props => {\n const {src, alt} = props;\n if (isNil(src)) {\n return <div className={style.empty} />;\n }\n return <img {...props} {...toSrcSet(src)} {...toSetAlt(alt)} />;\n};\n\nPicture.propTypes = {\n src: PropTypes.oneOfType([SrcPropType, PropTypes.objectOf(SrcPropType)]),\n alt: PropTypes.string\n};\n\nexport default Picture;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAGC,GAAG,IAAI;EACtB,IAAI,CAAC,wBAASA,GAAT,CAAL,EAAoB,OAAO,EAAP;EACpB,OAAO,oBACL,mBACE,QADF,EAEE,uCAEE,sBAAO,CAAC,CAACC,GAAD,EAAMC,GAAN,CAAD,KAAgBA,GAAvB,CAFF,EAGE,mBAAI,CAAC,CAACD,GAAD,EAAMC,GAAN,CAAD,KAAiB,GAAEA,GAAI,IAAGD,GAAI,EAAlC,CAHF,EAIE,oBAAK,GAAL,CAJF,EAKED,GALF,CAFF,CADK,EAUL,mBAAI,KAAJ,EAAW,mBAAI,IAAJ,EAAUA,GAAV,CAAX,CAVK,EAWL,EAXK,CAAP;AAYD,CAdD;;AAgBA,MAAMG,QAAQ,GAAGC,GAAG,IAAI;EACtB,OAAOA,GAAG,GAAG;IAACA;EAAD,CAAH,GAAW;IAACA,GAAG,EAAE,EAAN;IAAU,eAAe;EAAzB,CAArB;AACD,CAFD;;AAIA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IAACN,GAAD;IAAMI;EAAN,IAAaE,KAAnB;;EACA,IAAI,qBAAMN,GAAN,CAAJ,EAAgB;IACd,oBAAO;MAAK,SAAS,EAAEO,cAAA,CAAMC;IAAtB,EAAP;EACD;;EACD,oBAAO,iDAASF,KAAT,EAAoBP,QAAQ,CAACC,GAAD,CAA5B,EAAuCG,QAAQ,CAACC,GAAD,CAA/C,EAAP;AACD,CAND;;AAQAC,OAAO,CAACI,SAAR,2CAAoB;EAClBT,GAAG,EAAEU,kBAAA,CAAUC,SAAV,CAAoB,CAACC,sBAAD,EAAcF,kBAAA,CAAUG,QAAV,CAAmBD,sBAAnB,CAAd,CAApB,CADa;EAElBR,GAAG,EAAEM,kBAAA,CAAUI;AAFG,CAApB;eAKeT,O"}
@@ -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,uBA0BnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
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\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;I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CAAb;EACD,CAHD,EAGG,CAACzC,KAAD,CAHH;;EAKA,IAAI,CAACqC,UAAL,EAAiB;IACf,OAAO,IAAP;EACD;;EAED,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEA,UAAU,CAAC9B;EAAxB,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAE8B,UAAU,CAAClC;EAAxB,GACG2B,YAAY,gBAAG,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAACY,GAAG,EAAEZ;IAAN,CAApB;IAAyC,QAAQ,MAAjD;IAAkD,IAAI,EAAE;EAAxD,EAAH,GAAuE,IADtF,CADF,eAIE,6BAAC,iBAAD;IAAM,KAAK,EAAEO,UAAU,CAACpB;EAAxB,GAAoCK,IAApC,CAJF,eAKE,6BAAC,iBAAD;IAAM,KAAK,EAAE,CAACe,UAAU,CAACb,MAAZ,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,CAlCD;;eAoCeJ,Y"}
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} />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oC,mCAAA,GAAhB;EACA,MAAM,CAACC,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,EAAgC,IAAhC,CAApC;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,MAAMC,WAAW,GAAG1C,gBAAgB,CAACC,KAAD,CAApC;;IACAsC,aAAa,CAACG,WAAD,CAAb;EACD,CAHD,EAGG,CAACzC,KAAD,CAHH;;EAKA,IAAI,CAACqC,UAAL,EAAiB;IACf,OAAO,IAAP;EACD;;EAED,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEA,UAAU,CAAC9B;EAAxB,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAE8B,UAAU,CAAClC;EAAxB,GACG2B,YAAY,gBAAG,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAACY,GAAG,EAAEZ;IAAN,CAApB;IAAyC,QAAQ,MAAjD;IAAkD,IAAI,EAAE;EAAxD,EAAH,GAAuE,IADtF,CADF,eAIE,6BAAC,iBAAD;IAAM,KAAK,EAAEO,UAAU,CAACpB;EAAxB,GAAoCK,IAApC,CAJF,eAKE,6BAAC,iBAAD;IAAM,KAAK,EAAE,CAACe,UAAU,CAACb,MAAZ,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"}
@@ -88,7 +88,8 @@ const DisciplinePartners = (props, context) => {
88
88
  className: _style.default.logoContainer
89
89
  }, /*#__PURE__*/_react.default.createElement(_picture.default, {
90
90
  className: _style.default.logo,
91
- src: authorLogo.src
91
+ src: authorLogo.src,
92
+ alt: authorLogo.alt
92
93
  }), /*#__PURE__*/_react.default.createElement("div", {
93
94
  className: _style.default.arrowWrapper
94
95
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {