mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-19 19:21:32 +02:00
Small code cleanups
This commit is contained in:
@@ -257,7 +257,6 @@ private fun ProfileHeader(
|
||||
account: Account,
|
||||
accountViewModel: AccountViewModel
|
||||
) {
|
||||
val ctx = LocalContext.current.applicationContext
|
||||
var popupExpanded by remember { mutableStateOf(false) }
|
||||
var zoomImageDialogOpen by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -414,7 +413,7 @@ private fun DrawAdditionalInfo(baseUser: User, account: Account) {
|
||||
}
|
||||
}
|
||||
|
||||
var ZapExpanded by remember { mutableStateOf(false) }
|
||||
var zapExpanded by remember { mutableStateOf(false) }
|
||||
|
||||
val lud16 = user.info?.lud16?.trim() ?: user.info?.lud06?.trim()
|
||||
|
||||
@@ -429,7 +428,7 @@ private fun DrawAdditionalInfo(baseUser: User, account: Account) {
|
||||
|
||||
ClickableText(
|
||||
text = AnnotatedString(lud16),
|
||||
onClick = { ZapExpanded = !ZapExpanded },
|
||||
onClick = { zapExpanded = !zapExpanded },
|
||||
style = LocalTextStyle.current.copy(color = MaterialTheme.colors.primary),
|
||||
modifier = Modifier
|
||||
.padding(top = 1.dp, bottom = 1.dp, start = 5.dp)
|
||||
@@ -437,10 +436,10 @@ private fun DrawAdditionalInfo(baseUser: User, account: Account) {
|
||||
)
|
||||
}
|
||||
|
||||
if (ZapExpanded) {
|
||||
if (zapExpanded) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding(vertical = 5.dp)) {
|
||||
InvoiceRequest(lud16, baseUser.pubkeyHex, account) {
|
||||
ZapExpanded = false
|
||||
zapExpanded = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,7 +447,7 @@ private fun DrawAdditionalInfo(baseUser: User, account: Account) {
|
||||
|
||||
user.info?.about?.let {
|
||||
Text(
|
||||
"$it",
|
||||
it,
|
||||
color = MaterialTheme.colors.onSurface,
|
||||
modifier = Modifier.padding(top = 5.dp, bottom = 5.dp)
|
||||
)
|
||||
@@ -465,7 +464,7 @@ private fun DrawBanner(baseUser: User) {
|
||||
val clipboardManager = LocalClipboardManager.current
|
||||
var zoomImageDialogOpen by remember { mutableStateOf(false) }
|
||||
|
||||
if (banner != null && banner.isNotBlank()) {
|
||||
if (!banner.isNullOrBlank()) {
|
||||
AsyncImageProxy(
|
||||
model = ResizeImage(banner, 125.dp),
|
||||
contentDescription = stringResource(id = R.string.profile_image),
|
||||
@@ -817,35 +816,35 @@ fun UserProfileDropDownMenu(user: User, popupExpanded: Boolean, onDismiss: () ->
|
||||
}
|
||||
Divider()
|
||||
DropdownMenuItem(onClick = {
|
||||
accountViewModel.report(user, ReportEvent.ReportType.SPAM);
|
||||
accountViewModel.report(user, ReportEvent.ReportType.SPAM)
|
||||
user.let { accountViewModel.hide(it, context) }
|
||||
onDismiss()
|
||||
}) {
|
||||
Text(stringResource(id = R.string.report_spam_scam))
|
||||
}
|
||||
DropdownMenuItem(onClick = {
|
||||
accountViewModel.report(user, ReportEvent.ReportType.PROFANITY);
|
||||
accountViewModel.report(user, ReportEvent.ReportType.PROFANITY)
|
||||
user.let { accountViewModel.hide(it, context) }
|
||||
onDismiss()
|
||||
}) {
|
||||
Text(stringResource(R.string.report_hateful_speech))
|
||||
}
|
||||
DropdownMenuItem(onClick = {
|
||||
accountViewModel.report(user, ReportEvent.ReportType.IMPERSONATION);
|
||||
accountViewModel.report(user, ReportEvent.ReportType.IMPERSONATION)
|
||||
user.let { accountViewModel.hide(it, context) }
|
||||
onDismiss()
|
||||
}) {
|
||||
Text(stringResource(id = R.string.report_impersonation))
|
||||
}
|
||||
DropdownMenuItem(onClick = {
|
||||
accountViewModel.report(user, ReportEvent.ReportType.NUDITY);
|
||||
accountViewModel.report(user, ReportEvent.ReportType.NUDITY)
|
||||
user.let { accountViewModel.hide(it, context) }
|
||||
onDismiss()
|
||||
}) {
|
||||
Text(stringResource(R.string.report_nudity_porn))
|
||||
}
|
||||
DropdownMenuItem(onClick = {
|
||||
accountViewModel.report(user, ReportEvent.ReportType.ILLEGAL);
|
||||
accountViewModel.report(user, ReportEvent.ReportType.ILLEGAL)
|
||||
user.let { accountViewModel.hide(it, context) }
|
||||
onDismiss()
|
||||
}) {
|
||||
|
Reference in New Issue
Block a user