@coorpacademy/components 10.22.24-alpha.5 → 10.22.25-alpha.15

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 (79) hide show
  1. package/es/atom/choice/index.native.js +4 -4
  2. package/es/atom/choice/index.native.js.map +1 -1
  3. package/es/atom/select-modal/index.native.js +1 -1
  4. package/es/atom/select-modal/index.native.js.map +1 -1
  5. package/es/molecule/answer/index.native.js +85 -0
  6. package/es/molecule/answer/index.native.js.map +1 -0
  7. package/es/molecule/answer/prop-types.js +22 -3
  8. package/es/molecule/answer/prop-types.js.map +1 -1
  9. package/es/molecule/questions/mobile/draggable/index.native.js +8 -29
  10. package/es/molecule/questions/mobile/draggable/index.native.js.map +1 -1
  11. package/es/molecule/questions/mobile/switch/index.native.js +57 -54
  12. package/es/molecule/questions/mobile/switch/index.native.js.map +1 -1
  13. package/es/molecule/questions/mobile/template/index.native.js +18 -23
  14. package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
  15. package/es/organism/review-congrats/index.js +3 -1
  16. package/es/organism/review-congrats/index.js.map +1 -1
  17. package/es/organism/review-congrats/style.css +5 -0
  18. package/es/organism/review-slide/index.js +1 -8
  19. package/es/organism/review-slide/index.js.map +1 -1
  20. package/es/organism/review-slide/index.native.js +213 -0
  21. package/es/organism/review-slide/index.native.js.map +1 -0
  22. package/es/organism/review-slide/prop-types.js +4 -3
  23. package/es/organism/review-slide/prop-types.js.map +1 -1
  24. package/es/organism/review-stacked-slides/index.native.js +34 -0
  25. package/es/organism/review-stacked-slides/index.native.js.map +1 -0
  26. package/es/organism/review-stacked-slides/prop-types.js +3 -2
  27. package/es/organism/review-stacked-slides/prop-types.js.map +1 -1
  28. package/es/template/app-player/popin-correction/index.js +6 -3
  29. package/es/template/app-player/popin-correction/index.js.map +1 -1
  30. package/es/template/app-player/popin-end/index.js +6 -3
  31. package/es/template/app-player/popin-end/index.js.map +1 -1
  32. package/es/template/app-review/player/index.native.js +33 -230
  33. package/es/template/app-review/player/index.native.js.map +1 -1
  34. package/es/template/app-review/player/prop-types.js.map +1 -1
  35. package/es/template/app-review/player/style.css +7 -0
  36. package/es/template/app-review/template-context.js +3 -1
  37. package/es/template/app-review/template-context.js.map +1 -1
  38. package/lib/atom/choice/index.native.js +4 -4
  39. package/lib/atom/choice/index.native.js.map +1 -1
  40. package/lib/atom/select-modal/index.native.js +1 -1
  41. package/lib/atom/select-modal/index.native.js.map +1 -1
  42. package/lib/molecule/answer/index.native.js +94 -0
  43. package/lib/molecule/answer/index.native.js.map +1 -0
  44. package/lib/molecule/answer/prop-types.js +25 -3
  45. package/lib/molecule/answer/prop-types.js.map +1 -1
  46. package/lib/molecule/questions/mobile/draggable/index.native.js +8 -31
  47. package/lib/molecule/questions/mobile/draggable/index.native.js.map +1 -1
  48. package/lib/molecule/questions/mobile/switch/index.native.js +64 -62
  49. package/lib/molecule/questions/mobile/switch/index.native.js.map +1 -1
  50. package/lib/molecule/questions/mobile/template/index.native.js +18 -23
  51. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
  52. package/lib/organism/review-congrats/index.js +3 -1
  53. package/lib/organism/review-congrats/index.js.map +1 -1
  54. package/lib/organism/review-congrats/style.css +5 -0
  55. package/lib/organism/review-slide/index.js +1 -8
  56. package/lib/organism/review-slide/index.js.map +1 -1
  57. package/lib/organism/review-slide/index.native.js +232 -0
  58. package/lib/organism/review-slide/index.native.js.map +1 -0
  59. package/lib/organism/review-slide/prop-types.js +6 -5
  60. package/lib/organism/review-slide/prop-types.js.map +1 -1
  61. package/lib/organism/review-stacked-slides/index.native.js +47 -0
  62. package/lib/organism/review-stacked-slides/index.native.js.map +1 -0
  63. package/lib/organism/review-stacked-slides/prop-types.js +3 -2
  64. package/lib/organism/review-stacked-slides/prop-types.js.map +1 -1
  65. package/lib/template/app-player/popin-correction/index.js +7 -3
  66. package/lib/template/app-player/popin-correction/index.js.map +1 -1
  67. package/lib/template/app-player/popin-end/index.js +7 -3
  68. package/lib/template/app-player/popin-end/index.js.map +1 -1
  69. package/lib/template/app-review/player/index.native.js +36 -233
  70. package/lib/template/app-review/player/index.native.js.map +1 -1
  71. package/lib/template/app-review/player/prop-types.js.map +1 -1
  72. package/lib/template/app-review/player/style.css +7 -0
  73. package/lib/template/app-review/template-context.js +3 -1
  74. package/lib/template/app-review/template-context.js.map +1 -1
  75. package/package.json +2 -2
  76. package/es/molecule/questions/qcm/index.native.js +0 -50
  77. package/es/molecule/questions/qcm/index.native.js.map +0 -1
  78. package/lib/molecule/questions/qcm/index.native.js +0 -62
  79. package/lib/molecule/questions/qcm/index.native.js.map +0 -1
@@ -3,267 +3,70 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _react = _interopRequireDefault(require("react"));
7
-
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
6
+ var _react = _interopRequireWildcard(require("react"));
9
7
 
10
8
  var _reactNative = require("react-native");
11
9
 
12
- var _freeText = _interopRequireDefault(require("../../../molecule/questions/free-text"));
10
+ var _index = _interopRequireDefault(require("../../../organism/review-stacked-slides/index.native"));
13
11
 
14
12
  var _templateContext = require("../template-context");
15
13
 
16
- var _propTypes2 = require("./prop-types");
17
-
18
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
15
 
20
- // import theme from '../../../modules/theme';
21
- // import translations from '../../../translations';
22
- // import {BrandThemeContext} from '../../../app-shared/components/brand-theme-provider';
23
- // import Button from '../../../app-shared/components/button';
24
- // import {HEADER_HEIGHT} from '../../../app-shared/components/header-v2';
25
- // export type _Choice_ = {
26
- // text?: string,
27
- // selected: boolean
28
- // };
29
- // export type _Slide_ = {
30
- // category: string,
31
- // question: string,
32
- // instruction: string,
33
- // type: 'multiSelection' | 'singleSelection' | 'trueOrFalse',
34
- // choices?: _Choice_[]
35
- // };
36
- // interface Props {
37
- // slide: _Slide_;
38
- // num: number;
39
- // }
40
- const quizzerStyle = _reactNative.StyleSheet.create({
41
- container: {
42
- flex: 1,
43
- padding: 20,
44
- // paddingTop: HEADER_HEIGHT + 20, @todo with props
45
- // backgroundColor: theme.colors.white, @todo with props
46
- justifyContent: 'space-between',
47
- alignItems: 'center'
48
- }
49
- });
50
-
51
- const SLIDE_HEIGHT = () => (0, _reactNative.useWindowDimensions)().height * 0.75; // const creatSlideStyle = (num: number) =>
52
-
53
-
54
- const creatSlideStyle = (num, width, height) => _reactNative.StyleSheet.create({
55
- slide: {
56
- position: 'absolute',
57
- top: height / 2 - SLIDE_HEIGHT() / 2 - num * 4,
58
- flex: 1,
59
- backgroundColor: '#fff',
60
- // backgroundColor: theme.colors.white, @todo with props and useEffect
61
- height: SLIDE_HEIGHT(),
62
- width: width - 40 - num * 8,
63
- justifyContent: 'space-between',
64
- alignItems: 'center',
65
- padding: 25,
66
- shadowColor: '#000',
67
- shadowOffset: {
68
- width: 0,
69
- height: -1
70
- },
71
- shadowOpacity: 0.05,
72
- shadowRadius: 16,
73
- elevation: 10 - num * 1,
74
- borderRadius: 16
75
- },
76
- category: {
77
- fontSize: 12,
78
- lineHeight: 16,
79
- // color: theme.colors.text.primary, @todo with props
80
- // marginBottom: theme.spacing.tiny, @todo with props
81
- // marginTop: theme.spacing.small, @todo with props
82
- textAlign: 'center'
83
- },
84
- question: {
85
- fontSize: 16,
86
- lineHeight: 22,
87
- fontWeight: '700',
88
- // color: theme.colors.text.primary, @todo with props
89
- textAlign: 'center'
90
- },
91
- instruction: {
92
- fontSize: 12,
93
- lineHeight: 16,
94
- // color: theme.colors.gray.medium, @todo with props
95
- // marginBottom: theme.spacing.base, @todo with props
96
- // marginTop: theme.spacing.small, @todo with props
97
- textAlign: 'center'
98
- },
99
- button: {
100
- width: 287,
101
- height: 52,
102
- borderRadius: 7 // marginTop: theme.spacing.base @todo with props
16
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
103
17
 
104
- }
105
- });
106
-
107
- const createOptionStyle = selected => {
108
- // const brandTheme = React.useContext(BrandThemeContext); @todo with props
109
- return _reactNative.StyleSheet.create({
110
- box: {
111
- width: '100%',
112
- // https://stackoverflow.com/a/66561995/959219
113
- shadowColor: '#000',
114
- shadowOffset: {
115
- width: 0,
116
- height: -1
117
- },
118
- shadowOpacity: 0.2,
119
- shadowRadius: 16,
120
- elevation: 8,
121
- // backgroundColor: selected ? brandTheme.colors.primary : theme.colors.white, @todo with props
122
- padding: 12,
123
- marginTop: 4,
124
- marginBottom: 4,
125
- borderRadius: 8
126
- },
127
- text: {
128
- fontSize: 15,
129
- fontWeight: 'bold',
130
- lineHeight: 24,
131
- // color: selected ? theme.colors.white : theme.colors.text.primary, @todo with props
132
- textAlign: 'center'
133
- }
134
- });
135
- };
18
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
136
19
 
137
- const choicesStyle = _reactNative.StyleSheet.create({
20
+ const createStyleSheet = (theme, headerHeight) => _reactNative.StyleSheet.create({
138
21
  container: {
139
22
  flex: 1,
140
- width: '100%',
141
- justifyContent: 'center',
23
+ paddingTop: headerHeight,
24
+ backgroundColor: theme.colors.white,
25
+ // justifyContent: 'space-between',
142
26
  alignItems: 'center'
27
+ },
28
+ header: {
29
+ width: '100%',
30
+ backgroundColor: '#ded',
31
+ height: 70
143
32
  }
144
33
  });
145
- /* {choices.map(({text, selected = false}: _Choice_) => { */
146
-
147
-
148
- const Choices = ({
149
- choices = []
150
- }) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
151
- style: choicesStyle.container
152
- }, choices.map(({
153
- text,
154
- selected = false
155
- }, index) => {
156
- const optionStyle = createOptionStyle(selected);
157
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
158
- style: optionStyle.box,
159
- key: `choice-${index}`
160
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
161
- style: optionStyle.text
162
- }, text, " ", selected));
163
- }));
164
34
 
165
- Choices.propTypes = process.env.NODE_ENV !== "production" ? {
166
- choices: _propTypes.default.arrayOf({
167
- text: _propTypes.default.text,
168
- selected: _propTypes.default.bool
169
- })
170
- } : {};
35
+ const ReviewHeader = ({
36
+ style
37
+ }) => /*#__PURE__*/_react.default.createElement(_reactNative.View, style, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "review header @todo"));
171
38
 
172
- const Slide = props => {
39
+ const Slides = props => {
173
40
  const {
174
- validateSlide,
175
- slide,
176
- num
41
+ header,
42
+ stack,
43
+ reviewBackgroundAriaLabel,
44
+ congratsProps
177
45
  } = props;
178
46
  const {
179
- width,
180
- height
181
- } = (0, _reactNative.useWindowDimensions)();
182
- const slideStyle = creatSlideStyle(num, width, height);
183
- const validateLabel = '__validate'; // translations.validate
184
-
185
- const templateContext = (0, _templateContext.useTemplateContext)();
186
- const {
187
- analytics
188
- } = templateContext;
189
- const {
190
- answerUI: {
191
- isDisabled = false,
192
- value = '',
193
- model: {
194
- type,
195
- onChange
196
- }
197
- } = {
198
- isDisabled: false,
199
- value: '',
200
- model: {
201
- type: 'freeText',
202
- onChange: () => null
203
- }
47
+ theme,
48
+ display: {
49
+ headerHeight
204
50
  }
205
- } = slide;
51
+ } = (0, _templateContext.useTemplateContext)();
52
+ const [styleSheet, setStylesheet] = (0, _react.useState)(null);
53
+ (0, _react.useEffect)(() => {
54
+ const _stylesheet = createStyleSheet(theme, headerHeight);
206
55
 
207
- switch (type) {
208
- case 'freeText':
209
- {
210
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
211
- style: slideStyle.slide
212
- }, /*#__PURE__*/_react.default.createElement(_freeText.default, {
213
- isDisabled: isDisabled,
214
- onChange: onChange,
215
- value: value,
216
- testID: "free-text",
217
- questionType: "basic",
218
- analytics: analytics
219
- }));
220
- }
221
-
222
- default:
223
- }
224
-
225
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
226
- style: slideStyle.slide
227
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
228
- style: slideStyle.category
229
- }, num), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
230
- style: slideStyle.question
231
- }, slide.question), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
232
- style: slideStyle.instruction
233
- }, slide.instruction), /*#__PURE__*/_react.default.createElement(Choices, {
234
- choices: slide.choices
235
- }), /*#__PURE__*/_react.default.createElement(_reactNative.Button, {
236
- style: slideStyle.button,
237
- onPress: validateSlide,
238
- testID: `button-quizzer-validate`
239
- }, validateLabel));
240
- }; // const Slides = ({slide}: Props) => {
241
-
242
-
243
- const Slides = props => {
244
- const {
245
- stack
246
- } = props;
247
- const {
248
- slides,
249
- validateButton: validateSlide
250
- } = stack;
56
+ setStylesheet(_stylesheet);
57
+ }, [theme, headerHeight]);
251
58
 
252
- if (!slides) {
253
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, null);
59
+ if (!styleSheet) {
60
+ return null;
254
61
  }
255
62
 
256
63
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
257
- style: quizzerStyle.container
258
- }, /*#__PURE__*/_react.default.createElement(Slide, {
259
- validateSlide: validateSlide,
260
- slide: slides[0],
261
- num: 0,
262
- key: `slide-${0}`
263
- }));
64
+ style: styleSheet.container
65
+ }, /*#__PURE__*/_react.default.createElement(ReviewHeader, {
66
+ style: styleSheet.header
67
+ }), stack ? /*#__PURE__*/_react.default.createElement(_index.default, stack) : null);
264
68
  };
265
69
 
266
- Slides.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.PlayerReviewPropTypes : {};
267
70
  var _default = Slides;
268
71
  exports.default = _default;
269
72
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/template/app-review/player/index.native.tsx"],"names":["quizzerStyle","StyleSheet","create","container","flex","padding","justifyContent","alignItems","SLIDE_HEIGHT","height","creatSlideStyle","num","width","slide","position","top","backgroundColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","category","fontSize","lineHeight","textAlign","question","fontWeight","instruction","button","createOptionStyle","selected","box","marginTop","marginBottom","text","choicesStyle","Choices","choices","map","index","optionStyle","propTypes","PropTypes","arrayOf","bool","Slide","props","validateSlide","slideStyle","validateLabel","templateContext","analytics","answerUI","isDisabled","value","model","type","onChange","Slides","stack","slides","validateButton","PlayerReviewPropTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA,MAAMA,YAAY,GAAGC,wBAAWC,MAAX,CAAkB;AACrCC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,OAAO,EAAE,EAFA;AAGT;AACA;AACAC,IAAAA,cAAc,EAAE,eALP;AAMTC,IAAAA,UAAU,EAAE;AANH;AAD0B,CAAlB,CAArB;;AAWA,MAAMC,YAAY,GAAG,MAAM,wCAAsBC,MAAtB,GAA+B,IAA1D,C,CAEA;;;AACA,MAAMC,eAAe,GAAG,CAACC,GAAD,EAAMC,KAAN,EAAaH,MAAb,KACtBR,wBAAWC,MAAX,CAAkB;AAChBW,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,UADL;AAELC,IAAAA,GAAG,EAAEN,MAAM,GAAG,CAAT,GAAaD,YAAY,KAAK,CAA9B,GAAkCG,GAAG,GAAG,CAFxC;AAGLP,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kBACE,6BAAC,KAAD;AAAO,IAAA,aAAa,EAAE8C,aAAtB;AAAqC,IAAA,KAAK,EAAEa,MAAM,CAAC,CAAD,CAAlD;AAAuD,IAAA,GAAG,EAAE,CAA5D;AAA+D,IAAA,GAAG,EAAG,SAAQ,CAAE;AAA/E,IADF,CADF;AAaD,CApBD;;AAsBAF,MAAM,CAACjB,SAAP,2CAAmBqB,iCAAnB;eAEeJ,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {View, StyleSheet, Text, useWindowDimensions, Button} from 'react-native';\n\nimport FreeText from '../../../molecule/questions/free-text';\nimport {useTemplateContext} from '../template-context';\nimport {PlayerReviewPropTypes} from './prop-types';\n\n// import theme from '../../../modules/theme';\n// import translations from '../../../translations';\n// import {BrandThemeContext} from '../../../app-shared/components/brand-theme-provider';\n// import Button from '../../../app-shared/components/button';\n// import {HEADER_HEIGHT} from '../../../app-shared/components/header-v2';\n\n// export type _Choice_ = {\n// text?: string,\n// selected: boolean\n// };\n\n// export type _Slide_ = {\n// category: string,\n// question: string,\n// instruction: string,\n// type: 'multiSelection' | 'singleSelection' | 'trueOrFalse',\n// choices?: _Choice_[]\n// };\n\n// interface Props {\n// slide: _Slide_;\n// num: number;\n// }\n\nconst quizzerStyle = StyleSheet.create({\n container: {\n flex: 1,\n padding: 20,\n // paddingTop: HEADER_HEIGHT + 20, @todo with props\n // backgroundColor: theme.colors.white, @todo with props\n justifyContent: 'space-between',\n alignItems: 'center'\n }\n});\n\nconst SLIDE_HEIGHT = () => useWindowDimensions().height * 0.75;\n\n// const creatSlideStyle = (num: number) =>\nconst creatSlideStyle = (num, width, height) =>\n StyleSheet.create({\n slide: {\n position: 'absolute',\n top: height / 2 - SLIDE_HEIGHT() / 2 - num * 4,\n flex: 1,\n backgroundColor: '#fff',\n // backgroundColor: theme.colors.white, @todo with props and useEffect\n height: SLIDE_HEIGHT(),\n width: width - 40 - num * 8,\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 category: {\n fontSize: 12,\n lineHeight: 16,\n // color: theme.colors.text.primary, @todo with props\n // marginBottom: theme.spacing.tiny, @todo with props\n // marginTop: theme.spacing.small, @todo with props\n textAlign: 'center'\n },\n question: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n // color: theme.colors.text.primary, @todo with props\n textAlign: 'center'\n },\n instruction: {\n fontSize: 12,\n lineHeight: 16,\n // color: theme.colors.gray.medium, @todo with props\n // marginBottom: theme.spacing.base, @todo with props\n // marginTop: theme.spacing.small, @todo with props\n textAlign: 'center'\n },\n button: {\n width: 287,\n height: 52,\n borderRadius: 7\n // marginTop: theme.spacing.base @todo with props\n }\n });\n\nconst createOptionStyle = selected => {\n // const brandTheme = React.useContext(BrandThemeContext); @todo with props\n\n return StyleSheet.create({\n box: {\n width: '100%',\n // https://stackoverflow.com/a/66561995/959219\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.2,\n shadowRadius: 16,\n elevation: 8,\n // backgroundColor: selected ? brandTheme.colors.primary : theme.colors.white, @todo with props\n padding: 12,\n marginTop: 4,\n marginBottom: 4,\n borderRadius: 8\n },\n text: {\n fontSize: 15,\n fontWeight: 'bold',\n lineHeight: 24,\n // color: selected ? theme.colors.white : theme.colors.text.primary, @todo with props\n textAlign: 'center'\n }\n });\n};\n\nconst choicesStyle = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%',\n justifyContent: 'center',\n alignItems: 'center'\n }\n});\n\n/* {choices.map(({text, selected = false}: _Choice_) => { */\nconst Choices = ({choices = []}) => (\n <View style={choicesStyle.container}>\n {choices.map(({text, selected = false}, index) => {\n const optionStyle = createOptionStyle(selected);\n return (\n <View style={optionStyle.box} key={`choice-${index}`}>\n <Text style={optionStyle.text}>\n {text} {selected}\n </Text>\n </View>\n );\n })}\n </View>\n);\n\nChoices.propTypes = {\n choices: PropTypes.arrayOf({\n text: PropTypes.text,\n selected: PropTypes.bool\n })\n};\n\nconst Slide = props => {\n const {validateSlide, slide, num} = props;\n const {width, height} = useWindowDimensions();\n\n const slideStyle = creatSlideStyle(num, width, height);\n const validateLabel = '__validate'; // translations.validate\n\n const templateContext = useTemplateContext();\n const {analytics} = templateContext;\n\n const {\n answerUI: {isDisabled = false, value = '', model: {type, onChange}} = {\n isDisabled: false,\n value: '',\n model: {type: 'freeText', onChange: () => null}\n }\n } = slide;\n\n switch (type) {\n case 'freeText': {\n return (\n <View style={slideStyle.slide}>\n <FreeText\n isDisabled={isDisabled}\n onChange={onChange}\n value={value}\n testID=\"free-text\"\n questionType=\"basic\"\n analytics={analytics}\n />\n </View>\n );\n }\n default:\n }\n\n return (\n <View style={slideStyle.slide}>\n <Text style={slideStyle.category}>{num}</Text>\n <Text style={slideStyle.question}>{slide.question}</Text>\n <Text style={slideStyle.instruction}>{slide.instruction}</Text>\n\n <Choices choices={slide.choices} />\n\n <Button style={slideStyle.button} onPress={validateSlide} testID={`button-quizzer-validate`}>\n {validateLabel}\n </Button>\n </View>\n );\n};\n\n// const Slides = ({slide}: Props) => {\nconst Slides = props => {\n const {stack} = props;\n const {slides, validateButton: validateSlide} = stack;\n if (!slides) {\n return <View />;\n }\n\n return (\n <View style={quizzerStyle.container}>\n <Slide validateSlide={validateSlide} slide={slides[0]} num={0} key={`slide-${0}`} />\n {/* {slides.reverse().map((_slide, index) => (\n <Slide\n validateSlide={validateSlide}\n slide={_slide}\n num={slides.length - index}\n key={`slide-${index}`}\n />\n ))} */}\n </View>\n );\n};\n\nSlides.propTypes = PlayerReviewPropTypes;\n\nexport default Slides;\n"],"file":"index.native.js"}
1
+ {"version":3,"sources":["../../../../src/template/app-review/player/index.native.tsx"],"names":["createStyleSheet","theme","headerHeight","StyleSheet","create","container","flex","paddingTop","backgroundColor","colors","white","alignItems","header","width","height","ReviewHeader","style","Slides","props","stack","reviewBackgro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AU,CAAClB;AAAxB,kBACE,6BAAC,YAAD;AAAc,IAAA,KAAK,EAAEkB,UAAU,CAACX;AAAhC,IADF,EAEGO,KAAK,gBAAG,6BAAC,cAAD,EAAmBA,KAAnB,CAAH,GAAkC,IAF1C,CADF;AAMD,CAzBD;;eA2BeF,M","sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, Text} from 'react-native';\nimport StackedSlides from '../../../organism/review-stacked-slides/index.native';\nimport {Theme} from '../../../variables/theme.native';\nimport {useTemplateContext} from '../template-context';\nimport {Props} from './prop-types';\n\nconst createStyleSheet = (theme: Theme, headerHeight: number) =>\n StyleSheet.create({\n container: {\n flex: 1,\n paddingTop: headerHeight,\n backgroundColor: theme.colors.white,\n // justifyContent: 'space-between',\n alignItems: 'center'\n },\n header: {\n width: '100%',\n backgroundColor: '#ded',\n height: 70\n }\n });\n\nconst ReviewHeader = ({style}) => (\n <View {...style}>\n <Text>review header @todo</Text>\n </View>\n);\n\nconst Slides = (props: Props) => {\n const {header, stack, reviewBackgroundAriaLabel, congratsProps} = props;\n\n const {\n theme,\n display: {headerHeight}\n } = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<any | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, headerHeight);\n setStylesheet(_stylesheet);\n }, [theme, headerHeight]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <ReviewHeader style={styleSheet.header} />\n {stack ? <StackedSlides {...stack} /> : null}\n </View>\n );\n};\n\nexport default Slides;\n"],"file":"index.native.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/template/app-review/player/prop-types.js"],"names":["PlayerReviewPropTypes","header","PropTypes","shape","ReviewHeaderPropTypes","stack","StackedSlidesPropTypes","reviewBackgroundAriaLabel","ReviewBackgroundPropTypes","congratsProps","ReviewCongratsPropTypes"],"mappings":";;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,qBAAqB,GAAG;AACnCC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgBC,mBAAhB,CAD2B;AAEnCC,EAAAA,KAAK,EAAEH,mBAAUC,KAAV,CAAgBG,mBAAhB,CAF4B;AAGnCC,EAAAA,yBAAyB,EAAEC,oBAA0B,YAA1B,CAHQ;AAInCC,EAAAA,aAAa,EAAEP,mBAAUC,KAAV,CAAgBO,mBAAhB;AAJoB,CAA9B","sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewCongratsPropTypes from '../../../organism/review-congrats/prop-types';\nimport ReviewBackgroundPropTypes from '../../../atom/review-background/prop-types';\nimport ReviewHeaderPropTypes from '../../../organism/review-header/prop-types';\nimport StackedSlidesPropTypes from '../../../organism/review-stacked-slides/prop-types';\n\nexport const PlayerReviewPropTypes = {\n header: PropTypes.shape(ReviewHeaderPropTypes),\n stack: PropTypes.shape(StackedSlidesPropTypes),\n reviewBackgroundAriaLabel: ReviewBackgroundPropTypes['aria-label'],\n congratsProps: PropTypes.shape(ReviewCongratsPropTypes)\n};\n"],"file":"prop-types.js"}
1
+ {"version":3,"sources":["../../../../src/template/app-review/player/prop-types.ts"],"names":["PlayerReviewPropTypes","header","PropTypes","shape","ReviewHeaderPropTypes","stack","StackedSlidesPropTypes","reviewBackgroundAriaLabel","ReviewBackgroundPropTypes","congratsProps","ReviewCongratsPropTypes"],"mappings":";;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,qBAAqB,GAAG;AACnCC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgBC,mBAAhB,CAD2B;AAEnCC,EAAAA,KAAK,EAAEH,mBAAUC,KAAV,CAAgBG,mBAAhB,CAF4B;AAGnCC,EAAAA,yBAAyB,EAAEC,oBAA0B,YAA1B,CAHQ;AAInCC,EAAAA,aAAa,EAAEP,mBAAUC,KAAV,CAAgBO,mBAAhB;AAJoB,CAA9B","sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewCongratsPropTypes from '../../../organism/review-congrats/prop-types';\nimport ReviewBackgroundPropTypes from '../../../atom/review-background/prop-types';\nimport ReviewHeaderPropTypes from '../../../organism/review-header/prop-types';\nimport StackedSlidesPropTypes from '../../../organism/review-stacked-slides/prop-types';\n\nexport const PlayerReviewPropTypes = {\n header: PropTypes.shape(ReviewHeaderPropTypes),\n stack: PropTypes.shape(StackedSlidesPropTypes),\n reviewBackgroundAriaLabel: ReviewBackgroundPropTypes['aria-label'],\n congratsProps: PropTypes.shape(ReviewCongratsPropTypes)\n};\n\nexport type Props = PropTypes.InferProps<typeof PlayerReviewPropTypes>;\n"],"file":"prop-types.js"}
@@ -39,3 +39,10 @@
39
39
  top: 0;
40
40
  left: 0;
41
41
  }
42
+
43
+ /* ie fallback */
44
+ :-ms-fullscreen,
45
+ :root .congrats {
46
+ position: relative;
47
+ bottom: 20%;
48
+ }
@@ -19,8 +19,10 @@ const Context = (0, _react.createContext)({
19
19
  theme: _theme.default,
20
20
  translations: {},
21
21
  display: {
22
+ headerHeight: 67,
22
23
  statusBarHeight: 42
23
- }
24
+ },
25
+ store: {}
24
26
  });
25
27
 
26
28
  const useTemplateContext = () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/template/app-review/template-context.tsx"],"names":["Context","theme","defaultTheme","translations","display","statusBarHeight","useTemplateContext","context","Error","TemplateContext","values","children"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AAgBA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,KAAK,EAAEC,cADqB;AAE5BC,EAAAA,YAAY,EAAE,EAFc;AAG5BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,eAAe,EAAE;AADV;AAHmB,CAAd,CAAhB;;AAQA,MAAMC,kBAAkB,GAAG,MAA6B;AACtD,QAAMC,OAAO,GAAG,uBAAWP,OAAX,CAAhB;;AAEA,MAAI,CAACO,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;AAGD;;AAED,SAAOD,OAAP;AACD,CAVD;;;;AAYA,MAAME,eAAe,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AACrD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD","sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n statusBarHeight: number;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n statusBarHeight: 42\n }\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"file":"template-context.js"}
1
+ {"version":3,"sources":["../../../src/template/app-review/template-context.tsx"],"names":["Context","theme","defaultTheme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","Error","TemplateContext","values","children"],"mappings":";;;;;AAAA;;AAIA;;;;;;;;;;AAsBA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,KAAK,EAAEC,cADqB;AAE5BC,EAAAA,YAAY,EAAE,EAFc;AAG5BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,YAAY,EAAE,EADP;AAEPC,IAAAA,eAAe,EAAE;AAFV,GAHmB;AAO5BC,EAAAA,KAAK,EAAE;AAPqB,CAAd,CAAhB;;AAUA,MAAMC,kBAAkB,GAAG,MAA6B;AACtD,QAAMC,OAAO,GAAG,uBAAWT,OAAX,CAAhB;;AAEA,MAAI,CAACS,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;AAGD;;AAED,SAAOD,OAAP;AACD,CAVD;;;;AAYA,MAAME,eAAe,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AACrD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD","sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {FocusedSelectId, HandleBlur, HandleFocus} from '../../types/app-review';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"file":"template-context.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.22.24-alpha.5+31142bfd9",
3
+ "version": "10.22.25-alpha.15+2f4f48c76",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -140,5 +140,5 @@
140
140
  "webpack": "^4.43.0"
141
141
  },
142
142
  "author": "CoorpAcademy",
143
- "gitHead": "31142bfd914b3f169048c3e0bc261835ab74c030"
143
+ "gitHead": "2f4f48c7680fbec36ad06858d0416c2a6500c695"
144
144
  }
@@ -1,50 +0,0 @@
1
- import { View, StyleSheet } from 'react-native';
2
- import React, { useState, useEffect } from 'react';
3
- import { useTemplateContext } from '../../../template/app-review/template-context';
4
-
5
- const createStyleSheet = theme => StyleSheet.create({
6
- boxShadow: {
7
- shadowColor: '#000',
8
- shadowOffset: {
9
- width: 0,
10
- height: 4
11
- },
12
- shadowOpacity: 0.12,
13
- shadowRadius: 16,
14
- elevation: 6
15
- },
16
- container: {
17
- backgroundColor: theme.colors.white,
18
- borderRadius: theme.radius.regular,
19
- overflow: 'hidden',
20
- flexDirection: 'row',
21
- alignItems: 'stretch'
22
- }
23
- });
24
-
25
- const QuestionChoiceComponent = ({
26
- children,
27
- isSelected = false,
28
- testID: prefixTestID
29
- }) => {
30
- const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';
31
- const [styleSheet, setStylesheet] = useState(null);
32
- const templateContext = useTemplateContext();
33
- const {
34
- theme
35
- } = templateContext;
36
- useEffect(() => {
37
- const _stylesheet = createStyleSheet(theme);
38
-
39
- setStylesheet(_stylesheet);
40
- }, [theme]);
41
- return /*#__PURE__*/React.createElement(View, {
42
- style: [styleSheet && styleSheet.boxShadow]
43
- }, /*#__PURE__*/React.createElement(View, {
44
- style: [styleSheet && styleSheet.container],
45
- testID: prefixTestID && `${prefixTestID}${selectedSuffix}`
46
- }, children));
47
- };
48
-
49
- export default QuestionChoiceComponent;
50
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/qcm/index.native.tsx"],"names":["View","StyleSheet","React","useState","useEffect","useTemplateContext","createStyleSheet","theme","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","container","backgroundColor","colors","white","borderRadius","radius","regular","overflow","flexDirection","alignItems","QuestionChoiceComponent","children","isSelected","testID","prefixTestID","selectedSuffix","styleSheet","setStylesheet","templateContext","_stylesheet"],"mappings":"AAAA,SAAQA,IAAR,EAAcC,UAAd,QAA0C,cAA1C;AACA,OAAOC,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,QAAyC,OAAzC;AACA,SAAQC,kBAAR,QAAiC,+CAAjC;;AAmCA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBN,UAAU,CAACO,MAAX,CAAkB;AAChBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,WAAW,EAAE,MADJ;AAETC,IAAAA,YAAY,EAAE;AAACC,MAAAA,KAAK,EAAE,CAAR;AAAWC,MAAAA,MAAM,EAAE;AAAnB,KAFL;AAGTC,IAAAA,aAAa,EAAE,IAHN;AAITC,IAAAA,YAAY,EAAE,EAJL;AAKTC,IAAAA,SAAS,EAAE;AALF,GADK;AAQhBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,eAAe,EAAEX,KAAK,CAACY,MAAN,CAAaC,KADrB;AAETC,IAAAA,YAAY,EAAEd,KAAK,CAACe,MAAN,CAAaC,OAFlB;AAGTC,IAAAA,QAAQ,EAAE,QAHD;AAITC,IAAAA,aAAa,EAAE,KAJN;AAKTC,IAAAA,UAAU,EAAE;AALH;AARK,CAAlB,CADF;;AAkBA,MAAMC,uBAAuB,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,UAAU,GAAG,KAAxB;AAA+BC,EAAAA,MAAM,EAAEC;AAAvC,CAAD,KAAiE;AAC/F,QAAMC,cAAc,GAAGD,YAAY,IAAIF,UAAhB,GAA6B,WAA7B,GAA2C,EAAlE;AAEA,QAAM,CAACI,UAAD,EAAaC,aAAb,IAA8B/B,QAAQ,CAAmB,IAAnB,CAA5C;AAEA,QAAMgC,eAAe,GAAG9B,kBAAkB,EAA1C;AACA,QAAM;AAACE,IAAAA;AAAD,MAAU4B,eAAhB;AAEA/B,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMgC,WAAW,GAAG9B,gBAAgB,CAACC,KAAD,CAApC;;AACA2B,IAAAA,aAAa,CAACE,WAAD,CAAb;AACD,GAHQ,EAGN,CAAC7B,KAAD,CAHM,CAAT;AAKA,sBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAE,CAAC0B,UAAU,IAAIA,UAAU,CAACxB,SAA1B;AAAb,kBACE,oBAAC,IAAD;AACE,IAAA,KAAK,EAAE,CAACwB,UAAU,IAAIA,UAAU,CAAChB,SAA1B,CADT;AAEE,IAAA,MAAM,EAAEc,YAAY,IAAK,GAAEA,YAAa,GAAEC,cAAe;AAF3D,KAIGJ,QAJH,CADF,CADF;AAUD,CAvBD;;AAyBA,eAAeD,uBAAf","sourcesContent":["import {View, StyleSheet, ViewStyle} from 'react-native';\nimport React, {useState, useEffect} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\n\ninterface Props {\n isSelected?: boolean;\n children: string;\n testID?: string;\n style?: ViewStyle;\n theme?: any;\n}\n\ntype StyleType = {\n boxShadow: {\n shadowColor: string;\n shadowOffset: {\n width: number;\n height: number;\n };\n shadowOpacity: number;\n shadowRadius: number;\n elevation: number;\n };\n container: {\n backgroundColor: string;\n borderRadius: number;\n shadowColor: string;\n shadowOffset: {width: number; height: number};\n shadowOpacity: number;\n shadowRadius: number;\n elevation: number;\n overflow: string;\n flexDirection: string;\n alignItems: string;\n };\n};\n\nconst createStyleSheet = (theme: any) =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 6\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n overflow: 'hidden',\n flexDirection: 'row',\n alignItems: 'stretch'\n }\n });\n\nconst QuestionChoiceComponent = ({children, isSelected = false, testID: prefixTestID}: Props) => {\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n\n const [styleSheet, setStylesheet] = useState<StyleType | null>(null);\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n return (\n <View style={[styleSheet && styleSheet.boxShadow]}>\n <View\n style={[styleSheet && styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {children}\n </View>\n </View>\n );\n};\n\nexport default QuestionChoiceComponent;\n"],"file":"index.native.js"}
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var _reactNative = require("react-native");
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _templateContext = require("../../../template/app-review/template-context");
11
-
12
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
13
-
14
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
15
-
16
- const createStyleSheet = theme => _reactNative.StyleSheet.create({
17
- boxShadow: {
18
- shadowColor: '#000',
19
- shadowOffset: {
20
- width: 0,
21
- height: 4
22
- },
23
- shadowOpacity: 0.12,
24
- shadowRadius: 16,
25
- elevation: 6
26
- },
27
- container: {
28
- backgroundColor: theme.colors.white,
29
- borderRadius: theme.radius.regular,
30
- overflow: 'hidden',
31
- flexDirection: 'row',
32
- alignItems: 'stretch'
33
- }
34
- });
35
-
36
- const QuestionChoiceComponent = ({
37
- children,
38
- isSelected = false,
39
- testID: prefixTestID
40
- }) => {
41
- const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';
42
- const [styleSheet, setStylesheet] = (0, _react.useState)(null);
43
- const templateContext = (0, _templateContext.useTemplateContext)();
44
- const {
45
- theme
46
- } = templateContext;
47
- (0, _react.useEffect)(() => {
48
- const _stylesheet = createStyleSheet(theme);
49
-
50
- setStylesheet(_stylesheet);
51
- }, [theme]);
52
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
53
- style: [styleSheet && styleSheet.boxShadow]
54
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
55
- style: [styleSheet && styleSheet.container],
56
- testID: prefixTestID && `${prefixTestID}${selectedSuffix}`
57
- }, children));
58
- };
59
-
60
- var _default = QuestionChoiceComponent;
61
- exports.default = _default;
62
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/qcm/index.native.tsx"],"names":["createStyleSheet","theme","StyleSheet","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","container","backgroundColor","colors","white","borderRadius","radius","regular","overflow","flexDirection","alignItems","QuestionChoiceComponent","children","isSelected","testID","prefixTestID","selectedSuffix","styleSheet","setStylesheet","templateContext","_stylesheet"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAmCA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,wBAAWC,MAAX,CAAkB;AAChBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,WAAW,EAAE,MADJ;AAETC,IAAAA,YAAY,EAAE;AAACC,MAAAA,KAAK,EAAE,CAAR;AAAWC,MAAAA,MAAM,EAAE;AAAnB,KAFL;AAGTC,IAAAA,aAAa,EAAE,IAHN;AAITC,IAAAA,YAAY,EAAE,EAJL;AAKTC,IAAAA,SAAS,EAAE;AALF,GADK;AAQhBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,eAAe,EAAEZ,KAAK,CAACa,MAAN,CAAaC,KADrB;AAETC,IAAAA,YAAY,EAAEf,KAAK,CAACgB,MAAN,CAAaC,OAFlB;AAGTC,IAAAA,QAAQ,EAAE,QAHD;AAITC,IAAAA,aAAa,EAAE,KAJN;AAKTC,IAAAA,UAAU,EAAE;AALH;AARK,CAAlB,CADF;;AAkBA,MAAMC,uBAAuB,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,UAAU,GAAG,KAAxB;AAA+BC,EAAAA,MAAM,EAAEC;AAAvC,CAAD,KAAiE;AAC/F,QAAMC,cAAc,GAAGD,YAAY,IAAIF,UAAhB,GAA6B,WAA7B,GAA2C,EAAlE;AAEA,QAAM,CAACI,UAAD,EAAaC,aAAb,IAA8B,qBAA2B,IAA3B,CAApC;AAEA,QAAMC,eAAe,GAAG,0CAAxB;AACA,QAAM;AAAC7B,IAAAA;AAAD,MAAU6B,eAAhB;AAEA,wBAAU,MAAM;AACd,UAAMC,WAAW,GAAG/B,gBAAgB,CAACC,KAAD,CAApC;;AACA4B,IAAAA,aAAa,CAACE,WAAD,CAAb;AACD,GAHD,EAGG,CAAC9B,KAAD,CAHH;AAKA,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAAC2B,UAAU,IAAIA,UAAU,CAACxB,SAA1B;AAAb,kBACE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CAACwB,UAAU,IAAIA,UAAU,CAAChB,SAA1B,CADT;AAEE,IAAA,MAAM,EAAEc,YAAY,IAAK,GAAEA,YAAa,GAAEC,cAAe;AAF3D,KAIGJ,QAJH,CADF,CADF;AAUD,CAvBD;;eAyBeD,uB","sourcesContent":["import {View, StyleSheet, ViewStyle} from 'react-native';\nimport React, {useState, useEffect} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\n\ninterface Props {\n isSelected?: boolean;\n children: string;\n testID?: string;\n style?: ViewStyle;\n theme?: any;\n}\n\ntype StyleType = {\n boxShadow: {\n shadowColor: string;\n shadowOffset: {\n width: number;\n height: number;\n };\n shadowOpacity: number;\n shadowRadius: number;\n elevation: number;\n };\n container: {\n backgroundColor: string;\n borderRadius: number;\n shadowColor: string;\n shadowOffset: {width: number; height: number};\n shadowOpacity: number;\n shadowRadius: number;\n elevation: number;\n overflow: string;\n flexDirection: string;\n alignItems: string;\n };\n};\n\nconst createStyleSheet = (theme: any) =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 6\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n overflow: 'hidden',\n flexDirection: 'row',\n alignItems: 'stretch'\n }\n });\n\nconst QuestionChoiceComponent = ({children, isSelected = false, testID: prefixTestID}: Props) => {\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n\n const [styleSheet, setStylesheet] = useState<StyleType | null>(null);\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n return (\n <View style={[styleSheet && styleSheet.boxShadow]}>\n <View\n style={[styleSheet && styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {children}\n </View>\n </View>\n );\n};\n\nexport default QuestionChoiceComponent;\n"],"file":"index.native.js"}