allaw-ui 4.5.1 → 4.5.2
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.
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
gap: 15px;
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
min-width: 210px;
|
|
10
|
+
max-width: 100%;
|
|
10
11
|
border-radius: 10px;
|
|
11
12
|
padding: 6px;
|
|
13
|
+
box-sizing: border-box;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
.oauth-provider-button:hover {
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
|
|
22
24
|
.oauth-provider-button.google {
|
|
23
25
|
width: 100%;
|
|
26
|
+
max-width: 100%;
|
|
24
27
|
background: #ffffff;
|
|
25
28
|
box-shadow: 0px 2px 3px 0px #0000002b, 0px 0px 3px 0px #00000015;
|
|
26
29
|
}
|
|
@@ -39,11 +42,13 @@
|
|
|
39
42
|
.oauth-provider-button.apple {
|
|
40
43
|
background: #000000;
|
|
41
44
|
width: 100%;
|
|
45
|
+
max-width: 100%;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
.oauth-provider-button.linkedin {
|
|
45
49
|
background: #0a66c2;
|
|
46
50
|
width: 100%;
|
|
51
|
+
max-width: 100%;
|
|
47
52
|
padding-left: 10px;
|
|
48
53
|
padding-right: 10px;
|
|
49
54
|
}
|
|
@@ -99,6 +104,7 @@
|
|
|
99
104
|
|
|
100
105
|
.oauth-provider-button.microsoft {
|
|
101
106
|
width: 100%;
|
|
107
|
+
max-width: 100%;
|
|
102
108
|
background: #ffffff;
|
|
103
109
|
box-shadow: 0px 2px 3px 0px #0000002b, 0px 0px 3px 0px #00000015;
|
|
104
110
|
font-family: Roboto;
|
|
@@ -59,19 +59,33 @@ var OAuthProviderButton = function (_a) {
|
|
|
59
59
|
}, 50);
|
|
60
60
|
return function () { return clearTimeout(timer); };
|
|
61
61
|
}, []);
|
|
62
|
+
// Ajouter un useEffect pour surveiller les changements de taille
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
var handleResize = function () {
|
|
65
|
+
updateLabel();
|
|
66
|
+
};
|
|
67
|
+
window.addEventListener("resize", handleResize);
|
|
68
|
+
return function () { return window.removeEventListener("resize", handleResize); };
|
|
69
|
+
}, [size, type, provider]);
|
|
62
70
|
var updateLabel = function () {
|
|
63
71
|
var _a = getLabels(), labels = _a.labels, shortLabels = _a.shortLabels;
|
|
64
72
|
var thresholdWidth = getThresholdWidth(size);
|
|
65
73
|
if (buttonRef.current) {
|
|
66
74
|
var buttonWidth = buttonRef.current.offsetWidth;
|
|
75
|
+
// Debug: afficher les valeurs pour diagnostiquer
|
|
76
|
+
console.log("Button width:", buttonWidth, "Threshold:", thresholdWidth, "Size:", size);
|
|
77
|
+
// Toujours utiliser le label complet au début
|
|
67
78
|
if (!label) {
|
|
68
79
|
setLabel(labels[type][provider]);
|
|
69
80
|
return;
|
|
70
81
|
}
|
|
82
|
+
// Vérifier si on doit passer aux shortLabels
|
|
71
83
|
if (buttonWidth < thresholdWidth) {
|
|
84
|
+
console.log("Using short label for", provider);
|
|
72
85
|
setLabel(shortLabels[provider]);
|
|
73
86
|
}
|
|
74
87
|
else {
|
|
88
|
+
console.log("Using full label for", provider);
|
|
75
89
|
setLabel(labels[type][provider]);
|
|
76
90
|
}
|
|
77
91
|
}
|