Updated on 2026-08-14
This commit is contained in:
parent
a66b1bfb14
commit
04c90d11db
5 changed files with 35 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import com.tangem.feature.usedesk.api.UsedeskComponent
|
|||
import com.tangem.feature.walletsettings.component.WalletSettingsComponent
|
||||
import com.tangem.features.details.component.DetailsComponent
|
||||
import com.tangem.features.disclaimer.api.components.DisclaimerComponent
|
||||
import com.tangem.features.managetokens.component.ChooseManagedTokensComponent
|
||||
import com.tangem.features.managetokens.component.ManageTokensComponent
|
||||
import com.tangem.features.managetokens.component.ManageTokensSource
|
||||
import com.tangem.features.markets.details.MarketsTokenDetailsComponent
|
||||
|
|
@ -78,6 +79,7 @@ internal class ChildFactory @Inject constructor(
|
|||
private val nftComponentFactory: NFTComponent.Factory,
|
||||
private val nftSendComponentFactory: NFTSendComponent.Factory,
|
||||
private val usedeskComponentFactory: UsedeskComponent.Factory,
|
||||
private val chooseManagedTokensComponentFactory: ChooseManagedTokensComponent.Factory,
|
||||
private val testerRouter: TesterRouter,
|
||||
private val walletConnectFeatureToggles: WalletConnectFeatureToggles,
|
||||
) {
|
||||
|
|
@ -407,6 +409,17 @@ internal class ChildFactory @Inject constructor(
|
|||
componentFactory = usedeskComponentFactory,
|
||||
)
|
||||
}
|
||||
is AppRoute.ChooseManagedTokens -> {
|
||||
createComponentChild(
|
||||
context = context,
|
||||
params = ChooseManagedTokensComponent.Params(
|
||||
userWalletId = route.userWalletId,
|
||||
initialCurrency = route.initialCurrency,
|
||||
source = ChooseManagedTokensComponent.Source.valueOf(route.source.name),
|
||||
),
|
||||
componentFactory = chooseManagedTokensComponentFactory,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,6 +127,16 @@ sealed class AppRoute(val path: String) : Route {
|
|||
}
|
||||
}
|
||||
|
||||
data class ChooseManagedTokens(
|
||||
val userWalletId: UserWalletId,
|
||||
val initialCurrency: CryptoCurrency,
|
||||
val source: Source,
|
||||
) : AppRoute(path = "/$source/choose_managed_tokens/$userWalletId/${initialCurrency.id.value}") {
|
||||
enum class Source {
|
||||
SendViaSwap,
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class WalletConnectSessions(val userWalletId: UserWalletId) : AppRoute(path = "/wallet_connect_sessions")
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,14 @@ import com.tangem.domain.tokens.model.CryptoCurrencyStatus
|
|||
data class SwapCurrencies(
|
||||
val fromGroup: SwapCurrenciesGroup,
|
||||
val toGroup: SwapCurrenciesGroup,
|
||||
)
|
||||
) {
|
||||
companion object {
|
||||
val EMPTY = SwapCurrencies(
|
||||
fromGroup = SwapCurrenciesGroup(emptyList(), emptyList(), false),
|
||||
toGroup = SwapCurrenciesGroup(emptyList(), emptyList(), false),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return swap group depending on [swapDirection]
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ dependencies {
|
|||
implementation(projects.domain.manageTokens)
|
||||
implementation(projects.domain.transaction.models)
|
||||
implementation(projects.domain.transaction)
|
||||
implementation(projects.domain.legacy)
|
||||
|
||||
/** Compose */
|
||||
implementation(deps.compose.foundation)
|
||||
|
|
|
|||
|
|
@ -21,9 +21,6 @@ internal class SwapChooseProviderModel @Inject constructor(
|
|||
|
||||
private val params: SwapChooseProviderComponent.Params = paramsContainer.require()
|
||||
|
||||
val uiState: StateFlow<SwapChooseProviderBottomSheetContent>
|
||||
field: MutableStateFlow<SwapChooseProviderBottomSheetContent> = MutableStateFlow(getInitialState())
|
||||
|
||||
private val swapProviderListItemConverter by lazy(LazyThreadSafetyMode.NONE) {
|
||||
SwapProviderListItemConverter(
|
||||
cryptoCurrency = params.cryptoCurrency,
|
||||
|
|
@ -31,6 +28,9 @@ internal class SwapChooseProviderModel @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
val uiState: StateFlow<SwapChooseProviderBottomSheetContent>
|
||||
field: MutableStateFlow<SwapChooseProviderBottomSheetContent> = MutableStateFlow(getInitialState())
|
||||
|
||||
fun onProviderClick(quoteUM: SwapQuoteUM) {
|
||||
params.callback.onProviderResult(quoteUM)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue