@micromag/screen-survey 0.3.78 → 0.3.81

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 (3) hide show
  1. package/es/index.js +15 -16
  2. package/lib/index.js +15 -16
  3. package/package.json +13 -13
package/es/index.js CHANGED
@@ -247,21 +247,20 @@ var SurveyScreen = function SurveyScreen(_ref) {
247
247
  useEffect(function () {
248
248
  if (answers === null || isPlaceholder) {
249
249
  return;
250
- }
251
-
252
- var maxWidth = answers.reduce(function (currentMaxWidth, answer, answerI) {
253
- var button = buttonsRefs.current[answerI] || null;
254
- var label = labelsRefs.current[answerI] || null;
255
-
256
- if (button !== null && label !== null) {
257
- var borderWidth = button.offsetWidth - button.clientWidth;
258
- var totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
259
- return Math.max(currentMaxWidth, totalWidth);
260
- }
261
-
262
- return currentMaxWidth;
263
- }, 0);
264
- setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
250
+ } // const maxWidth = answers.reduce((currentMaxWidth, answer, answerI) => {
251
+ // const button = buttonsRefs.current[answerI] || null;
252
+ // const label = labelsRefs.current[answerI] || null;
253
+ // if (button !== null && label !== null) {
254
+ // const borderWidth = button.offsetWidth - button.clientWidth;
255
+ // const totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
256
+ // return Math.max(currentMaxWidth, totalWidth);
257
+ // }
258
+ // return currentMaxWidth;
259
+ // }, 0);
260
+ // setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
261
+
262
+
263
+ setButtonMaxWidth(width * 0.75);
265
264
  setReady(true);
266
265
  }, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
267
266
 
@@ -337,7 +336,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
337
336
  }, /*#__PURE__*/React.createElement("div", {
338
337
  className: styles.itemInner,
339
338
  style: {
340
- width: answered && !withoutResults ? buttonMaxWidth : null,
339
+ width: buttonMaxWidth,
341
340
  transitionDuration: finalTransitionDuration
342
341
  }
343
342
  }, /*#__PURE__*/React.createElement(Button, {
package/lib/index.js CHANGED
@@ -268,21 +268,20 @@ var SurveyScreen = function SurveyScreen(_ref) {
268
268
  React.useEffect(function () {
269
269
  if (answers === null || isPlaceholder) {
270
270
  return;
271
- }
272
-
273
- var maxWidth = answers.reduce(function (currentMaxWidth, answer, answerI) {
274
- var button = buttonsRefs.current[answerI] || null;
275
- var label = labelsRefs.current[answerI] || null;
276
-
277
- if (button !== null && label !== null) {
278
- var borderWidth = button.offsetWidth - button.clientWidth;
279
- var totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
280
- return Math.max(currentMaxWidth, totalWidth);
281
- }
282
-
283
- return currentMaxWidth;
284
- }, 0);
285
- setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
271
+ } // const maxWidth = answers.reduce((currentMaxWidth, answer, answerI) => {
272
+ // const button = buttonsRefs.current[answerI] || null;
273
+ // const label = labelsRefs.current[answerI] || null;
274
+ // if (button !== null && label !== null) {
275
+ // const borderWidth = button.offsetWidth - button.clientWidth;
276
+ // const totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
277
+ // return Math.max(currentMaxWidth, totalWidth);
278
+ // }
279
+ // return currentMaxWidth;
280
+ // }, 0);
281
+ // setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
282
+
283
+
284
+ setButtonMaxWidth(width * 0.75);
286
285
  setReady(true);
287
286
  }, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
288
287
 
@@ -358,7 +357,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
358
357
  }, /*#__PURE__*/React__default["default"].createElement("div", {
359
358
  className: styles.itemInner,
360
359
  style: {
361
- width: answered && !withoutResults ? buttonMaxWidth : null,
360
+ width: buttonMaxWidth,
362
361
  transitionDuration: finalTransitionDuration
363
362
  }
364
363
  }, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-survey",
3
- "version": "0.3.78",
3
+ "version": "0.3.81",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,17 +49,17 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.78",
53
- "@micromag/data": "^0.3.78",
54
- "@micromag/element-background": "^0.3.78",
55
- "@micromag/element-button": "^0.3.78",
56
- "@micromag/element-call-to-action": "^0.3.78",
57
- "@micromag/element-container": "^0.3.78",
58
- "@micromag/element-heading": "^0.3.78",
59
- "@micromag/element-layout": "^0.3.78",
60
- "@micromag/element-scroll": "^0.3.78",
61
- "@micromag/element-text": "^0.3.78",
62
- "@micromag/transforms": "^0.3.78",
52
+ "@micromag/core": "^0.3.81",
53
+ "@micromag/data": "^0.3.81",
54
+ "@micromag/element-background": "^0.3.81",
55
+ "@micromag/element-button": "^0.3.81",
56
+ "@micromag/element-call-to-action": "^0.3.81",
57
+ "@micromag/element-container": "^0.3.81",
58
+ "@micromag/element-heading": "^0.3.81",
59
+ "@micromag/element-layout": "^0.3.81",
60
+ "@micromag/element-scroll": "^0.3.81",
61
+ "@micromag/element-text": "^0.3.81",
62
+ "@micromag/transforms": "^0.3.81",
63
63
  "classnames": "^2.2.6",
64
64
  "lodash": "^4.17.21",
65
65
  "prop-types": "^15.7.2",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "68be4e95203a5c15cefe58e423fe43eb374f3a7f"
72
+ "gitHead": "4fec1502a42a4813cc39e24de20c6cd47134cc62"
73
73
  }