Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-25 20:05:09 +04:00
parent 9617fd5777
commit c0a62e73e5
6 changed files with 0 additions and 50 deletions

View file

@ -123,7 +123,6 @@ internal object WalletScreenPreviewData {
),
bottomSheetConfig = null,
tokensListState = contentTokensState,
manageTokensButtonConfig = ManageTokensButtonConfig(onClick = {}),
)
}

View file

@ -1,3 +0,0 @@
package com.tangem.feature.wallet.presentation.wallet.state.model
internal data class ManageTokensButtonConfig(val onClick: () -> Unit)

View file

@ -20,7 +20,6 @@ internal sealed interface WalletState : WalletStateHolder {
sealed class MultiCurrency : WalletState {
abstract val tokensListState: WalletTokensListState
abstract val manageTokensButtonConfig: ManageTokensButtonConfig?
data class Content(
override val pullToRefreshConfig: PullToRefreshConfig,
@ -28,7 +27,6 @@ internal sealed interface WalletState : WalletStateHolder {
override val warnings: ImmutableList<WalletNotification>,
override val bottomSheetConfig: TangemBottomSheetConfig?,
override val tokensListState: WalletTokensListState,
override val manageTokensButtonConfig: ManageTokensButtonConfig?,
) : MultiCurrency()
data class Locked(
@ -43,7 +41,6 @@ internal sealed interface WalletState : WalletStateHolder {
) {
override val tokensListState = WalletTokensListState.ContentState.Locked
override val manageTokensButtonConfig = null
}
}

View file

@ -1,10 +1,8 @@
package com.tangem.feature.wallet.presentation.wallet.state.transformers
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.tokens.model.TokenList
import com.tangem.domain.wallets.models.UserWallet
import com.tangem.feature.wallet.presentation.wallet.state.model.ManageTokensButtonConfig
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletCardState
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletState
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletTokensListState
@ -26,7 +24,6 @@ internal class SetTokenListTransformer(
prevState.copy(
walletCardState = prevState.walletCardState.toLoadedState(),
tokensListState = prevState.tokensListState.toLoadedState(),
manageTokensButtonConfig = createManageTokensButtonConfig(),
)
}
is WalletState.MultiCurrency.Locked -> {
@ -58,12 +55,4 @@ internal class SetTokenListTransformer(
clickIntents = clickIntents,
).convert(value = this)
}
private fun createManageTokensButtonConfig(): ManageTokensButtonConfig? {
return if (userWallet.scanResponse.cardTypesResolver.isSingleWalletWithToken()) {
null
} else {
ManageTokensButtonConfig(clickIntents::onManageTokensClick)
}
}
}

View file

@ -35,7 +35,6 @@ internal class WalletLoadingStateFactory(private val clickIntents: WalletClickIn
warnings = persistentListOf(),
bottomSheetConfig = null,
tokensListState = WalletTokensListState.ContentState.Loading,
manageTokensButtonConfig = ManageTokensButtonConfig(clickIntents::onManageTokensClick),
)
}

View file

@ -46,7 +46,6 @@ import androidx.compose.ui.unit.dp
import androidx.paging.compose.collectAsLazyPagingItems
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.tangem.core.ui.components.BottomFade
import com.tangem.core.ui.components.PrimaryButton
import com.tangem.core.ui.components.atoms.Hand
import com.tangem.core.ui.components.atoms.handComposableComponentHeight
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
@ -294,25 +293,6 @@ private fun BaseScaffold(
modifier = Modifier.padding(bottom = TangemTheme.dimens.spacing16),
)
},
floatingActionButton = {
val manageTokensButtonConfig by rememberUpdatedState(
newValue = (state.wallets[state.selectedWalletIndex] as? WalletState.MultiCurrency)
?.manageTokensButtonConfig,
)
AnimatedVisibility(
visible = manageTokensButtonConfig != null,
enter = fadeIn(),
exit = fadeOut(),
) {
val config = manageTokensButtonConfig ?: return@AnimatedVisibility
ManageTokensButton(
modifier = Modifier.navigationBarsPadding(),
onClick = config.onClick,
)
}
},
floatingActionButtonPosition = FabPosition.Center,
containerColor = TangemTheme.colors.background.secondary,
content = {
@ -759,17 +739,6 @@ private fun WalletSnackbarHost(
}
}
@Composable
private fun ManageTokensButton(onClick: () -> Unit, modifier: Modifier = Modifier) {
PrimaryButton(
text = stringResource(id = R.string.main_manage_tokens),
onClick = onClick,
modifier = modifier
.fillMaxWidth()
.padding(horizontal = TangemTheme.dimens.spacing16),
)
}
internal fun LazyListScope.organizeTokens(state: WalletState, itemModifier: Modifier) {
(state as? WalletState.MultiCurrency)?.let {
(state.tokensListState as? WalletTokensListState.ContentState)?.let {