mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
feat(profile): inline Lightning Address + LNURL fields in Edit Profile
Promote the two lightning fields out of an expandable section so they sit alongside name/about/nip05/website as regular always-visible inputs. https://claude.ai/code/session_01R2E6rMfhxKA8csVarjxKJd
This commit is contained in:
+29
-39
@@ -73,7 +73,6 @@ fun NewUserMetadataScreen(
|
||||
val context = LocalContext.current
|
||||
|
||||
val socialExpanded = rememberSaveable { mutableStateOf(false) }
|
||||
val lightningExpanded = rememberSaveable { mutableStateOf(false) }
|
||||
|
||||
LaunchedEffect(postViewModel, accountViewModel) {
|
||||
postViewModel.load()
|
||||
@@ -82,11 +81,6 @@ fun NewUserMetadataScreen(
|
||||
if (postViewModel.twitter.value.isNotBlank() || postViewModel.mastodon.value.isNotBlank() || postViewModel.github.value.isNotBlank()) {
|
||||
socialExpanded.value = true
|
||||
}
|
||||
|
||||
// Auto-expand lightning if any has data
|
||||
if (postViewModel.lnAddress.value.isNotBlank() || postViewModel.lnURL.value.isNotBlank()) {
|
||||
lightningExpanded.value = true
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
@@ -277,41 +271,37 @@ fun NewUserMetadataScreen(
|
||||
singleLine = true,
|
||||
)
|
||||
|
||||
// -- Lightning --
|
||||
ExpandableSection(
|
||||
title = stringRes(R.string.lightning_address),
|
||||
expanded = lightningExpanded,
|
||||
) {
|
||||
OutlinedTextField(
|
||||
label = { Text(text = stringRes(R.string.lightning_address)) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
value = postViewModel.lnAddress.value,
|
||||
onValueChange = { postViewModel.lnAddress.value = it },
|
||||
placeholder = {
|
||||
Text(
|
||||
text = "me@mylightningnode.com",
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
)
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
OutlinedTextField(
|
||||
label = { Text(text = stringRes(R.string.lightning_address)) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
value = postViewModel.lnAddress.value,
|
||||
onValueChange = { postViewModel.lnAddress.value = it },
|
||||
placeholder = {
|
||||
Text(
|
||||
text = "me@mylightningnode.com",
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
)
|
||||
|
||||
OutlinedTextField(
|
||||
label = { Text(text = stringRes(R.string.lnurl)) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
value = postViewModel.lnURL.value,
|
||||
onValueChange = { postViewModel.lnURL.value = it },
|
||||
placeholder = {
|
||||
Text(
|
||||
text = "LNURL1…",
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
|
||||
OutlinedTextField(
|
||||
label = { Text(text = stringRes(R.string.lnurl)) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
value = postViewModel.lnURL.value,
|
||||
onValueChange = { postViewModel.lnURL.value = it },
|
||||
placeholder = {
|
||||
Text(
|
||||
text = "LNURL1…",
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
)
|
||||
|
||||
// -- Social Proofs --
|
||||
ExpandableSection(
|
||||
|
||||
Reference in New Issue
Block a user