11package to.bitkit.ui.screens.transfer.hardware
22
3- import androidx.compose.foundation.Image
43import androidx.compose.foundation.layout.Arrangement
54import androidx.compose.foundation.layout.Box
65import androidx.compose.foundation.layout.Column
76import androidx.compose.foundation.layout.IntrinsicSize
87import androidx.compose.foundation.layout.Row
98import androidx.compose.foundation.layout.fillMaxSize
10- import androidx.compose.foundation.layout.fillMaxWidth
119import androidx.compose.foundation.layout.height
1210import androidx.compose.foundation.layout.padding
1311import androidx.compose.runtime.Composable
1412import androidx.compose.runtime.LaunchedEffect
1513import androidx.compose.runtime.getValue
16- import androidx.compose.ui.Alignment
1714import androidx.compose.ui.Modifier
18- import androidx.compose.ui.layout.ContentScale
1915import androidx.compose.ui.platform.testTag
20- import androidx.compose.ui.res.painterResource
2116import androidx.compose.ui.res.stringResource
2217import androidx.compose.ui.tooling.preview.Preview
2318import androidx.compose.ui.unit.dp
@@ -78,13 +73,13 @@ fun SpendingHwSignScreen(
7873@Composable
7974private fun Content (
8075 order : IBtOrder ,
81- isAdvanced : Boolean ,
82- isSigning : Boolean ,
83- onBackClick : () -> Unit ,
84- onLearnMoreClick : () -> Unit ,
85- onAdvancedClick : () -> Unit ,
86- onUseDefaultLspBalanceClick : () -> Unit ,
87- onOpenConnect : () -> Unit ,
76+ isAdvanced : Boolean = false ,
77+ isSigning : Boolean = false ,
78+ onBackClick : () -> Unit = {} ,
79+ onLearnMoreClick : () -> Unit = {} ,
80+ onAdvancedClick : () -> Unit = {} ,
81+ onUseDefaultLspBalanceClick : () -> Unit = {} ,
82+ onOpenConnect : () -> Unit = {} ,
8883) {
8984 ScreenColumn {
9085 AppTopBar (
@@ -93,15 +88,9 @@ private fun Content(
9388 actions = { DrawerNavIcon () },
9489 )
9590 Box (modifier = Modifier .fillMaxSize()) {
96- Image (
97- painter = painterResource(id = R .drawable.trezor),
98- contentDescription = null ,
99- contentScale = ContentScale .Fit ,
100- modifier = Modifier
101- .fillMaxWidth()
102- .padding(horizontal = 48 .dp)
103- .align(Alignment .BottomCenter )
104- .padding(bottom = 96 .dp)
91+ HardwareTransferIllustration (
92+ drawableRes = R .drawable.trezor,
93+ topRatio = SIGN_VISUAL_TOP_RATIO ,
10594 )
10695
10796 Column (
@@ -198,13 +187,28 @@ private fun Preview() {
198187 AppThemeSurface {
199188 Content (
200189 order = previewBtOrder(),
201- isAdvanced = false ,
202- isSigning = false ,
203- onBackClick = {},
204- onLearnMoreClick = {},
205- onAdvancedClick = {},
206- onUseDefaultLspBalanceClick = {},
207- onOpenConnect = {},
190+ )
191+ }
192+ }
193+
194+ @Preview(showSystemUi = true )
195+ @Composable
196+ private fun PreviewAdvanced () {
197+ AppThemeSurface {
198+ Content (
199+ order = previewBtOrder(),
200+ isAdvanced = true ,
201+ )
202+ }
203+ }
204+
205+ @Preview(showSystemUi = true )
206+ @Composable
207+ private fun PreviewSigning () {
208+ AppThemeSurface {
209+ Content (
210+ order = previewBtOrder(),
211+ isSigning = true ,
208212 )
209213 }
210214}
0 commit comments