Updated on 2026-08-14
This commit is contained in:
parent
3b4b45dc99
commit
33c966c934
7 changed files with 37 additions and 11 deletions
|
|
@ -81,7 +81,7 @@ private fun LazyListScope.contentItems(
|
|||
count = txHistoryItems.itemCount,
|
||||
key = txHistoryItems.itemKey { item ->
|
||||
when (item) {
|
||||
is TxHistoryState.TxHistoryItemState.GroupTitle -> item.title
|
||||
is TxHistoryState.TxHistoryItemState.GroupTitle -> item.itemKey
|
||||
is TxHistoryState.TxHistoryItemState.Title -> item.onExploreClick.hashCode()
|
||||
is TxHistoryState.TxHistoryItemState.Transaction -> item.state.txHash
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.components.transactions.state.TxHistoryState.TxHistoryItemState
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* Transactions block group title
|
||||
|
|
@ -38,7 +39,9 @@ internal fun TxHistoryGroupTitle(config: TxHistoryItemState.GroupTitle, modifier
|
|||
@Composable
|
||||
private fun Preview_TransactionsBlockGroupTitle_Light() {
|
||||
TangemTheme(isDark = false) {
|
||||
TxHistoryGroupTitle(config = TxHistoryItemState.GroupTitle(title = "Today"))
|
||||
TxHistoryGroupTitle(
|
||||
config = TxHistoryItemState.GroupTitle(title = "Today", itemKey = UUID.randomUUID().toString()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,6 +49,8 @@ private fun Preview_TransactionsBlockGroupTitle_Light() {
|
|||
@Composable
|
||||
private fun Preview_TransactionsBlockGroupTitle_Dark() {
|
||||
TangemTheme(isDark = true) {
|
||||
TxHistoryGroupTitle(config = TxHistoryItemState.GroupTitle(title = "Today"))
|
||||
TxHistoryGroupTitle(
|
||||
config = TxHistoryItemState.GroupTitle(title = "Today", itemKey = UUID.randomUUID().toString()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -49,8 +49,12 @@ sealed interface TxHistoryState {
|
|||
* Group title item
|
||||
*
|
||||
* @property title title
|
||||
* @property itemKey key to use in compose
|
||||
*/
|
||||
data class GroupTitle(val title: String) : TxHistoryItemState
|
||||
data class GroupTitle(
|
||||
val title: String,
|
||||
val itemKey: String,
|
||||
) : TxHistoryItemState
|
||||
|
||||
/**
|
||||
* Transaction item
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue