@@ -45,13 +45,15 @@ import to.bitkit.R
4545import to.bitkit.ext.DatePattern
4646import to.bitkit.ext.commentAllowed
4747import to.bitkit.ext.formatted
48+ import to.bitkit.models.FeeRate
4849import to.bitkit.ui.components.BalanceHeaderView
4950import to.bitkit.ui.components.BiometricsView
5051import to.bitkit.ui.components.BodySSB
5152import to.bitkit.ui.components.BottomSheetPreview
5253import to.bitkit.ui.components.ButtonSize
5354import to.bitkit.ui.components.Caption13Up
5455import to.bitkit.ui.components.FillHeight
56+ import to.bitkit.ui.components.MoneySSB
5557import to.bitkit.ui.components.PrimaryButton
5658import to.bitkit.ui.components.SwipeToConfirm
5759import to.bitkit.ui.components.TagButton
@@ -303,6 +305,7 @@ private fun OnChainDescription(
303305 uiState : SendUiState ,
304306 onEvent : (SendEvent ) -> Unit ,
305307) {
308+ val fee by remember(uiState.speed) { mutableStateOf(FeeRate .fromSpeed(uiState.speed)) }
306309 Column (modifier = Modifier .fillMaxWidth()) {
307310 Caption13Up (
308311 text = stringResource(R .string.wallet__send_to),
@@ -320,56 +323,71 @@ private fun OnChainDescription(
320323 modifier = Modifier
321324 .fillMaxHeight()
322325 .weight(1f )
323- .clickableAlpha { onEvent(SendEvent .SpeedAndFee ) }
324326 ) {
325- VerticalSpacer (16 .dp)
326- Caption13Up (text = stringResource(R .string.wallet__send_fee_and_speed), color = Colors .White64 )
327- Spacer (modifier = Modifier .height(8 .dp))
328- Row (
329- verticalAlignment = Alignment .CenterVertically ,
330- horizontalArrangement = Arrangement .spacedBy(4 .dp),
327+ Column (
328+ modifier = Modifier
329+ .fillMaxWidth()
330+ .clickableAlpha { onEvent(SendEvent .SpeedAndFee ) }
331331 ) {
332- Icon (
333- painterResource(R .drawable.ic_speed_normal),
334- contentDescription = null ,
335- tint = Colors .Brand ,
336- modifier = Modifier .size(16 .dp)
337- )
338- BodySSB (text = " Normal (₿ 210)" ) // TODO GET FROM STATE
339- Icon (
340- painterResource(R .drawable.ic_pencil),
341- contentDescription = null ,
342- modifier = Modifier .size(16 .dp)
343- )
332+ VerticalSpacer (16 .dp)
333+ Caption13Up (stringResource(R .string.wallet__send_fee_and_speed), color = Colors .White64 )
334+ VerticalSpacer (8 .dp)
335+ Row (
336+ verticalAlignment = Alignment .CenterVertically ,
337+ horizontalArrangement = Arrangement .spacedBy(4 .dp),
338+ ) {
339+ Icon (
340+ painterResource(fee.icon),
341+ contentDescription = null ,
342+ tint = fee.color,
343+ modifier = Modifier .size(16 .dp)
344+ )
345+ Row {
346+ BodySSB (stringResource(fee.title) + " (" )
347+ MoneySSB (sats = 210 , accent = Colors .White ) // TODO get from state
348+ BodySSB (" )" )
349+ }
350+ Icon (
351+ painterResource(R .drawable.ic_pencil),
352+ contentDescription = null ,
353+ modifier = Modifier .size(16 .dp)
354+ )
355+ }
356+ FillHeight ()
357+ VerticalSpacer (16 .dp)
344358 }
345- Spacer (modifier = Modifier .weight(1f ))
346- HorizontalDivider (modifier = Modifier .padding(top = 16 .dp))
359+ HorizontalDivider ()
347360 }
348361 Column (
349362 modifier = Modifier
350363 .fillMaxHeight()
351364 .weight(1f )
352- .clickableAlpha { onEvent(SendEvent .SpeedAndFee ) }
353365 ) {
354- VerticalSpacer (16 .dp)
355- Caption13Up (text = stringResource(R .string.wallet__send_confirming_in), color = Colors .White64 )
356- Spacer (modifier = Modifier .height(8 .dp))
357- Row (
358- verticalAlignment = Alignment .CenterVertically ,
359- horizontalArrangement = Arrangement .spacedBy(4 .dp),
366+ Column (
367+ modifier = Modifier
368+ .fillMaxWidth()
369+ .clickableAlpha { onEvent(SendEvent .SpeedAndFee ) }
360370 ) {
361- Icon (
362- painterResource(R .drawable.ic_clock),
363- contentDescription = null ,
364- tint = Colors .Brand ,
365- modifier = Modifier .size(16 .dp)
366- )
367- BodySSB (text = " ± 20-60 minutes" ) // TODO GET FROM STATE
371+ VerticalSpacer (16 .dp)
372+ Caption13Up (text = stringResource(R .string.wallet__send_confirming_in), color = Colors .White64 )
373+ Spacer (modifier = Modifier .height(8 .dp))
374+ Row (
375+ verticalAlignment = Alignment .CenterVertically ,
376+ horizontalArrangement = Arrangement .spacedBy(4 .dp),
377+ ) {
378+ Icon (
379+ painterResource(R .drawable.ic_clock),
380+ contentDescription = null ,
381+ tint = Colors .Brand ,
382+ modifier = Modifier .size(16 .dp)
383+ )
384+ BodySSB (stringResource(fee.description))
385+ }
386+ FillHeight ()
387+ VerticalSpacer (16 .dp)
388+ HorizontalDivider ()
368389 }
369- Spacer (modifier = Modifier .weight(1f ))
370- HorizontalDivider (modifier = Modifier .padding(top = 16 .dp))
371390 }
372-
373391 }
374392 }
375393}
0 commit comments