Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-11 15:39:32 +05:00
parent 72d9b99348
commit de3bdb3cb0
18 changed files with 138 additions and 49 deletions

View file

@ -25,6 +25,7 @@ import com.tangem.core.ui.components.Keyboard
import com.tangem.core.ui.components.buttons.common.TangemButton
import com.tangem.core.ui.components.buttons.common.TangemButtonIconPosition
import com.tangem.core.ui.components.buttons.common.TangemButtonsDefaults
import com.tangem.core.ui.components.buttons.common.contentColor
import com.tangem.core.ui.components.keyboardAsState
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.isNullOrEmpty
@ -73,12 +74,18 @@ fun NavigationPrimaryButton(primaryButton: NavigationButton?, modifier: Modifier
} else {
TangemButtonIconPosition.None
}
val color = if (button.isDimmed) {
TangemButtonsDefaults.secondaryButtonColors
.copy(contentColor = TangemTheme.colors.text.tertiary)
} else {
TangemButtonsDefaults.primaryButtonColors
}
TangemButton(
text = button.textReference.resolveReference(),
enabled = button.isEnabled,
onClick = button.onClick,
showProgress = button.showProgress,
colors = TangemButtonsDefaults.primaryButtonColors,
colors = color,
textStyle = TangemTheme.typography.subtitle1,
icon = icon,
modifier = Modifier.fillMaxWidth(),

View file

@ -16,6 +16,17 @@ sealed class NavigationButtonsState {
) : NavigationButtonsState()
}
/**
* @property textReference text
* @property iconRes icon resource id
* @property isSecondary should set secondary color scheme
* @property isIconVisible determines whether icon is visible
* @property showProgress indicates progress state of button
* @property isEnabled enabled
* @property isDimmed determines whether the button content will be dimmed.
* This property will be ignored if [isEnabled] is `false`.
* @property onClick lambda be invoked when action component is clicked
*/
data class NavigationButton(
val textReference: TextReference,
@DrawableRes val iconRes: Int? = null,
@ -23,5 +34,6 @@ data class NavigationButton(
val isIconVisible: Boolean = false,
val showProgress: Boolean = false,
val isEnabled: Boolean = true,
val isDimmed: Boolean = false,
val onClick: () -> Unit,
)