feat: add details button to receive
This commit is contained in:
@@ -59,7 +59,10 @@ import com.bitcointxoko.gudariwallet.util.fiatLabel
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
@Composable
|
||||
fun ReceiveScreen(vm: WalletViewModel) {
|
||||
fun ReceiveScreen(
|
||||
vm: WalletViewModel,
|
||||
onNavigateToPaymentDetail : (checkingId: String) -> Unit
|
||||
) {
|
||||
val receiveState by vm.receiveState.collectAsStateWithLifecycle()
|
||||
val lightningAddress by vm.lightningAddress.collectAsStateWithLifecycle()
|
||||
val fiatRate by vm.fiatSatsPerUnit.collectAsStateWithLifecycle()
|
||||
@@ -141,7 +144,8 @@ fun ReceiveScreen(vm: WalletViewModel) {
|
||||
memo = state.memo,
|
||||
fiatRate = fiatRate,
|
||||
fiatCurrency = fiatCurrency,
|
||||
onDone = { vm.resetReceiveState() }
|
||||
onDone = { vm.resetReceiveState() },
|
||||
onDetails = { onNavigateToPaymentDetail(state.checkingId) }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -655,7 +659,8 @@ private fun ReceiveSuccessContent(
|
||||
memo : String?,
|
||||
fiatRate : Double?,
|
||||
fiatCurrency : String?,
|
||||
onDone : () -> Unit
|
||||
onDone : () -> Unit,
|
||||
onDetails : () -> Unit
|
||||
) {
|
||||
val fiatLabel = fiatLabel(amountSats, fiatRate, fiatCurrency)
|
||||
|
||||
@@ -680,7 +685,11 @@ private fun ReceiveSuccessContent(
|
||||
Text(memo, style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
Spacer(Modifier.height(32.dp))
|
||||
Button(onClick = onDone, modifier = Modifier.fillMaxWidth()) {
|
||||
Button(onClick = onDetails, modifier = Modifier.fillMaxWidth()) {
|
||||
Text("Details")
|
||||
}
|
||||
Spacer(Modifier.height(32.dp))
|
||||
TextButton(onClick = onDone, modifier = Modifier.fillMaxWidth()) {
|
||||
Text("Done")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ sealed class ReceiveState {
|
||||
) : ReceiveState()
|
||||
data class PaymentReceived(
|
||||
val amountSats: Long,
|
||||
val memo : String?
|
||||
val memo : String?,
|
||||
val checkingId : String
|
||||
) : ReceiveState()
|
||||
data class Error(val message: String) : ReceiveState()
|
||||
data class LnurlWithdrawReady(
|
||||
|
||||
@@ -265,7 +265,12 @@ fun WalletScreen(
|
||||
}
|
||||
)
|
||||
}
|
||||
composable(TabItem.Receive.route) { ReceiveScreen(vm) }
|
||||
composable(TabItem.Receive.route) { ReceiveScreen(
|
||||
vm,
|
||||
onNavigateToPaymentDetail = { checkingId ->
|
||||
navController.navigate("payment_detail/$checkingId")
|
||||
}
|
||||
)}
|
||||
composable(TabItem.Send.route) { SendScreen(vm) }
|
||||
|
||||
// Scanner — full screen, no bottom chrome
|
||||
|
||||
@@ -342,7 +342,8 @@ class WalletViewModel(
|
||||
Log.d(TAG, "BALANCE [WS RECEIVE] Marking invoice ${rs.paymentHash.take(8)}… as received")
|
||||
_receiveState.value = ReceiveState.PaymentReceived(
|
||||
amountSats = event.amountSats,
|
||||
memo = event.memo
|
||||
memo = event.memo,
|
||||
checkingId = rs.paymentHash
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user