Skip to content

Commit 96089c9

Browse files
committed
feat: add buttons WIP
1 parent faa6b24 commit 96089c9

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

app/src/main/java/to/bitkit/ui/screens/wallets/sheets/NewTransactionSheet.kt

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package to.bitkit.ui.screens.wallets.sheets
22

3+
import androidx.compose.foundation.layout.Arrangement
34
import androidx.compose.foundation.layout.Column
5+
import androidx.compose.foundation.layout.Row
46
import androidx.compose.foundation.layout.Spacer
57
import androidx.compose.foundation.layout.fillMaxSize
8+
import androidx.compose.foundation.layout.fillMaxWidth
69
import androidx.compose.foundation.layout.height
710
import androidx.compose.foundation.layout.padding
811
import androidx.compose.material3.Button
@@ -23,12 +26,16 @@ import to.bitkit.R
2326
import to.bitkit.models.NewTransactionSheetDetails
2427
import to.bitkit.models.NewTransactionSheetDirection
2528
import 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
2632
import to.bitkit.ui.scaffold.SheetTopBar
2733
import to.bitkit.ui.shared.moneyString
2834
import to.bitkit.ui.shared.util.gradientBackground
2935
import to.bitkit.ui.theme.AppShapes
3036
import to.bitkit.ui.theme.AppThemeSurface
3137
import 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

Comments
 (0)