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