mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-07-22 07:48:27 +00:00
Revert "feat: replace zap button long-press-to-edit with long-press-to-custom"
This reverts commit 86a8fb0743.
This commit is contained in:
@@ -170,9 +170,6 @@ fun ReusableZapButton(
|
||||
onChangeAmount = {
|
||||
wantsToZap = null
|
||||
},
|
||||
onCustomAmount = {
|
||||
wantsToZap = null
|
||||
},
|
||||
onError = { _, message, user ->
|
||||
scope.launch {
|
||||
zappingProgress = 0f
|
||||
|
||||
@@ -1242,7 +1242,8 @@ fun ZapReaction(
|
||||
)
|
||||
}
|
||||
},
|
||||
onLongClick = { wantsToSetCustomZap = true },
|
||||
onLongClick = { nav.nav(Route.UpdateZapAmount()) },
|
||||
onDoubleClick = { wantsToSetCustomZap = true },
|
||||
),
|
||||
) {
|
||||
if (wantsToZap) {
|
||||
@@ -1261,12 +1262,6 @@ fun ZapReaction(
|
||||
nav.nav(Route.UpdateZapAmount())
|
||||
}
|
||||
},
|
||||
onCustomAmount = {
|
||||
scope.launch {
|
||||
wantsToZap = false
|
||||
wantsToSetCustomZap = true
|
||||
}
|
||||
},
|
||||
onError = { _, message, user ->
|
||||
scope.launch {
|
||||
zappingProgress = 0f
|
||||
@@ -1891,7 +1886,6 @@ fun ZapAmountChoicePopup(
|
||||
onZapStarts: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
onChangeAmount: () -> Unit,
|
||||
onCustomAmount: () -> Unit,
|
||||
onError: (title: String, text: String, user: User?) -> Unit,
|
||||
onProgress: (percent: Float) -> Unit,
|
||||
onPayViaIntent: (ImmutableList<ZapPaymentHandler.Payable>) -> Unit,
|
||||
@@ -1900,7 +1894,7 @@ fun ZapAmountChoicePopup(
|
||||
accountViewModel.account.settings.syncedSettings.zaps.zapAmountChoices
|
||||
.collectAsStateWithLifecycle()
|
||||
|
||||
ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, onZapStarts, onDismiss, onChangeAmount, onCustomAmount, onError, onProgress, onPayViaIntent)
|
||||
ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, onZapStarts, onDismiss, onChangeAmount, onError, onProgress, onPayViaIntent)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -1912,13 +1906,12 @@ fun ZapAmountChoicePopup(
|
||||
onZapStarts: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
onChangeAmount: () -> Unit,
|
||||
onCustomAmount: () -> Unit,
|
||||
onError: (title: String, text: String, user: User?) -> Unit,
|
||||
onProgress: (percent: Float) -> Unit,
|
||||
onPayViaIntent: (ImmutableList<ZapPaymentHandler.Payable>) -> Unit,
|
||||
) {
|
||||
val visibilityState = rememberVisibilityState(onDismiss)
|
||||
ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, visibilityState, onZapStarts, onChangeAmount, onCustomAmount, onError, onProgress, onPayViaIntent)
|
||||
ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, visibilityState, onZapStarts, onChangeAmount, onError, onProgress, onPayViaIntent)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class, ExperimentalLayoutApi::class)
|
||||
@@ -1931,7 +1924,6 @@ fun ZapAmountChoicePopup(
|
||||
visibilityState: MutableTransitionState<Boolean>,
|
||||
onZapStarts: () -> Unit,
|
||||
onChangeAmount: () -> Unit,
|
||||
onCustomAmount: () -> Unit,
|
||||
onError: (title: String, text: String, user: User?) -> Unit,
|
||||
onProgress: (percent: Float) -> Unit,
|
||||
onPayViaIntent: (ImmutableList<ZapPaymentHandler.Payable>) -> Unit,
|
||||
@@ -1968,10 +1960,6 @@ fun ZapAmountChoicePopup(
|
||||
visibilityState.targetState = false
|
||||
},
|
||||
onChangeAmount = onChangeAmount,
|
||||
onCustomAmount = {
|
||||
visibilityState.targetState = false
|
||||
onCustomAmount()
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1983,7 +1971,6 @@ fun ZapAmountChoicePopupContent(
|
||||
zapAmountChoices: ImmutableList<Long>,
|
||||
onZap: (Long) -> Unit,
|
||||
onChangeAmount: () -> Unit,
|
||||
onCustomAmount: () -> Unit,
|
||||
) {
|
||||
Box(HalfPadding, contentAlignment = Center) {
|
||||
ElevatedCard(
|
||||
@@ -2001,7 +1988,7 @@ fun ZapAmountChoicePopupContent(
|
||||
ZapAmountChip(
|
||||
amountInSats = amountInSats,
|
||||
onClick = { onZap(amountInSats) },
|
||||
onLongClick = onCustomAmount,
|
||||
onLongClick = onChangeAmount,
|
||||
)
|
||||
}
|
||||
ClickableBox(
|
||||
@@ -2068,7 +2055,6 @@ fun ZapAmountChoicePopupPreview() {
|
||||
zapAmountChoices = persistentListOf(50L, 100L, 500L, 1_000L, 5_000L, 10_000L, 100_000L),
|
||||
onZap = {},
|
||||
onChangeAmount = {},
|
||||
onCustomAmount = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,9 +437,10 @@ private fun EndCluster(
|
||||
* applies the user's configured zap amount choices the same way the
|
||||
* normal note ⚡ button does (single-tap fires the default amount;
|
||||
* multi-choice opens [ZapAmountChoicePopup]; an unconfigured account
|
||||
* opens [ZapCustomDialog]). Inside the multi-choice popup the Tune
|
||||
* button jumps to the [Route.UpdateZapAmount] settings screen and
|
||||
* long-press on a chip opens [ZapCustomDialog].
|
||||
* opens [ZapCustomDialog]). Long-press routes to the
|
||||
* [Route.UpdateZapAmount] settings screen via the activity's
|
||||
* [BouncingIntentNav] (no-op when the route can't be expressed as a
|
||||
* `nostr:` URI — same fallback as the chat panel uses).
|
||||
*/
|
||||
@OptIn(ExperimentalUuidApi::class)
|
||||
@Composable
|
||||
@@ -536,12 +537,6 @@ private fun NestZapButton(
|
||||
nav.nav(Route.UpdateZapAmount())
|
||||
}
|
||||
},
|
||||
onCustomAmount = {
|
||||
scope.launch {
|
||||
wantsToZap = false
|
||||
wantsToSetCustomZap = true
|
||||
}
|
||||
},
|
||||
onError = { _, message, user ->
|
||||
scope.launch {
|
||||
zappingProgress = 0f
|
||||
|
||||
Reference in New Issue
Block a user