From afa524bba38486f0989cb735895e251a1d11b20a Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Sun, 23 Oct 2022 00:54:36 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/27584 - Replace Button in RecentSyncedTab with SecondaryButton --- .../main/java/org/mozilla/fenix/compose/button/Button.kt | 8 ++++++-- .../fenix/home/recentsyncedtabs/view/RecentSyncedTab.kt | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/compose/button/Button.kt b/app/src/main/java/org/mozilla/fenix/compose/button/Button.kt index d9a5e691b6..22c4a52554 100644 --- a/app/src/main/java/org/mozilla/fenix/compose/button/Button.kt +++ b/app/src/main/java/org/mozilla/fenix/compose/button/Button.kt @@ -102,19 +102,23 @@ fun PrimaryButton( * Secondary button. * * @param text The button text to be displayed. + * @param textColor [Color] to apply to the button text. + * @param backgroundColor The background [Color] of the button. * @param icon Optional [Painter] used to display an [Icon] before the button text. * @param onClick Invoked when the user clicks on the button. */ @Composable fun SecondaryButton( text: String, + textColor: Color = FirefoxTheme.colors.textActionSecondary, + backgroundColor: Color = FirefoxTheme.colors.actionSecondary, icon: Painter? = null, onClick: () -> Unit, ) { Button( text = text, - textColor = FirefoxTheme.colors.textActionSecondary, - backgroundColor = FirefoxTheme.colors.actionSecondary, + textColor = textColor, + backgroundColor = backgroundColor, icon = icon, tint = FirefoxTheme.colors.iconActionSecondary, onClick = onClick, diff --git a/app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/view/RecentSyncedTab.kt b/app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/view/RecentSyncedTab.kt index 32471d3aef..c0f8a7c144 100644 --- a/app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/view/RecentSyncedTab.kt +++ b/app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/view/RecentSyncedTab.kt @@ -48,7 +48,7 @@ import mozilla.components.support.ktx.kotlin.trimmed import org.mozilla.fenix.R import org.mozilla.fenix.compose.Image import org.mozilla.fenix.compose.ThumbnailCard -import org.mozilla.fenix.compose.button.Button +import org.mozilla.fenix.compose.button.SecondaryButton import org.mozilla.fenix.home.recentsyncedtabs.RecentSyncedTab import org.mozilla.fenix.home.recenttabs.RecentTab import org.mozilla.fenix.theme.FirefoxTheme @@ -179,7 +179,7 @@ fun RecentSyncedTab( Spacer(modifier = Modifier.height(32.dp)) - Button( + SecondaryButton( text = if (tab != null) { stringResource(R.string.recent_tabs_see_all_synced_tabs_button_text) } else { @@ -187,7 +187,6 @@ fun RecentSyncedTab( }, textColor = buttonTextColor, backgroundColor = buttonBackgroundColor, - tint = FirefoxTheme.colors.iconActionSecondary, onClick = onSeeAllSyncedTabsButtonClick, ) }