Updated on 2026-08-14
This commit is contained in:
parent
24ddb19639
commit
b284a8195a
5 changed files with 25 additions and 3 deletions
|
|
@ -13,6 +13,13 @@ import com.tangem.core.ui.components.transactions.state.TxHistoryState
|
|||
import com.tangem.core.ui.decorations.roundedShapeItemDecoration
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
||||
/**
|
||||
* LazyList extension for transactions history [TxHistoryState]
|
||||
*
|
||||
* @param state state
|
||||
* @param txHistoryItems transactions
|
||||
* @param modifier modifier
|
||||
*/
|
||||
fun LazyListScope.txHistoryItems(
|
||||
state: TxHistoryState,
|
||||
txHistoryItems: LazyPagingItems<TxHistoryState.TxHistoryItemState>?,
|
||||
|
|
@ -57,7 +64,7 @@ private fun LazyListScope.contentItems(
|
|||
itemContent = { index, item ->
|
||||
if (item == null) return@itemsIndexed
|
||||
|
||||
TxHistoryContentItem(
|
||||
TxHistoryListItem(
|
||||
state = item,
|
||||
modifier = modifier
|
||||
.animateItemPlacement()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import androidx.compose.ui.Modifier
|
|||
import com.tangem.core.ui.components.transactions.state.TxHistoryState
|
||||
|
||||
@Composable
|
||||
internal fun TxHistoryContentItem(state: TxHistoryState.TxHistoryItemState, modifier: Modifier = Modifier) {
|
||||
internal fun TxHistoryListItem(state: TxHistoryState.TxHistoryItemState, modifier: Modifier = Modifier) {
|
||||
when (state) {
|
||||
is TxHistoryState.TxHistoryItemState.GroupTitle -> {
|
||||
TxHistoryGroupTitle(config = state, modifier = modifier)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import com.tangem.core.ui.components.transactions.state.TxHistoryState.TxHistoryItemState
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
||||
/**
|
||||
* Transactions block group title
|
||||
*
|
||||
* @param config config
|
||||
* @param modifier modifier
|
||||
*/
|
||||
@Composable
|
||||
internal fun TxHistoryGroupTitle(config: TxHistoryItemState.GroupTitle, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -10,10 +10,16 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.transactions.state.TxHistoryState
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
||||
/**
|
||||
* Transactions block title
|
||||
*
|
||||
* @param config config
|
||||
* @param modifier modifier
|
||||
*/
|
||||
@Composable
|
||||
internal fun TxHistoryTitle(config: TxHistoryState.TxHistoryItemState.Title, modifier: Modifier = Modifier) {
|
||||
Row(
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import com.tangem.core.ui.components.wallet.WalletLockedContentState
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
|
||||
/**
|
||||
* Wallet transaction history state
|
||||
*/
|
||||
sealed interface TxHistoryState {
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue