diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml
index 6b0879d8e1..57b1b1dcae 100644
--- a/core/res/src/main/res/values-ru/strings.xml
+++ b/core/res/src/main/res/values-ru/strings.xml
@@ -62,6 +62,7 @@
Готово
Включить
Включено
+ Обозреватель
Нет
Ок
Основная карта
@@ -77,6 +78,7 @@
Успешно
Обмен
условия участия
+ Транзакции
Перевод
Я понял
Да
@@ -417,9 +419,11 @@
- %d токенов
- %d токенов
+ контракт: %s
У вас еще нет транзакций
- Не удалось загрузить транзакции
- Транзакции
+ Не удалось загрузить историю транзакций.\nНажмите на кнопку перезагрузки, чтобы обновить информацию.
+ История транзакций в настоящее время не поддерживается для этого блокчейна. Но не волнуйтесь, мы работаем над этим! А пока вы можете проверить ее в обозревателе.
+ от: %s
В процессе…
Вы отсканировали ту же карту. Для создания twin-кошелька вам необходимо отсканировать карту с номером %d
Это карта, которую вы держите в руках. У парной карты номер %s.\n\nОбе карты можно использовать для вывода средств из этого кошелька.
diff --git a/core/res/src/main/res/values-zh-rTW/strings.xml b/core/res/src/main/res/values-zh-rTW/strings.xml
index ab1801d759..597be9911d 100644
--- a/core/res/src/main/res/values-zh-rTW/strings.xml
+++ b/core/res/src/main/res/values-zh-rTW/strings.xml
@@ -56,6 +56,7 @@
完成
允許
啟用
+ 交易
否
OK
主卡片
@@ -71,6 +72,7 @@
成功
交換
條款和條件
+ 交易
我了解
是
已複製代幣地址
@@ -392,7 +394,6 @@
您還沒有任何交易
無法加載交易
- 交易
進行中…
您掃描了同一張卡片。要創建雙錢包,您需要掃描編號為 %d 的卡
這一個是你手裡拿著的,另一個是編號為 %s 的,這兩張卡都可以用來從這個錢包中提取資金
diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml
index 405c31d86a..e68fd193bb 100644
--- a/core/res/src/main/res/values/strings.xml
+++ b/core/res/src/main/res/values/strings.xml
@@ -60,6 +60,7 @@
Done
Enable
Enabled
+ Explorer
No
OK
Primary Card
@@ -75,6 +76,7 @@
Success
Swap
terms and conditions
+ Transactions
Transfer
I understand
Yes
@@ -409,9 +411,12 @@
- %d token
- %d tokens
+ contract: %s
You don\'t have any transactions yet
- Failed to load transactions
- Transactions
+ Failed to load transaction history.\nClick on reload button to update the information.
+ Transaction history is currently not supported for this blockchain. But don\'t worry, we\'re working on it! In the meantime you can check it in the explorer.
+ from: %s
+ to: %s
In progress…
You\'ve scanned the same card. To create a twin wallet you need to scan the card with number %d
This one that you are holding in your hands and the other one with number %s.\n\nBoth cards can be used to extract funds from this wallet.
diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt b/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt
index 0f265ecce9..1257a022a7 100644
--- a/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt
+++ b/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt
@@ -26,7 +26,8 @@ import com.tangem.core.ui.res.TangemTheme
/**
* Transaction component
*
- * @param state state
+ * @param state state
+ * @param modifier modifier
*
* @see Figma Component
@@ -34,9 +35,9 @@ import com.tangem.core.ui.res.TangemTheme
[REDACTED_AUTHOR]
*/
@Composable
-fun Transaction(state: TransactionState) {
+fun Transaction(state: TransactionState, modifier: Modifier = Modifier) {
Surface(
- modifier = Modifier
+ modifier = modifier
.background(TangemTheme.colors.background.primary)
.defaultMinSize(minHeight = TangemTheme.dimens.size56)
.padding(horizontal = TangemTheme.dimens.spacing12, vertical = TangemTheme.dimens.spacing10),
@@ -212,14 +213,26 @@ private fun Subtitle(state: TransactionState, modifier: Modifier = Modifier) {
is TransactionState.Content -> {
Text(
text = when (state) {
- is TransactionState.Sending -> "to: ${state.address}"
- is TransactionState.Send -> "to: ${state.address}"
- is TransactionState.Receiving -> "from: ${state.address}"
- is TransactionState.Receive -> "from: ${state.address}"
- is TransactionState.Approving -> "from: ${state.address}"
- is TransactionState.Approved -> "from: ${state.address}"
- is TransactionState.Swapping -> "contract: ${state.address}"
- is TransactionState.Swapped -> "contract ${state.address}"
+ is TransactionState.Sending,
+ is TransactionState.Send,
+ -> stringResource(
+ id = R.string.transaction_history_transaction_to_address,
+ state.address,
+ )
+ is TransactionState.Receiving,
+ is TransactionState.Receive,
+ is TransactionState.Approving,
+ is TransactionState.Approved,
+ -> stringResource(
+ id = R.string.transaction_history_transaction_from_address,
+ state.address,
+ )
+ is TransactionState.Swapping,
+ is TransactionState.Swapped,
+ -> stringResource(
+ id = R.string.transaction_history_contract_address,
+ state.address,
+ )
},
modifier = modifier,
textAlign = TextAlign.Start,
diff --git a/core/ui/src/main/res/drawable/ic_compass_24.xml b/core/ui/src/main/res/drawable/ic_compass_24.xml
new file mode 100644
index 0000000000..597c8d959f
--- /dev/null
+++ b/core/ui/src/main/res/drawable/ic_compass_24.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/WalletPreviewData.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/WalletPreviewData.kt
index 92c8d8f644..410256fd11 100644
--- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/WalletPreviewData.kt
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/WalletPreviewData.kt
@@ -1,6 +1,7 @@
package com.tangem.feature.wallet.presentation.common
import com.tangem.core.ui.R
+import com.tangem.core.ui.components.transactions.TransactionState
import com.tangem.feature.wallet.presentation.common.state.TokenItemState
import com.tangem.feature.wallet.presentation.common.state.TokenItemState.TokenOptionsState
import com.tangem.feature.wallet.presentation.organizetokens.DraggableItem
@@ -9,13 +10,14 @@ import com.tangem.feature.wallet.presentation.organizetokens.OrganizeTokensState
import com.tangem.feature.wallet.presentation.wallet.state.WalletCardState
import com.tangem.feature.wallet.presentation.wallet.state.WalletContentItemState
import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
+import com.tangem.feature.wallet.presentation.wallet.state.WalletTopBarConfig
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toPersistentList
import java.util.UUID
internal object WalletPreviewData {
- val walletTopBarConfig = WalletStateHolder.TopBarConfig(onScanCardClick = {}, onMoreClick = {})
+ val walletTopBarConfig = WalletTopBarConfig(onScanCardClick = {}, onMoreClick = {})
val walletCardContentState = WalletCardState.Content(
id = UUID.randomUUID().toString(),
@@ -159,7 +161,7 @@ internal object WalletPreviewData {
),
)
- val groupedWalletScreenState = WalletStateHolder(
+ val multicurrencyWalletScreenState = WalletStateHolder.MultiCurrencyContent(
onBackClick = {},
topBarConfig = walletTopBarConfig,
selectedWallet = walletCardContentState,
@@ -170,8 +172,8 @@ internal object WalletPreviewData {
walletCardErrorState,
),
contentItems = persistentListOf(
- WalletContentItemState.NetworkGroupTitle("Bitcoin"),
- WalletContentItemState.Token(
+ WalletContentItemState.MultiCurrencyItem.NetworkGroupTitle("Bitcoin"),
+ WalletContentItemState.MultiCurrencyItem.Token(
tokenItemVisibleState.copy(
id = "token_1",
name = "Ethereum",
@@ -180,7 +182,7 @@ internal object WalletPreviewData {
amount = "1,89340821 ETH",
),
),
- WalletContentItemState.Token(
+ WalletContentItemState.MultiCurrencyItem.Token(
tokenItemVisibleState.copy(
id = "token_2",
name = "Ethereum",
@@ -189,7 +191,7 @@ internal object WalletPreviewData {
amount = "1,89340821 ETH",
),
),
- WalletContentItemState.Token(
+ WalletContentItemState.MultiCurrencyItem.Token(
tokenItemVisibleState.copy(
id = "token_3",
name = "Ethereum",
@@ -198,7 +200,7 @@ internal object WalletPreviewData {
amount = "1,89340821 ETH",
),
),
- WalletContentItemState.Token(
+ WalletContentItemState.MultiCurrencyItem.Token(
tokenItemVisibleState.copy(
id = "token_4",
name = "Ethereum",
@@ -207,8 +209,8 @@ internal object WalletPreviewData {
amount = "1,89340821 ETH",
),
),
- WalletContentItemState.NetworkGroupTitle("Ethereum"),
- WalletContentItemState.Token(
+ WalletContentItemState.MultiCurrencyItem.NetworkGroupTitle("Ethereum"),
+ WalletContentItemState.MultiCurrencyItem.Token(
tokenItemVisibleState.copy(
id = "token_5",
name = "Ethereum",
@@ -220,4 +222,35 @@ internal object WalletPreviewData {
),
onOrganizeTokensClick = {},
)
+
+ val singleWalletScreenState = WalletStateHolder.SingleCurrencyContent(
+ onBackClick = {},
+ topBarConfig = walletTopBarConfig,
+ selectedWallet = walletCardContentState,
+ wallets = persistentListOf(
+ walletCardContentState,
+ walletCardLoadingState,
+ walletCardHiddenContentState,
+ walletCardErrorState,
+ ),
+ contentItems = persistentListOf(
+ WalletContentItemState.SingleCurrencyItem.Title(onExploreClick = {}),
+ WalletContentItemState.SingleCurrencyItem.TransactionGroupTitle("Today"),
+ WalletContentItemState.SingleCurrencyItem.Transaction(
+ TransactionState.Sending(
+ address = "33BddS...ga2B",
+ amount = "-0.500913 BTC",
+ timestamp = "8:41",
+ ),
+ ),
+ WalletContentItemState.SingleCurrencyItem.TransactionGroupTitle("Yesterday"),
+ WalletContentItemState.SingleCurrencyItem.Transaction(
+ TransactionState.Sending(
+ address = "33BddS...ga2B",
+ amount = "-0.500913 BTC",
+ timestamp = "8:41",
+ ),
+ ),
+ ),
+ )
}
\ No newline at end of file
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletContentItemState.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletContentItemState.kt
index 66a426f04a..f8934f6002 100644
--- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletContentItemState.kt
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletContentItemState.kt
@@ -1,13 +1,55 @@
package com.tangem.feature.wallet.presentation.wallet.state
+import com.tangem.core.ui.components.transactions.TransactionState
import com.tangem.feature.wallet.presentation.common.state.TokenItemState
/**
+ * Wallet screen content item state
+ *
[REDACTED_AUTHOR]
*/
internal sealed interface WalletContentItemState {
- data class NetworkGroupTitle(val networkName: String) : WalletContentItemState
+ /** Multi currency wallet content state */
+ sealed interface MultiCurrencyItem : WalletContentItemState {
- data class Token(val tokenItemState: TokenItemState) : WalletContentItemState
+ /**
+ * Network group title item
+ *
+ * @property networkName network name
+ */
+ data class NetworkGroupTitle(val networkName: String) : MultiCurrencyItem
+
+ /**
+ * Token item
+ *
+ * @property state token item state
+ */
+ data class Token(val state: TokenItemState) : MultiCurrencyItem
+ }
+
+ /** Single currency wallet content state */
+ sealed interface SingleCurrencyItem : WalletContentItemState {
+
+ /**
+ * Title item
+ *
+ * @property onExploreClick lambda be invoke when explore button was clicked
+ */
+ data class Title(val onExploreClick: () -> Unit) : SingleCurrencyItem
+
+ /**
+ * Transaction group title item
+ *
+ * @property title title
+ */
+ data class TransactionGroupTitle(val title: String) : SingleCurrencyItem
+
+ /**
+ * Transaction item
+ *
+ * @property state transaction state
+ */
+ data class Transaction(val state: TransactionState) : SingleCurrencyItem
+ }
}
\ No newline at end of file
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletStateHolder.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletStateHolder.kt
index 061647e21b..bfc07128cf 100644
--- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletStateHolder.kt
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletStateHolder.kt
@@ -3,7 +3,7 @@ package com.tangem.feature.wallet.presentation.wallet.state
import kotlinx.collections.immutable.ImmutableList
/**
- * Wallet state holder
+ * Wallet screen state holder
*
* @property onBackClick lambda be invoked when back button is clicked
* @property topBarConfig top bar config
@@ -13,20 +13,46 @@ import kotlinx.collections.immutable.ImmutableList
*
[REDACTED_AUTHOR]
*/
-internal data class WalletStateHolder(
- val onBackClick: () -> Unit,
- val topBarConfig: TopBarConfig,
- val selectedWallet: WalletCardState,
- val wallets: ImmutableList,
- val contentItems: ImmutableList,
- val onOrganizeTokensClick: () -> Unit,
+internal sealed class WalletStateHolder(
+ open val onBackClick: () -> Unit,
+ open val topBarConfig: WalletTopBarConfig,
+ open val selectedWallet: WalletCardState,
+ open val wallets: ImmutableList,
+ open val contentItems: ImmutableList,
) {
/**
- * Top bar config
+ * Multi currency wallet content state
*
- * @property onScanCardClick lambda be invoked when scan card button is clicked
- * @property onMoreClick lambda be invoked when more button is clicked
+ * @property onBackClick lambda be invoked when back button is clicked
+ * @property topBarConfig top bar config
+ * @property selectedWallet selected wallet
+ * @property wallets list of wallets states
+ * @property contentItems content items
*/
- data class TopBarConfig(val onScanCardClick: () -> Unit, val onMoreClick: () -> Unit)
+ data class MultiCurrencyContent(
+ override val onBackClick: () -> Unit,
+ override val topBarConfig: WalletTopBarConfig,
+ override val selectedWallet: WalletCardState,
+ override val wallets: ImmutableList,
+ override val contentItems: ImmutableList,
+ val onOrganizeTokensClick: () -> Unit,
+ ) : WalletStateHolder(onBackClick, topBarConfig, selectedWallet, wallets, contentItems)
+
+ /**
+ * Single currency wallet content state
+ *
+ * @property onBackClick lambda be invoked when back button is clicked
+ * @property topBarConfig top bar config
+ * @property selectedWallet selected wallet
+ * @property wallets list of wallets states
+ * @property contentItems content items
+ */
+ data class SingleCurrencyContent(
+ override val onBackClick: () -> Unit,
+ override val topBarConfig: WalletTopBarConfig,
+ override val selectedWallet: WalletCardState,
+ override val wallets: ImmutableList,
+ override val contentItems: ImmutableList,
+ ) : WalletStateHolder(onBackClick, topBarConfig, selectedWallet, wallets, contentItems)
}
\ No newline at end of file
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletTopBarConfig.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletTopBarConfig.kt
new file mode 100644
index 0000000000..f1838ea250
--- /dev/null
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletTopBarConfig.kt
@@ -0,0 +1,9 @@
+package com.tangem.feature.wallet.presentation.wallet.state
+
+/**
+ * Wallet screen top bar config
+ *
+ * @property onScanCardClick lambda be invoked when scan card button is clicked
+ * @property onMoreClick lambda be invoked when more button is clicked
+ */
+data class WalletTopBarConfig(val onScanCardClick: () -> Unit, val onMoreClick: () -> Unit)
\ No newline at end of file
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletScreen.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletScreen.kt
index 4c569efd54..b5cf68559c 100644
--- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletScreen.kt
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletScreen.kt
@@ -1,23 +1,29 @@
package com.tangem.feature.wallet.presentation.wallet.ui
import androidx.activity.compose.BackHandler
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
+import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.clip
+import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import com.tangem.core.ui.components.RoundedActionButton
+import com.tangem.core.ui.components.transactions.Transaction
import com.tangem.core.ui.res.TangemTheme
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
@@ -43,9 +49,7 @@ internal fun WalletScreen(state: WalletStateHolder, modifier: Modifier = Modifie
topBar = { WalletTopBar(config = state.topBarConfig) },
containerColor = TangemTheme.colors.background.secondary,
) { scaffoldPaddings ->
- val lastContentItemIndex = remember(state.contentItems) {
- state.contentItems.lastIndex
- }
+ val lastContentItemIndex = remember(state.contentItems) { state.contentItems.lastIndex }
LazyColumn(
modifier = modifier
@@ -57,10 +61,13 @@ internal fun WalletScreen(state: WalletStateHolder, modifier: Modifier = Modifie
itemsIndexed(
items = state.contentItems,
- key = { _, item ->
+ key = { index, item ->
when (item) {
- is WalletContentItemState.NetworkGroupTitle -> item.networkName
- is WalletContentItemState.Token -> item.tokenItemState.id
+ is WalletContentItemState.MultiCurrencyItem.NetworkGroupTitle -> item.networkName
+ is WalletContentItemState.MultiCurrencyItem.Token -> item.state.id
+ is WalletContentItemState.SingleCurrencyItem.Title -> index
+ is WalletContentItemState.SingleCurrencyItem.TransactionGroupTitle -> item.title
+ is WalletContentItemState.SingleCurrencyItem.Transaction -> index
}
},
) { index, item ->
@@ -69,33 +76,96 @@ internal fun WalletScreen(state: WalletStateHolder, modifier: Modifier = Modifie
.clipFirstAndLastItems(index, lastContentItemIndex)
when (item) {
- is WalletContentItemState.NetworkGroupTitle -> {
- NetworkGroupItem(
- networkName = item.networkName,
- modifier = itemModifier,
- )
+ is WalletContentItemState.MultiCurrencyItem.NetworkGroupTitle -> {
+ NetworkGroupItem(networkName = item.networkName, modifier = itemModifier)
}
- is WalletContentItemState.Token -> {
- TokenItem(
- state = item.tokenItemState,
- modifier = itemModifier,
- )
+ is WalletContentItemState.MultiCurrencyItem.Token -> {
+ TokenItem(state = item.state, modifier = itemModifier)
+ }
+ is WalletContentItemState.SingleCurrencyItem.Title -> {
+ SingleCurrencyTitle(config = item, modifier = itemModifier)
+ }
+ is WalletContentItemState.SingleCurrencyItem.TransactionGroupTitle -> {
+ TransactionGroupTitle(config = item, modifier = itemModifier)
+ }
+ is WalletContentItemState.SingleCurrencyItem.Transaction -> {
+ Transaction(state = item.state, modifier = itemModifier)
}
}
}
- item {
- RoundedActionButton(
- text = stringResource(id = R.string.organize_tokens_title),
- iconResId = R.drawable.ic_filter_24,
- onClick = state.onOrganizeTokensClick,
- modifier = Modifier.padding(top = TangemTheme.dimens.spacing14),
- )
+ if (state is WalletStateHolder.MultiCurrencyContent) {
+ item {
+ RoundedActionButton(
+ text = stringResource(id = R.string.organize_tokens_title),
+ iconResId = R.drawable.ic_filter_24,
+ onClick = state.onOrganizeTokensClick,
+ modifier = Modifier.padding(top = TangemTheme.dimens.spacing14),
+ )
+ }
}
}
}
}
+@Composable
+private fun SingleCurrencyTitle(
+ config: WalletContentItemState.SingleCurrencyItem.Title,
+ modifier: Modifier = Modifier,
+) {
+ Row(
+ modifier = modifier
+ .background(TangemTheme.colors.background.primary)
+ .fillMaxWidth()
+ .padding(top = TangemTheme.dimens.spacing12)
+ .padding(horizontal = TangemTheme.dimens.spacing16),
+ horizontalArrangement = Arrangement.SpaceBetween,
+ ) {
+ Text(
+ text = stringResource(id = R.string.common_transactions),
+ color = TangemTheme.colors.text.tertiary,
+ style = TangemTheme.typography.subtitle2,
+ )
+
+ Row(
+ modifier = Modifier.clickable(onClick = config.onExploreClick),
+ horizontalArrangement = Arrangement.spacedBy(space = TangemTheme.dimens.spacing4),
+ ) {
+ Icon(
+ painter = painterResource(id = R.drawable.ic_compass_24),
+ contentDescription = null,
+ modifier = Modifier.size(size = TangemTheme.dimens.size18),
+ tint = TangemTheme.colors.icon.informative,
+ )
+ Text(
+ text = stringResource(id = R.string.common_explorer),
+ color = TangemTheme.colors.text.tertiary,
+ style = TangemTheme.typography.subtitle2,
+ )
+ }
+ }
+}
+
+@Composable
+private fun TransactionGroupTitle(
+ config: WalletContentItemState.SingleCurrencyItem.TransactionGroupTitle,
+ modifier: Modifier = Modifier,
+) {
+ Text(
+ text = config.title,
+ modifier = modifier
+ .background(TangemTheme.colors.background.primary)
+ .fillMaxWidth()
+ .padding(
+ horizontal = TangemTheme.dimens.spacing16,
+ vertical = TangemTheme.dimens.spacing14,
+ ),
+ color = TangemTheme.colors.text.tertiary,
+ textAlign = TextAlign.Start,
+ style = TangemTheme.typography.body2,
+ )
+}
+
private fun Modifier.clipFirstAndLastItems(index: Int, lastItemIndex: Int): Modifier = composed {
when (index) {
0 -> {
@@ -143,6 +213,9 @@ private fun WalletScreenPreview_Dark(
}
private class WalletScreenParameterProvider : CollectionPreviewParameterProvider(
- collection = listOf(WalletPreviewData.groupedWalletScreenState),
+ collection = listOf(
+ WalletPreviewData.multicurrencyWalletScreenState,
+ WalletPreviewData.singleWalletScreenState,
+ ),
)
// endregion Preview
\ No newline at end of file
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/WalletTopBar.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/WalletTopBar.kt
index 29b91f97bd..54db11db4d 100644
--- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/WalletTopBar.kt
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/WalletTopBar.kt
@@ -7,7 +7,7 @@ import androidx.compose.ui.tooling.preview.Preview
import com.tangem.core.ui.res.TangemTheme
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
-import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
+import com.tangem.feature.wallet.presentation.wallet.state.WalletTopBarConfig
/**
* Wallet screen top bar
@@ -16,7 +16,7 @@ import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
-internal fun WalletTopBar(config: WalletStateHolder.TopBarConfig) {
+internal fun WalletTopBar(config: WalletTopBarConfig) {
TopAppBar(
title = {
Icon(painter = painterResource(id = R.drawable.img_tangem_logo_90_24), contentDescription = null)
diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt
index 9cb70bd530..dd643d7352 100644
--- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt
+++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt
@@ -27,9 +27,9 @@ internal class WalletViewModel @Inject constructor() : ViewModel() {
private set
// TODO: [REDACTED_TASK_KEY] Use production data instead of WalletPreviewData
- private fun getInitialState(): WalletStateHolder = WalletPreviewData.groupedWalletScreenState.copy(
+ private fun getInitialState(): WalletStateHolder = WalletPreviewData.multicurrencyWalletScreenState.copy(
onBackClick = { router.popBackStack() },
- topBarConfig = WalletPreviewData.groupedWalletScreenState.topBarConfig.copy(
+ topBarConfig = WalletPreviewData.multicurrencyWalletScreenState.topBarConfig.copy(
onScanCardClick = { router.openOrganizeTokensScreen() },
),
)