Updated on 2026-08-14
This commit is contained in:
parent
575081de3e
commit
49aede77dc
11 changed files with 67 additions and 68 deletions
|
|
@ -12,4 +12,5 @@ internal data class TonInitializeAccountBottomSheetConfig(
|
|||
val isButtonEnabled: Boolean,
|
||||
val isButtonLoading: Boolean,
|
||||
val feeState: FeeState,
|
||||
val isColdWalletInteractionIconVisible: Boolean,
|
||||
) : TangemBottomSheetConfigContent
|
||||
|
|
@ -25,6 +25,7 @@ internal class ShowTonInitializeBottomSheetTransformer(
|
|||
isButtonEnabled = false,
|
||||
feeState = FeeState.Loading,
|
||||
isButtonLoading = false,
|
||||
isColdWalletInteractionIconVisible = prevState.isColdWalletInteractionIconVisible,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -101,23 +101,32 @@ internal fun TonInitializeAccountBottomSheet(config: TangemBottomSheetConfig) {
|
|||
|
||||
SpacerH(height = 20.dp)
|
||||
|
||||
TangemButton(
|
||||
text = stringResourceSafe(R.string.common_activate),
|
||||
icon = TangemButtonIconPosition.End(iconResId = R.drawable.ic_tangem_24),
|
||||
onClick = content.onButtonClick,
|
||||
colors = TangemButtonsDefaults.primaryButtonColors,
|
||||
showProgress = content.feeState is FeeState.Loading || content.isButtonLoading,
|
||||
enabled = content.isButtonEnabled,
|
||||
size = TangemButtonSize.WideAction,
|
||||
textStyle = TangemTheme.typography.subtitle1,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
ActivateButton(content)
|
||||
|
||||
SpacerH(height = 8.dp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ActivateButton(content: TonInitializeAccountBottomSheetConfig, modifier: Modifier = Modifier) {
|
||||
TangemButton(
|
||||
text = stringResourceSafe(R.string.common_activate),
|
||||
icon = if (content.isColdWalletInteractionIconVisible) {
|
||||
TangemButtonIconPosition.End(iconResId = R.drawable.ic_tangem_24)
|
||||
} else {
|
||||
TangemButtonIconPosition.None
|
||||
},
|
||||
onClick = content.onButtonClick,
|
||||
colors = TangemButtonsDefaults.primaryButtonColors,
|
||||
showProgress = content.feeState is FeeState.Loading || content.isButtonLoading,
|
||||
enabled = content.isButtonEnabled,
|
||||
size = TangemButtonSize.WideAction,
|
||||
textStyle = TangemTheme.typography.subtitle1,
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
|
||||
// region Preview
|
||||
@Composable
|
||||
@Preview(showBackground = true, widthDp = 360)
|
||||
|
|
@ -149,6 +158,7 @@ private fun Preview_TonInitializeAccountBottomSheetContent() {
|
|||
isFeeApproximate = false,
|
||||
isFeeConvertibleToFiat = true,
|
||||
),
|
||||
isColdWalletInteractionIconVisible = true,
|
||||
),
|
||||
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue