Moves the clipboard starters to their own compositions.

This commit is contained in:
Vitor Pamplona 2023-06-09 13:19:14 -04:00
parent e3d83fe39a
commit c158c7fc3d
3 changed files with 11 additions and 9 deletions

View File

@ -812,9 +812,6 @@ fun RenderAppDefinition(
) {
val noteEvent = note.event as? AppDefinitionEvent ?: return
val clipboardManager = LocalClipboardManager.current
val uri = LocalUriHandler.current
var metadata by remember {
mutableStateOf<UserMetadata?>(null)
}
@ -827,6 +824,9 @@ fun RenderAppDefinition(
metadata?.let {
Box {
val clipboardManager = LocalClipboardManager.current
val uri = LocalUriHandler.current
if (!it.banner.isNullOrBlank()) {
var zoomImageDialogOpen by remember { mutableStateOf(false) }
@ -2797,9 +2797,6 @@ data class DropDownParams(
@Composable
fun NoteDropDownMenu(note: Note, popupExpanded: Boolean, onDismiss: () -> Unit, accountViewModel: AccountViewModel) {
val clipboardManager = LocalClipboardManager.current
val appContext = LocalContext.current.applicationContext
val actContext = LocalContext.current
var reportDialogShowing by remember { mutableStateOf(false) }
var state by remember {
@ -2819,6 +2816,10 @@ fun NoteDropDownMenu(note: Note, popupExpanded: Boolean, onDismiss: () -> Unit,
expanded = popupExpanded,
onDismissRequest = onDismiss
) {
val clipboardManager = LocalClipboardManager.current
val appContext = LocalContext.current.applicationContext
val actContext = LocalContext.current
WatchBookmarksFollowsAndAccount(note, accountViewModel) { newState ->
if (state != newState) {
state = newState

View File

@ -478,7 +478,6 @@ private fun ChannelActionOptions(
private fun NoteCopyButton(
note: Channel
) {
val clipboardManager = LocalClipboardManager.current
var popupExpanded by remember { mutableStateOf(false) }
Button(
@ -502,6 +501,8 @@ private fun NoteCopyButton(
expanded = popupExpanded,
onDismissRequest = { popupExpanded = false }
) {
val clipboardManager = LocalClipboardManager.current
DropdownMenuItem(onClick = { clipboardManager.setText(AnnotatedString("nostr:" + note.idNote())); popupExpanded = false }) {
Text(stringResource(R.string.copy_channel_id_note_to_the_clipboard))
}

View File

@ -425,8 +425,6 @@ private fun ProfileHeader(
var popupExpanded by remember { mutableStateOf(false) }
var zoomImageDialogOpen by remember { mutableStateOf(false) }
val clipboardManager = LocalClipboardManager.current
Box {
DrawBanner(baseUser)
@ -468,6 +466,8 @@ private fun ProfileHeader(
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.Bottom
) {
val clipboardManager = LocalClipboardManager.current
UserPicture(
baseUser = baseUser,
accountViewModel = accountViewModel,