@@ -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 }
@@ -354,31 +354,36 @@ private fun ReceiveQrView(
354354 modifier = Modifier .size(18 .dp)
355355 )
356356 },
357- modifier = Modifier .testTag(" SpecifyInvoiceButton" )
357+ modifier = Modifier
358+ .weight(1f )
359+ .testTag(" SpecifyInvoiceButton" )
358360 )
359- Tooltip (
360- text = stringResource(R .string.wallet__receive_copied),
361- tooltipState = qrButtonTooltipState
362- ) {
363- PrimaryButton (
364- text = stringResource(R .string.common__copy),
365- size = ButtonSize .Small ,
366- onClick = {
367- context.setClipboardText(uri)
368- coroutineScope.launch { qrButtonTooltipState.show() }
369- },
370- fullWidth = false ,
371- color = Colors .White10 ,
372- icon = {
373- Icon (
374- painter = painterResource(R .drawable.ic_copy),
375- contentDescription = null ,
376- tint = tab.accentColor,
377- modifier = Modifier .size(18 .dp)
378- )
379- },
380- modifier = Modifier .testTag(" ReceiveCopyQR" )
381- )
361+ Box (modifier = Modifier .weight(1f )) {
362+ Tooltip (
363+ text = stringResource(R .string.wallet__receive_copied),
364+ tooltipState = qrButtonTooltipState
365+ ) {
366+ PrimaryButton (
367+ text = stringResource(R .string.common__copy),
368+ size = ButtonSize .Small ,
369+ onClick = {
370+ context.setClipboardText(uri)
371+ coroutineScope.launch { qrButtonTooltipState.show() }
372+ },
373+ fullWidth = true ,
374+ color = Colors .White10 ,
375+ icon = {
376+ Icon (
377+ painter = painterResource(R .drawable.ic_copy),
378+ contentDescription = null ,
379+ tint = tab.accentColor,
380+ modifier = Modifier .size(18 .dp)
381+ )
382+ },
383+ modifier = Modifier
384+ .testTag(" ReceiveCopyQR" )
385+ )
386+ }
382387 }
383388 PrimaryButton (
384389 text = stringResource(R .string.common__share),
@@ -398,6 +403,7 @@ private fun ReceiveQrView(
398403 modifier = Modifier .size(18 .dp)
399404 )
400405 },
406+ modifier = Modifier .weight(1f )
401407 )
402408 }
403409 Spacer (modifier = Modifier .height(16 .dp))
@@ -452,6 +458,7 @@ private fun ReceiveDetailsView(
452458 tab : ReceiveTab ,
453459 walletState : MainUiState ,
454460 cjitInvoice : String? ,
461+ onClickEditInvoice : () -> Unit ,
455462 modifier : Modifier = Modifier ,
456463) {
457464 Card (
@@ -471,6 +478,7 @@ private fun ReceiveDetailsView(
471478 ),
472479 body = walletState.onchainAddress,
473480 type = CopyAddressType .ONCHAIN ,
481+ onClickEditInvoice = onClickEditInvoice,
474482 testTag = " ReceiveOnchainAddress" ,
475483 )
476484 }
@@ -487,6 +495,7 @@ private fun ReceiveDetailsView(
487495 ),
488496 body = walletState.onchainAddress,
489497 type = CopyAddressType .ONCHAIN ,
498+ onClickEditInvoice = onClickEditInvoice,
490499 testTag = " ReceiveOnchainAddress" ,
491500 )
492501 }
@@ -495,6 +504,7 @@ private fun ReceiveDetailsView(
495504 title = stringResource(R .string.wallet__receive_lightning_invoice),
496505 address = cjitInvoice ? : walletState.bolt11,
497506 type = CopyAddressType .LIGHTNING ,
507+ onClickEditInvoice = onClickEditInvoice,
498508 testTag = " ReceiveLightningAddress" ,
499509 )
500510 }
@@ -506,6 +516,7 @@ private fun ReceiveDetailsView(
506516 title = stringResource(R .string.wallet__receive_lightning_invoice),
507517 address = cjitInvoice ? : walletState.bolt11,
508518 type = CopyAddressType .LIGHTNING ,
519+ onClickEditInvoice = onClickEditInvoice,
509520 testTag = " ReceiveLightningAddress" ,
510521 )
511522 }
@@ -523,6 +534,7 @@ private fun CopyAddressCard(
523534 title : String ,
524535 address : String ,
525536 type : CopyAddressType ,
537+ onClickEditInvoice : () -> Unit ,
526538 body : String? = null,
527539 testTag : String? = null,
528540) {
@@ -536,14 +548,7 @@ private fun CopyAddressCard(
536548 .fillMaxWidth()
537549 .padding(24 .dp)
538550 ) {
539- Row {
540- Caption13Up (text = title, color = Colors .White64 )
541-
542- Spacer (modifier = Modifier .width(3 .dp))
543-
544- val iconRes = if (type == CopyAddressType .ONCHAIN ) R .drawable.ic_bitcoin else R .drawable.ic_lightning_alt
545- Icon (painter = painterResource(iconRes), contentDescription = null , tint = Colors .White64 )
546- }
551+ Caption13Up (text = title, color = Colors .White64 )
547552 Spacer (modifier = Modifier .height(16 .dp))
548553 BodyS (
549554 text = (body ? : address).truncate(32 ).uppercase(),
@@ -553,28 +558,48 @@ private fun CopyAddressCard(
553558 Row (
554559 horizontalArrangement = Arrangement .spacedBy(16 .dp)
555560 ) {
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+ )
556579 Tooltip (
557580 text = stringResource(R .string.wallet__receive_copied),
558581 tooltipState = tooltipState,
559582 ) {
560- PrimaryButton (
561- text = stringResource(R .string.common__copy),
562- size = ButtonSize .Small ,
563- onClick = {
564- context.setClipboardText(address)
565- coroutineScope.launch { tooltipState.show() }
566- },
567- fullWidth = false ,
568- color = Colors .White10 ,
569- icon = {
570- Icon (
571- painter = painterResource(R .drawable.ic_copy),
572- contentDescription = null ,
573- tint = if (type == CopyAddressType .ONCHAIN ) Colors .Brand else Colors .Purple ,
574- modifier = Modifier .size(18 .dp)
575- )
576- },
577- )
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+ }
578603 }
579604 PrimaryButton (
580605 text = stringResource(R .string.common__share),
@@ -804,6 +829,7 @@ private fun PreviewDetailsMode() {
804829 bolt11 = " lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79..." ,
805830 ),
806831 cjitInvoice = null ,
832+ onClickEditInvoice = {},
807833 modifier = Modifier .weight(1f )
808834 )
809835 }
0 commit comments