11package to.bitkit.ui.screens.wallets.sheets
22
3+ import androidx.compose.foundation.layout.Arrangement
34import androidx.compose.foundation.layout.Column
5+ import androidx.compose.foundation.layout.Row
46import androidx.compose.foundation.layout.Spacer
57import androidx.compose.foundation.layout.fillMaxSize
8+ import androidx.compose.foundation.layout.fillMaxWidth
69import androidx.compose.foundation.layout.height
710import androidx.compose.foundation.layout.padding
811import androidx.compose.material3.Button
@@ -23,12 +26,16 @@ import to.bitkit.R
2326import to.bitkit.models.NewTransactionSheetDetails
2427import to.bitkit.models.NewTransactionSheetDirection
2528import to.bitkit.models.NewTransactionSheetType
29+ import to.bitkit.ui.components.BalanceHeaderView
30+ import to.bitkit.ui.components.PrimaryButton
31+ import to.bitkit.ui.components.SecondaryButton
2632import to.bitkit.ui.scaffold.SheetTopBar
2733import to.bitkit.ui.shared.moneyString
2834import to.bitkit.ui.shared.util.gradientBackground
2935import to.bitkit.ui.theme.AppShapes
3036import to.bitkit.ui.theme.AppThemeSurface
3137import to.bitkit.viewmodels.AppViewModel
38+ import to.bitkit.viewmodels.SendEvent
3239
3340@OptIn(ExperimentalMaterial3Api ::class )
3441@Composable
@@ -42,7 +49,9 @@ fun NewTransactionSheet(
4249 sheetState = sheetState,
4350 shape = AppShapes .sheet,
4451 containerColor = MaterialTheme .colorScheme.surface,
45- modifier = Modifier .fillMaxSize().gradientBackground()
52+ modifier = Modifier
53+ .fillMaxSize()
54+ .gradientBackground()
4655 ) {
4756 NewTransactionSheetView (
4857 details = appViewModel.newTransaction,
@@ -81,20 +90,33 @@ private fun NewTransactionSheetView(
8190
8291 Spacer (modifier = Modifier .height(24 .dp))
8392
84- Text (
85- text = moneyString(details.sats),
86- style = MaterialTheme .typography.titleLarge,
87- modifier = Modifier .align(Alignment .Start )
88- )
93+ BalanceHeaderView (sats = details.sats, modifier = Modifier .fillMaxWidth())
8994
90- Spacer (modifier = Modifier .weight(1f ))
9195 Spacer (modifier = Modifier .weight(1f ))
9296
93- Button (
94- onClick = onCloseClick,
95- ) {
96- Text (stringResource(R .string.close))
97+ if (details.direction == NewTransactionSheetDirection .SENT ) {
98+ Row (
99+ horizontalArrangement = Arrangement .spacedBy(16 .dp),
100+ modifier = Modifier .fillMaxWidth()
101+ ) {
102+ SecondaryButton (
103+ text = stringResource(R .string.common__close), // get correct text
104+ onClick = onCloseClick,
105+ )
106+ PrimaryButton (
107+ text = stringResource(R .string.common__close), // get correct text
108+ onClick = onCloseClick,
109+ fullWidth = false
110+ )
111+ }
112+ } else {
113+ PrimaryButton (
114+ text = stringResource(R .string.common__close), // get correct text
115+ onClick = onCloseClick,
116+ )
97117 }
118+
119+ Spacer (modifier = Modifier .height(16 .dp))
98120 }
99121}
100122/*
0 commit comments