feat(apple): In resources list, tapping on a list item shows a 'Copy Address' menu (#4050)

Previousy, tapping on a resource list item in iOS copied the resource
address.

In this PR, tapping on a resource list item in iOS shows a menu with
"Copy Address", tapping on which copies the resource address.

Fixes #3998.
This commit is contained in:
Roopesh Chander
2024-03-08 19:45:33 +05:30
committed by GitHub
parent eff56ecb46
commit 822a30cd93

View File

@@ -124,21 +124,21 @@ import SwiftUI
Text("No resources")
} else {
ForEach(self.model.orderedResources) { resource in
HStack {
Text(resource.name)
Spacer()
Text(resource.location)
.foregroundColor(.secondary)
Button(
role: .none,
action: { self.copyResourceTapped(resource) },
label: {
Label("", systemImage: "doc.on.doc")
.symbolRenderingMode(.monochrome)
.foregroundColor(.secondary)
}
)
}
Menu(content: {
Button {
self.copyResourceTapped(resource)
} label: {
Label("Copy Address", systemImage: "doc.on.doc")
}
}, label : {
HStack {
Text(resource.name)
.foregroundColor(.primary)
Spacer()
Text(resource.location)
.foregroundColor(.secondary)
}
})
}
}
}