@coorpacademy/app-review 0.15.7 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -31,7 +31,7 @@ const storeTokenAndCreateProgression = async (store, options) => {
31
31
  };
32
32
  const AppReview = ({ options }) => {
33
33
  const [store, setStore] = useState(null);
34
- const { translate, onQuitClick, skin } = options;
34
+ const { translate, onQuitClick, skin, backgroundImage } = options;
35
35
  useEffect(() => {
36
36
  const newStore = configureStore(options);
37
37
  setStore(newStore);
@@ -42,6 +42,6 @@ const AppReview = ({ options }) => {
42
42
  if (!store)
43
43
  return null;
44
44
  return (React.createElement(Provider, { store: store },
45
- React.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate, skin: skin })));
45
+ React.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate, skin: skin, backgroundImage: backgroundImage })));
46
46
  };
47
47
  export default AppReview;
@@ -15,6 +15,7 @@ export declare type ConnectedOptions = {
15
15
  translate: Translate;
16
16
  onQuitClick: () => void;
17
17
  skin: Skin;
18
+ backgroundImage?: number;
18
19
  };
19
20
  export declare type AppOptions = ConnectedOptions & {
20
21
  token: string;
@@ -317,7 +317,7 @@ const isEndOfProgression = (progression) => {
317
317
  return progression.state.nextContent.ref === 'successExitNode';
318
318
  };
319
319
  export const mapStateToSlidesProps = (state, dispatch, options) => {
320
- const { translate, onQuitClick, skin } = options;
320
+ const { translate, onQuitClick, skin, backgroundImage } = options;
321
321
  const currentSlideRef = getCurrentSlideRef(state);
322
322
  const endReview = isEndOfProgression(state.data.progression);
323
323
  const correction = get(['data', 'corrections', currentSlideRef], state);
@@ -353,6 +353,7 @@ export const mapStateToSlidesProps = (state, dispatch, options) => {
353
353
  getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, translate, endReview),
354
354
  endReview: endReview && state.ui.showCongrats
355
355
  },
356
+ backgroundImage,
356
357
  congrats: buildCongratsProps(state, dispatch, options),
357
358
  quitPopin: showQuitPopin
358
359
  ? buildQuitPopinProps(dispatch)(onQuitClick, translate, skin)
package/lib/index.js CHANGED
@@ -59,7 +59,7 @@ const storeTokenAndCreateProgression = async (store, options) => {
59
59
  };
60
60
  const AppReview = ({ options }) => {
61
61
  const [store, setStore] = (0, react_1.useState)(null);
62
- const { translate, onQuitClick, skin } = options;
62
+ const { translate, onQuitClick, skin, backgroundImage } = options;
63
63
  (0, react_1.useEffect)(() => {
64
64
  const newStore = (0, configure_store_1.default)(options);
65
65
  setStore(newStore);
@@ -70,6 +70,6 @@ const AppReview = ({ options }) => {
70
70
  if (!store)
71
71
  return null;
72
72
  return (react_1.default.createElement(react_redux_1.Provider, { store: store },
73
- react_1.default.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate, skin: skin })));
73
+ react_1.default.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate, skin: skin, backgroundImage: backgroundImage })));
74
74
  };
75
75
  exports.default = AppReview;
@@ -15,6 +15,7 @@ export declare type ConnectedOptions = {
15
15
  translate: Translate;
16
16
  onQuitClick: () => void;
17
17
  skin: Skin;
18
+ backgroundImage?: number;
18
19
  };
19
20
  export declare type AppOptions = ConnectedOptions & {
20
21
  token: string;
@@ -324,7 +324,7 @@ const isEndOfProgression = (progression) => {
324
324
  return progression.state.nextContent.ref === 'successExitNode';
325
325
  };
326
326
  const mapStateToSlidesProps = (state, dispatch, options) => {
327
- const { translate, onQuitClick, skin } = options;
327
+ const { translate, onQuitClick, skin, backgroundImage } = options;
328
328
  const currentSlideRef = getCurrentSlideRef(state);
329
329
  const endReview = isEndOfProgression(state.data.progression);
330
330
  const correction = (0, get_1.default)(['data', 'corrections', currentSlideRef], state);
@@ -360,6 +360,7 @@ const mapStateToSlidesProps = (state, dispatch, options) => {
360
360
  getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, translate, endReview),
361
361
  endReview: endReview && state.ui.showCongrats
362
362
  },
363
+ backgroundImage,
363
364
  congrats: buildCongratsProps(state, dispatch, options),
364
365
  quitPopin: showQuitPopin
365
366
  ? buildQuitPopinProps(dispatch)(onQuitClick, translate, skin)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.15.7",
3
+ "version": "0.16.0",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=16.15.0"
@@ -35,7 +35,7 @@
35
35
  "main": "lib/index.js",
36
36
  "module": "es/index.js",
37
37
  "dependencies": {
38
- "@coorpacademy/components": "11.5.3",
38
+ "@coorpacademy/components": "11.6.0",
39
39
  "@coorpacademy/progression-engine": "11.5.3",
40
40
  "@coorpacademy/redux-task": "1.1.6",
41
41
  "@coorpacademy/review-services": "1.3.0",
@@ -74,5 +74,5 @@
74
74
  "webpack-cli": "^4.10.0",
75
75
  "webpack-dev-server": "^4.11.1"
76
76
  },
77
- "gitHead": "478c010d5560460f45d060463c4525620e3a9cf1"
77
+ "gitHead": "cd2b88340118356e7f84fb64fe3565d03a9962b1"
78
78
  }