fix: enable Pay by default and use M3ActionDialog for payment popups
- Enable Pay reaction in DefaultReactionRowItems (was disabled) - Replace DropdownMenu with M3ActionDialog + M3ActionSection + M3ActionRow in both PayReaction (reactions row) and PaymentButtonWithTargets (profile), matching the style of other note/profile action dialogs https://claude.ai/code/session_018G4g1cChqjeNEM5TztD3FE
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ val DefaultReactionRowItems =
|
||||
ReactionRowItem(ReactionRowAction.Like),
|
||||
ReactionRowItem(ReactionRowAction.Zap),
|
||||
ReactionRowItem(ReactionRowAction.Share, showCounter = false),
|
||||
ReactionRowItem(ReactionRowAction.Pay, enabled = false, showCounter = false),
|
||||
ReactionRowItem(ReactionRowAction.Pay, showCounter = false),
|
||||
)
|
||||
|
||||
fun getLanguagesSpokenByUser(): Set<String> {
|
||||
|
||||
@@ -56,8 +56,6 @@ import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ElevatedCard
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.LinearProgressIndicator
|
||||
@@ -127,6 +125,9 @@ import com.vitorpamplona.amethyst.ui.components.AnimatedBorderTextCornerRadius
|
||||
import com.vitorpamplona.amethyst.ui.components.ClickableBox
|
||||
import com.vitorpamplona.amethyst.ui.components.GenericLoadable
|
||||
import com.vitorpamplona.amethyst.ui.components.InLineIconRenderer
|
||||
import com.vitorpamplona.amethyst.ui.components.M3ActionDialog
|
||||
import com.vitorpamplona.amethyst.ui.components.M3ActionRow
|
||||
import com.vitorpamplona.amethyst.ui.components.M3ActionSection
|
||||
import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage
|
||||
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
||||
import com.vitorpamplona.amethyst.ui.navigation.routes.Route
|
||||
@@ -360,7 +361,6 @@ fun PayReaction(
|
||||
val uri = LocalUriHandler.current
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
|
||||
Box {
|
||||
ClickableBox(
|
||||
modifier = iconSizeModifier,
|
||||
onClick = { expanded = true },
|
||||
@@ -373,15 +373,16 @@ fun PayReaction(
|
||||
)
|
||||
}
|
||||
|
||||
DropdownMenu(
|
||||
expanded = expanded,
|
||||
onDismissRequest = { expanded = false },
|
||||
if (expanded) {
|
||||
M3ActionDialog(
|
||||
title = stringRes(R.string.payment_targets),
|
||||
onDismiss = { expanded = false },
|
||||
) {
|
||||
M3ActionSection {
|
||||
targets.forEach { target ->
|
||||
DropdownMenuItem(
|
||||
text = {
|
||||
Text("${target.type.replaceFirstChar(Char::titlecase)}: ${target.authority}")
|
||||
},
|
||||
M3ActionRow(
|
||||
icon = Icons.Outlined.AccountBalanceWallet,
|
||||
text = "${target.type.replaceFirstChar(Char::titlecase)}: ${target.authority}",
|
||||
onClick = {
|
||||
expanded = false
|
||||
runCatching {
|
||||
@@ -394,6 +395,7 @@ fun PayReaction(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun GenericInnerReactionRow(
|
||||
|
||||
+12
-12
@@ -20,16 +20,12 @@
|
||||
*/
|
||||
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header
|
||||
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.AccountBalanceWallet
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -40,6 +36,9 @@ import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.vitorpamplona.amethyst.R
|
||||
import com.vitorpamplona.amethyst.model.User
|
||||
import com.vitorpamplona.amethyst.ui.components.M3ActionDialog
|
||||
import com.vitorpamplona.amethyst.ui.components.M3ActionRow
|
||||
import com.vitorpamplona.amethyst.ui.components.M3ActionSection
|
||||
import com.vitorpamplona.amethyst.ui.note.LoadAddressableNote
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||
import com.vitorpamplona.amethyst.ui.stringRes
|
||||
@@ -73,7 +72,6 @@ fun PaymentButtonWithTargets(targets: List<PaymentTarget>) {
|
||||
val uri = LocalUriHandler.current
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
|
||||
Box {
|
||||
FilledTonalButton(
|
||||
modifier =
|
||||
Modifier
|
||||
@@ -88,15 +86,16 @@ fun PaymentButtonWithTargets(targets: List<PaymentTarget>) {
|
||||
)
|
||||
}
|
||||
|
||||
DropdownMenu(
|
||||
expanded = expanded,
|
||||
onDismissRequest = { expanded = false },
|
||||
if (expanded) {
|
||||
M3ActionDialog(
|
||||
title = stringRes(R.string.payment_targets),
|
||||
onDismiss = { expanded = false },
|
||||
) {
|
||||
M3ActionSection {
|
||||
targets.forEach { target ->
|
||||
DropdownMenuItem(
|
||||
text = {
|
||||
Text("${target.type.replaceFirstChar(Char::titlecase)}: ${target.authority}")
|
||||
},
|
||||
M3ActionRow(
|
||||
icon = Icons.Outlined.AccountBalanceWallet,
|
||||
text = "${target.type.replaceFirstChar(Char::titlecase)}: ${target.authority}",
|
||||
onClick = {
|
||||
expanded = false
|
||||
runCatching {
|
||||
@@ -108,3 +107,4 @@ fun PaymentButtonWithTargets(targets: List<PaymentTarget>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user