@@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.height
1818import androidx.compose.foundation.layout.navigationBarsPadding
1919import androidx.compose.foundation.layout.padding
2020import androidx.compose.foundation.layout.size
21- import androidx.compose.foundation.layout.width
2221import androidx.compose.foundation.lazy.LazyRow
2322import androidx.compose.foundation.lazy.itemsIndexed
2423import androidx.compose.foundation.lazy.rememberLazyListState
@@ -236,6 +235,7 @@ fun ReceiveQrScreen(
236235 tab = tab,
237236 walletState = walletState,
238237 cjitInvoice = cjitInvoice,
238+ onClickEditInvoice = onClickEditInvoice,
239239 modifier = Modifier .weight(1f )
240240 )
241241 }
@@ -458,6 +458,7 @@ private fun ReceiveDetailsView(
458458 tab : ReceiveTab ,
459459 walletState : MainUiState ,
460460 cjitInvoice : String? ,
461+ onClickEditInvoice : () -> Unit ,
461462 modifier : Modifier = Modifier ,
462463) {
463464 Card (
@@ -477,6 +478,7 @@ private fun ReceiveDetailsView(
477478 ),
478479 body = walletState.onchainAddress,
479480 type = CopyAddressType .ONCHAIN ,
481+ onClickEditInvoice = onClickEditInvoice,
480482 testTag = " ReceiveOnchainAddress" ,
481483 )
482484 }
@@ -493,6 +495,7 @@ private fun ReceiveDetailsView(
493495 ),
494496 body = walletState.onchainAddress,
495497 type = CopyAddressType .ONCHAIN ,
498+ onClickEditInvoice = onClickEditInvoice,
496499 testTag = " ReceiveOnchainAddress" ,
497500 )
498501 }
@@ -501,6 +504,7 @@ private fun ReceiveDetailsView(
501504 title = stringResource(R .string.wallet__receive_lightning_invoice),
502505 address = cjitInvoice ? : walletState.bolt11,
503506 type = CopyAddressType .LIGHTNING ,
507+ onClickEditInvoice = onClickEditInvoice,
504508 testTag = " ReceiveLightningAddress" ,
505509 )
506510 }
@@ -512,6 +516,7 @@ private fun ReceiveDetailsView(
512516 title = stringResource(R .string.wallet__receive_lightning_invoice),
513517 address = cjitInvoice ? : walletState.bolt11,
514518 type = CopyAddressType .LIGHTNING ,
519+ onClickEditInvoice = onClickEditInvoice,
515520 testTag = " ReceiveLightningAddress" ,
516521 )
517522 }
@@ -529,6 +534,7 @@ private fun CopyAddressCard(
529534 title : String ,
530535 address : String ,
531536 type : CopyAddressType ,
537+ onClickEditInvoice : () -> Unit ,
532538 body : String? = null,
533539 testTag : String? = null,
534540) {
@@ -542,14 +548,7 @@ private fun CopyAddressCard(
542548 .fillMaxWidth()
543549 .padding(24 .dp)
544550 ) {
545- Row {
546- Caption13Up (text = title, color = Colors .White64 )
547-
548- Spacer (modifier = Modifier .width(3 .dp))
549-
550- val iconRes = if (type == CopyAddressType .ONCHAIN ) R .drawable.ic_bitcoin else R .drawable.ic_lightning_alt
551- Icon (painter = painterResource(iconRes), contentDescription = null , tint = Colors .White64 )
552- }
551+ Caption13Up (text = title, color = Colors .White64 )
553552 Spacer (modifier = Modifier .height(16 .dp))
554553 BodyS (
555554 text = (body ? : address).truncate(32 ).uppercase(),
@@ -559,28 +558,48 @@ private fun CopyAddressCard(
559558 Row (
560559 horizontalArrangement = Arrangement .spacedBy(16 .dp)
561560 ) {
561+ PrimaryButton (
562+ text = stringResource(R .string.common__edit),
563+ size = ButtonSize .Small ,
564+ onClick = onClickEditInvoice,
565+ fullWidth = false ,
566+ color = Colors .White10 ,
567+ icon = {
568+ Icon (
569+ painter = painterResource(R .drawable.ic_pencil_simple),
570+ contentDescription = null ,
571+ tint = if (type == CopyAddressType .ONCHAIN ) Colors .Brand else Colors .Purple ,
572+ modifier = Modifier .size(18 .dp)
573+ )
574+ },
575+ modifier = Modifier
576+ .weight(1f )
577+ .testTag(" SpecifyInvoiceButton" )
578+ )
562579 Tooltip (
563580 text = stringResource(R .string.wallet__receive_copied),
564581 tooltipState = tooltipState,
565582 ) {
566- PrimaryButton (
567- text = stringResource(R .string.common__copy),
568- size = ButtonSize .Small ,
569- onClick = {
570- context.setClipboardText(address)
571- coroutineScope.launch { tooltipState.show() }
572- },
573- fullWidth = false ,
574- color = Colors .White10 ,
575- icon = {
576- Icon (
577- painter = painterResource(R .drawable.ic_copy),
578- contentDescription = null ,
579- tint = if (type == CopyAddressType .ONCHAIN ) Colors .Brand else Colors .Purple ,
580- modifier = Modifier .size(18 .dp)
581- )
582- },
583- )
583+ Box (modifier = Modifier .weight(1f )) {
584+ PrimaryButton (
585+ text = stringResource(R .string.common__copy),
586+ size = ButtonSize .Small ,
587+ onClick = {
588+ context.setClipboardText(address)
589+ coroutineScope.launch { tooltipState.show() }
590+ },
591+ fullWidth = false ,
592+ color = Colors .White10 ,
593+ icon = {
594+ Icon (
595+ painter = painterResource(R .drawable.ic_copy),
596+ contentDescription = null ,
597+ tint = if (type == CopyAddressType .ONCHAIN ) Colors .Brand else Colors .Purple ,
598+ modifier = Modifier .size(18 .dp)
599+ )
600+ },
601+ )
602+ }
584603 }
585604 PrimaryButton (
586605 text = stringResource(R .string.common__share),
@@ -810,6 +829,7 @@ private fun PreviewDetailsMode() {
810829 bolt11 = " lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79..." ,
811830 ),
812831 cjitInvoice = null ,
832+ onClickEditInvoice = {},
813833 modifier = Modifier .weight(1f )
814834 )
815835 }
0 commit comments