allaw-ui 0.0.334 → 0.0.335

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.
@@ -46,9 +46,9 @@ var OAuthProviderButton = function (_a) {
46
46
  }
47
47
  };
48
48
  var updateLabel = function () {
49
- var _a;
50
- var _b = getLabels(), labels = _b.labels, shortLabels = _b.shortLabels;
51
- var maxWidth = ((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
49
+ var _a, _b;
50
+ var _c = getLabels(), labels = _c.labels, shortLabels = _c.shortLabels;
51
+ var maxWidth = (_b = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0;
52
52
  var thresholdWidth = getThresholdWidth(size);
53
53
  var newLabel = maxWidth < thresholdWidth
54
54
  ? shortLabels[provider]
@@ -68,6 +68,12 @@ var OAuthProviderButton = function (_a) {
68
68
  }
69
69
  };
70
70
  }, [provider, type, size]);
71
+ // Force an update after the first render to ensure the correct label is set
72
+ useEffect(function () {
73
+ if (buttonRef.current) {
74
+ updateLabel();
75
+ }
76
+ }, []);
71
77
  var renderIcon = function () {
72
78
  var iconSizes = {
73
79
  google: size * 0.8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "0.0.334",
3
+ "version": "0.0.335",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",