For #27485 - Replace `Button` in `CustomizeHomeButtonViewHolder` with `TertiaryButton`

This commit is contained in:
Noah Bond 2022-11-01 10:16:46 -07:00 committed by mergify[bot]
parent 8857073e5b
commit a44d9ff8d9
1 changed files with 1 additions and 10 deletions

View File

@ -20,11 +20,9 @@ import mozilla.components.lib.state.ext.observeAsComposableState
import org.mozilla.fenix.R
import org.mozilla.fenix.components.components
import org.mozilla.fenix.compose.ComposeViewHolder
import org.mozilla.fenix.compose.button.Button
import org.mozilla.fenix.compose.button.TertiaryButton
import org.mozilla.fenix.home.sessioncontrol.CustomizeHomeIteractor
import org.mozilla.fenix.theme.FirefoxTheme
import org.mozilla.fenix.wallpapers.Wallpaper
import org.mozilla.fenix.wallpapers.WallpaperState
class CustomizeHomeButtonViewHolder(
@ -48,7 +46,6 @@ class CustomizeHomeButtonViewHolder(
val wallpaperState = components.appStore
.observeAsComposableState { state -> state.wallpaperState }.value ?: WallpaperState.default
var buttonColor: Color = FirefoxTheme.colors.actionTertiary
val textColor: Color = FirefoxTheme.colors.textActionTertiary
wallpaperState.composeRunIfWallpaperCardColorsAreAvailable { cardColorLight, cardColorDark ->
buttonColor = if (isSystemInDarkTheme()) {
@ -61,15 +58,9 @@ class CustomizeHomeButtonViewHolder(
Column {
Spacer(modifier = Modifier.height(68.dp))
/**
* This button will be stylized as a [TertiaryButton] when no wallpaper is selected.
* Otherwise, the background will use [Wallpaper.cardColorLight] or [Wallpaper.cardColorDark].
* */
Button(
TertiaryButton(
text = stringResource(R.string.browser_menu_customize_home_1),
textColor = textColor,
backgroundColor = buttonColor,
tint = FirefoxTheme.colors.iconActionTertiary,
onClick = interactor::openCustomizeHomePage,
)
}