Skip to content

Commit b2050d8

Browse files
committed
chore: add button examples in Preview
1 parent d0c81d6 commit b2050d8

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Row
88
import androidx.compose.foundation.layout.Spacer
99
import androidx.compose.foundation.layout.fillMaxSize
1010
import androidx.compose.foundation.layout.width
11+
import androidx.compose.foundation.shape.RoundedCornerShape
1112
import androidx.compose.material.icons.Icons
1213
import androidx.compose.material.icons.filled.Star
1314
import androidx.compose.material3.Button
@@ -231,7 +232,7 @@ private fun PreviewAuthProviderButton() {
231232
providerId = "google.com",
232233
scopes = emptyList(),
233234
customParameters = emptyMap(),
234-
buttonLabel = "Sign in with Generic",
235+
buttonLabel = "Generic Provider",
235236
buttonIcon = AuthUIAsset.Vector(Icons.Default.Star),
236237
buttonColor = Color.Gray,
237238
contentColor = Color.White
@@ -240,20 +241,32 @@ private fun PreviewAuthProviderButton() {
240241
stringProvider = DefaultAuthUIStringProvider(context)
241242
)
242243
AuthProviderButton(
243-
provider = AuthProvider.Google(
244+
provider = AuthProvider.GenericOAuth(
245+
providerId = "google.com",
244246
scopes = emptyList(),
245-
serverClientId = null
247+
customParameters = emptyMap(),
248+
buttonLabel = "Custom Style",
249+
buttonIcon = AuthUIAsset.Vector(Icons.Default.Star),
250+
buttonColor = Color.Gray,
251+
contentColor = Color.White
246252
),
247253
onClick = {},
248-
style = AuthUITheme.Default.providerStyles[Provider.MICROSOFT.id],
254+
style = AuthUITheme.ProviderStyle(
255+
icon = AuthUITheme.Default.providerStyles[Provider.MICROSOFT.id]?.icon,
256+
backgroundColor = AuthUITheme.Default.providerStyles[Provider.MICROSOFT.id]!!.backgroundColor,
257+
contentColor = AuthUITheme.Default.providerStyles[Provider.MICROSOFT.id]!!.contentColor,
258+
iconTint = Color.Red,
259+
shape = RoundedCornerShape(24.dp),
260+
elevation = 6.dp
261+
),
249262
stringProvider = DefaultAuthUIStringProvider(context)
250263
)
251264
AuthProviderButton(
252265
provider = AuthProvider.GenericOAuth(
253266
providerId = "unknown_provider",
254267
scopes = emptyList(),
255268
customParameters = emptyMap(),
256-
buttonLabel = "Sign in with Lego",
269+
buttonLabel = "Unsupported Provider",
257270
buttonIcon = null,
258271
buttonColor = null,
259272
contentColor = null,

0 commit comments

Comments
 (0)