Updated on 2026-08-14

This commit is contained in:
Tangem 2026-04-27 21:10:26 +04:00
parent b004f8df6b
commit 1964b3cfad
22 changed files with 204 additions and 173 deletions

View file

@ -96,6 +96,7 @@ import com.tangem.feature.swap.utils.getContractAddress
import com.tangem.features.approval.api.GiveApprovalComponent
import com.tangem.features.send.v2.api.entity.FeeSelectorUM
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorReloadTrigger
import com.tangem.common.TangemBlogUrlBuilder
import com.tangem.features.swap.SwapComponent
import com.tangem.utils.Provider
import com.tangem.utils.coroutines.*
@ -1357,12 +1358,16 @@ internal class SwapModel @Inject constructor(
val selectedFee = (getSelectedFee() as? TxFee.Legacy)?.feeType ?: FeeType.NORMAL
val txFeeState =
dataState.getCurrentLoadedSwapState()?.txFee as? TxFeeState.MultipleFeeState ?: return@UiActions
uiState = stateBuilder.showSelectFeeBottomSheet(
uiState = uiState,
selectedFee = selectedFee,
txFeeState = txFeeState,
) {
uiState = stateBuilder.dismissBottomSheet(uiState)
modelScope.launch {
val readMoreUrl = TangemBlogUrlBuilder.build(TangemBlogUrlBuilder.Post.WhatIsTransactionFee)
uiState = stateBuilder.showSelectFeeBottomSheet(
uiState = uiState,
selectedFee = selectedFee,
txFeeState = txFeeState,
readMoreUrl = readMoreUrl,
) {
uiState = stateBuilder.dismissBottomSheet(uiState)
}
}
},
onSelectFeeType = { txFee ->

View file

@ -37,7 +37,6 @@ import com.tangem.utils.Provider
import com.tangem.utils.StringsSigns
import com.tangem.utils.StringsSigns.DASH_SIGN
import com.tangem.utils.StringsSigns.TILDE_SIGN
import com.tangem.utils.TangemBlogUrlBuilder.FEE_BLOG_LINK
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
@ -984,6 +983,7 @@ internal class StateBuilder(
uiState: SwapStateHolder,
selectedFee: FeeType,
txFeeState: TxFeeState.MultipleFeeState,
readMoreUrl: String,
onDismiss: () -> Unit,
): SwapStateHolder {
val config = ChooseFeeBottomSheetConfig(
@ -995,7 +995,7 @@ internal class StateBuilder(
}
actions.onSelectFeeType.invoke(selectedItem)
},
readMoreUrl = FEE_BLOG_LINK,
readMoreUrl = readMoreUrl,
feeItems = txFeeState.toFeeItemState(),
readMore = resourceReference(R.string.common_read_more),
onReadMoreClick = actions.onLinkClick,