@gamelearn/arcade-components 0.22.6 → 0.22.7
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.
|
@@ -41,7 +41,6 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
41
41
|
visible = _ref.visible,
|
|
42
42
|
documentType = _ref.documentType,
|
|
43
43
|
viewed = _ref.viewed,
|
|
44
|
-
btnText = _ref.btnText,
|
|
45
44
|
soundActions = _ref.soundActions;
|
|
46
45
|
|
|
47
46
|
var _useState = (0, _react.useState)(),
|
|
@@ -66,6 +65,13 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
66
65
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
67
66
|
playSound = _soundActions[0];
|
|
68
67
|
|
|
68
|
+
var translate = function translate(id) {
|
|
69
|
+
return emitEvent({
|
|
70
|
+
type: 'translate',
|
|
71
|
+
payload: id
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
69
75
|
var close = (0, _react.useCallback)(function () {
|
|
70
76
|
playSound('click-ui');
|
|
71
77
|
|
|
@@ -125,7 +131,7 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
125
131
|
close: close,
|
|
126
132
|
minutes: minutes,
|
|
127
133
|
seconds: seconds,
|
|
128
|
-
btnText:
|
|
134
|
+
btnText: translate('screens.continue')
|
|
129
135
|
}) : null));
|
|
130
136
|
};
|
|
131
137
|
|
|
@@ -137,8 +143,7 @@ LecturesComponent.defaultProps = {
|
|
|
137
143
|
documentType: '',
|
|
138
144
|
viewed: false,
|
|
139
145
|
required: false,
|
|
140
|
-
context: {}
|
|
141
|
-
btnText: 'continue'
|
|
146
|
+
context: {}
|
|
142
147
|
};
|
|
143
148
|
var _default = LecturesComponent;
|
|
144
149
|
exports.default = _default;
|
|
@@ -5,8 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.mockProps = void 0;
|
|
7
7
|
|
|
8
|
-
var emitEvent = function emitEvent() {
|
|
9
|
-
|
|
8
|
+
var emitEvent = function emitEvent(_ref) {
|
|
9
|
+
var type = _ref.type,
|
|
10
|
+
payload = _ref.payload;
|
|
11
|
+
console.log('Emit event called', type, payload);
|
|
12
|
+
|
|
13
|
+
if (type === 'translate') {
|
|
14
|
+
return mockProps.messages[payload];
|
|
15
|
+
}
|
|
10
16
|
};
|
|
11
17
|
|
|
12
18
|
var mockProps = {
|
|
@@ -18,6 +24,8 @@ var mockProps = {
|
|
|
18
24
|
visible: true,
|
|
19
25
|
documentType: 'text',
|
|
20
26
|
viewed: false,
|
|
21
|
-
|
|
27
|
+
messages: {
|
|
28
|
+
"screens.continue": "Continuar"
|
|
29
|
+
}
|
|
22
30
|
};
|
|
23
31
|
exports.mockProps = mockProps;
|