@@ -236,6 +236,7 @@ fun ReceiveQrScreen(
236236 tab = tab,
237237 walletState = walletState,
238238 cjitInvoice = cjitInvoice,
239+ onClickEditInvoice = onClickEditInvoice,
239240 modifier = Modifier .weight(1f )
240241 )
241242 }
@@ -458,6 +459,7 @@ private fun ReceiveDetailsView(
458459 tab : ReceiveTab ,
459460 walletState : MainUiState ,
460461 cjitInvoice : String? ,
462+ onClickEditInvoice : () -> Unit ,
461463 modifier : Modifier = Modifier ,
462464) {
463465 Card (
@@ -477,6 +479,7 @@ private fun ReceiveDetailsView(
477479 ),
478480 body = walletState.onchainAddress,
479481 type = CopyAddressType .ONCHAIN ,
482+ onClickEditInvoice = onClickEditInvoice,
480483 testTag = " ReceiveOnchainAddress" ,
481484 )
482485 }
@@ -493,6 +496,7 @@ private fun ReceiveDetailsView(
493496 ),
494497 body = walletState.onchainAddress,
495498 type = CopyAddressType .ONCHAIN ,
499+ onClickEditInvoice = onClickEditInvoice,
496500 testTag = " ReceiveOnchainAddress" ,
497501 )
498502 }
@@ -501,6 +505,7 @@ private fun ReceiveDetailsView(
501505 title = stringResource(R .string.wallet__receive_lightning_invoice),
502506 address = cjitInvoice ? : walletState.bolt11,
503507 type = CopyAddressType .LIGHTNING ,
508+ onClickEditInvoice = onClickEditInvoice,
504509 testTag = " ReceiveLightningAddress" ,
505510 )
506511 }
@@ -512,6 +517,7 @@ private fun ReceiveDetailsView(
512517 title = stringResource(R .string.wallet__receive_lightning_invoice),
513518 address = cjitInvoice ? : walletState.bolt11,
514519 type = CopyAddressType .LIGHTNING ,
520+ onClickEditInvoice = onClickEditInvoice,
515521 testTag = " ReceiveLightningAddress" ,
516522 )
517523 }
@@ -529,6 +535,7 @@ private fun CopyAddressCard(
529535 title : String ,
530536 address : String ,
531537 type : CopyAddressType ,
538+ onClickEditInvoice : () -> Unit ,
532539 body : String? = null,
533540 testTag : String? = null,
534541) {
@@ -559,28 +566,48 @@ private fun CopyAddressCard(
559566 Row (
560567 horizontalArrangement = Arrangement .spacedBy(16 .dp)
561568 ) {
569+ PrimaryButton (
570+ text = stringResource(R .string.common__edit),
571+ size = ButtonSize .Small ,
572+ onClick = onClickEditInvoice,
573+ fullWidth = false ,
574+ color = Colors .White10 ,
575+ icon = {
576+ Icon (
577+ painter = painterResource(R .drawable.ic_pencil_simple),
578+ contentDescription = null ,
579+ tint = if (type == CopyAddressType .ONCHAIN ) Colors .Brand else Colors .Purple ,
580+ modifier = Modifier .size(18 .dp)
581+ )
582+ },
583+ modifier = Modifier
584+ .weight(1f )
585+ .testTag(" SpecifyInvoiceButton" )
586+ )
562587 Tooltip (
563588 text = stringResource(R .string.wallet__receive_copied),
564589 tooltipState = tooltipState,
565590 ) {
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- )
591+ Box (modifier = Modifier .weight(1f )) {
592+ PrimaryButton (
593+ text = stringResource(R .string.common__copy),
594+ size = ButtonSize .Small ,
595+ onClick = {
596+ context.setClipboardText(address)
597+ coroutineScope.launch { tooltipState.show() }
598+ },
599+ fullWidth = false ,
600+ color = Colors .White10 ,
601+ icon = {
602+ Icon (
603+ painter = painterResource(R .drawable.ic_copy),
604+ contentDescription = null ,
605+ tint = if (type == CopyAddressType .ONCHAIN ) Colors .Brand else Colors .Purple ,
606+ modifier = Modifier .size(18 .dp)
607+ )
608+ },
609+ )
610+ }
584611 }
585612 PrimaryButton (
586613 text = stringResource(R .string.common__share),
@@ -810,6 +837,7 @@ private fun PreviewDetailsMode() {
810837 bolt11 = " lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79..." ,
811838 ),
812839 cjitInvoice = null ,
840+ onClickEditInvoice = {},
813841 modifier = Modifier .weight(1f )
814842 )
815843 }
0 commit comments