allaw-ui 0.0.333 → 0.0.334

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.
@@ -56,16 +56,18 @@ var OAuthProviderButton = function (_a) {
56
56
  setLabel(newLabel);
57
57
  };
58
58
  useEffect(function () {
59
- updateLabel();
60
- window.addEventListener("resize", updateLabel);
59
+ var resizeObserver = new ResizeObserver(function () {
60
+ updateLabel();
61
+ });
62
+ if (buttonRef.current) {
63
+ resizeObserver.observe(buttonRef.current);
64
+ }
61
65
  return function () {
62
- window.removeEventListener("resize", updateLabel);
66
+ if (buttonRef.current) {
67
+ resizeObserver.unobserve(buttonRef.current);
68
+ }
63
69
  };
64
70
  }, [provider, type, size]);
65
- // Force an update after the first render to ensure the correct label is set
66
- useEffect(function () {
67
- setTimeout(updateLabel, 0);
68
- }, []);
69
71
  var renderIcon = function () {
70
72
  var iconSizes = {
71
73
  google: size * 0.8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "0.0.333",
3
+ "version": "0.0.334",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",