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