@gamelearn/arcade-components 1.7.8 → 1.7.9

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.
@@ -44,7 +44,8 @@ var DecisionBody = function DecisionBody(_ref) {
44
44
  children = _ref.children,
45
45
  translate = _ref.translate,
46
46
  hasRewards = _ref.hasRewards,
47
- inScene = _ref.inScene;
47
+ inScene = _ref.inScene,
48
+ required = _ref.required;
48
49
 
49
50
  var _useState = (0, _react.useState)(currentSelectedChoice),
50
51
  _useState2 = _slicedToArray(_useState, 2),
@@ -84,13 +85,19 @@ var DecisionBody = function DecisionBody(_ref) {
84
85
  className: "popup__questions"
85
86
  }, /*#__PURE__*/_react.default.createElement(_Options.default, optionsProps)), /*#__PURE__*/_react.default.createElement("div", {
86
87
  className: "popup--buttons"
87
- }, /*#__PURE__*/_react.default.createElement("button", {
88
+ }, required ? /*#__PURE__*/_react.default.createElement("button", {
88
89
  type: "button",
89
90
  className: "gat--btn gat--btn__primary ".concat(selectedChoice.id !== undefined ? '' : 'disabled'),
90
91
  onClick: function onClick() {
91
92
  return canNext ? onNext(selectedChoice) : onBack(selectedChoice);
92
93
  }
93
- }, canNext || selectedChoice.id === undefined ? translate('screens.continue') : translate('tests.retry'))));
94
+ }, canNext || selectedChoice.id === undefined ? translate('screens.continue') : translate('tests.retry')) : /*#__PURE__*/_react.default.createElement("button", {
95
+ type: "button",
96
+ className: "gat--btn gat--btn__primary ".concat(selectedChoice.id !== undefined ? '' : 'disabled'),
97
+ onClick: function onClick() {
98
+ return onNext(selectedChoice);
99
+ }
100
+ }, translate('screens.continue'))));
94
101
  };
95
102
 
96
103
  var ComplexDecision = function ComplexDecision() {
@@ -113,6 +113,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
113
113
  hasRewards: resultChoice.rewards || [],
114
114
  failed: failed,
115
115
  inScene: inScene,
116
+ required: required,
116
117
  changeOption: function changeOption(option) {
117
118
  playSound('click-ui');
118
119
  setResultChoice(option);
@@ -193,18 +194,8 @@ var DecisionComponent = function DecisionComponent(_ref) {
193
194
  complex: true
194
195
  });
195
196
  } else if (!required) {
196
- emitEvent({
197
- type: 'addPoints',
198
- payload: choice.rewards,
199
- finish: true,
200
- complex: true,
201
- onFinish: _onFinish ? function () {
202
- return _onFinish(choice, function () {
203
- setResultChoice({});
204
- selectView('options');
205
- });
206
- } : null
207
- });
197
+ setResultChoice({});
198
+ selectView('options');
208
199
  }
209
200
  }
210
201
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.7.8",
5
+ "version": "1.7.9",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",