Updated on 2026-08-14
This commit is contained in:
parent
82fa3edf45
commit
30a8b87900
4 changed files with 22 additions and 8 deletions
|
|
@ -39,6 +39,7 @@ dependencies {
|
|||
/** Common */
|
||||
implementation(projects.common.ui)
|
||||
implementation(projects.common.routing)
|
||||
implementation(projects.common)
|
||||
|
||||
/** Tangem libraries */
|
||||
implementation(projects.libs.tangemSdkApi)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.features.createwalletselection
|
||||
|
||||
import com.tangem.common.TangemBlogUrlBuilder
|
||||
import com.tangem.common.routing.AppRoute
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.analytics.models.AnalyticsParam
|
||||
|
|
@ -84,6 +85,7 @@ internal class CreateWalletSelectionModel @Inject constructor(
|
|||
),
|
||||
onBuyClick = ::onBuyClick,
|
||||
shouldShowAlreadyHaveWallet = true,
|
||||
onWhatToChooseClick = ::onWhatToChooseClick,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -124,7 +126,14 @@ internal class CreateWalletSelectionModel @Inject constructor(
|
|||
private fun onBuyClick() {
|
||||
analyticsEventHandler.send(Basic.ButtonBuy(source = AnalyticsParam.ScreensSources.AddNewWallet))
|
||||
modelScope.launch {
|
||||
generateBuyTangemCardLinkUseCase.invoke().let { urlOpener.openUrl(it) }
|
||||
generateBuyTangemCardLinkUseCase
|
||||
.invoke(GenerateBuyTangemCardLinkUseCase.Source.Creation).let { urlOpener.openUrl(it) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun onWhatToChooseClick() {
|
||||
modelScope.launch {
|
||||
urlOpener.openUrl(TangemBlogUrlBuilder.build(TangemBlogUrlBuilder.Post.WhatWalletToChoose))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ internal data class CreateWalletSelectionUM(
|
|||
val blocks: ImmutableList<Block>,
|
||||
val onBackClick: () -> Unit,
|
||||
val onBuyClick: () -> Unit,
|
||||
val onWhatToChooseClick: () -> Unit,
|
||||
) {
|
||||
data class Block(
|
||||
val title: TextReference,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.components.SecondaryButton
|
||||
import com.tangem.core.ui.components.TextButton
|
||||
import com.tangem.core.ui.components.buttons.common.TangemButtonSize
|
||||
import com.tangem.core.ui.components.buttons.common.TangemButtonsDefaults
|
||||
import com.tangem.core.ui.components.label.Label
|
||||
import com.tangem.core.ui.components.label.entity.LabelStyle
|
||||
import com.tangem.core.ui.components.label.entity.LabelUM
|
||||
|
|
@ -61,14 +63,14 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
|||
},
|
||||
title = { },
|
||||
actions = {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.padding(16.dp),
|
||||
TextButton(
|
||||
modifier = Modifier.clip(TangemTheme.shapes.roundedCornersLarge),
|
||||
text = stringResourceSafe(R.string.wallet_add_support_title),
|
||||
style = TangemTheme.typography.body1,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
textStyle = TangemTheme.typography.body1,
|
||||
colors = TangemButtonsDefaults.defaultTextButtonColors.copy(
|
||||
contentColor = TangemTheme.colors.text.primary1,
|
||||
),
|
||||
onClick = state.onWhatToChooseClick,
|
||||
)
|
||||
},
|
||||
)
|
||||
|
|
@ -288,6 +290,7 @@ private fun PreviewCreateWalletContent() {
|
|||
),
|
||||
shouldShowAlreadyHaveWallet = true,
|
||||
onBuyClick = { },
|
||||
onWhatToChooseClick = { },
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue