Skip to content

Commit 3aac4f9

Browse files
committed
feat: use providerStyle elevation, iconTint and shape
1 parent 9bc2793 commit 3aac4f9

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

auth/src/main/java/com/firebase/ui/auth/compose/AuthProviderButton.kt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.firebase.ui.auth.compose
22

33
import androidx.compose.foundation.Image
4+
import androidx.compose.material3.Icon
45
import androidx.compose.foundation.layout.Arrangement
56
import androidx.compose.foundation.layout.Column
67
import androidx.compose.foundation.layout.Row
@@ -69,17 +70,31 @@ fun AuthProviderButton(
6970
containerColor = providerStyle.backgroundColor,
7071
contentColor = providerStyle.contentColor,
7172
),
73+
shape = providerStyle.shape,
74+
elevation = ButtonDefaults.buttonElevation(
75+
defaultElevation = providerStyle.elevation
76+
),
7277
onClick = onClick,
7378
enabled = enabled,
7479
) {
7580
Row(
7681
verticalAlignment = Alignment.CenterVertically
7782
) {
78-
if (providerStyle.icon != null) {
79-
Image(
80-
painter = providerStyle.icon.painter,
81-
contentDescription = providerText
82-
)
83+
val providerIcon = providerStyle.icon
84+
if (providerIcon != null) {
85+
val iconTint = providerStyle.iconTint
86+
if (iconTint != null) {
87+
Icon(
88+
painter = providerIcon.painter,
89+
contentDescription = providerText,
90+
tint = iconTint
91+
)
92+
} else {
93+
Image(
94+
painter = providerIcon.painter,
95+
contentDescription = providerText
96+
)
97+
}
8398
Spacer(modifier = Modifier.width(8.dp))
8499
}
85100
Text(

0 commit comments

Comments
 (0)