Better sharing for status and account close #837
This commit is contained in:
parent
df98e0f987
commit
1f14311c2c
|
@ -498,7 +498,7 @@ public struct AccountDetailView: View {
|
|||
}
|
||||
|
||||
if let url = account.url {
|
||||
ShareLink(item: url) {
|
||||
ShareLink(item: url, subject: Text(account.safeDisplayName)) {
|
||||
Label("account.action.share", systemImage: "square.and.arrow.up")
|
||||
}
|
||||
Button { UIApplication.shared.open(url) } label: {
|
||||
|
|
|
@ -63,8 +63,11 @@ struct StatusActionsView: View {
|
|||
HStack {
|
||||
ForEach(Actions.allCases, id: \.self) { action in
|
||||
if action == .share {
|
||||
if let url = viewModel.status.reblog?.url ?? viewModel.status.url {
|
||||
ShareLink(item: url) {
|
||||
if let urlString = viewModel.status.reblog?.url ?? viewModel.status.url,
|
||||
let url = URL(string: urlString) {
|
||||
ShareLink(item: url,
|
||||
subject: Text(viewModel.status.reblog?.account.safeDisplayName ?? viewModel.status.account.safeDisplayName),
|
||||
message: Text(viewModel.status.reblog?.content.asRawText ?? viewModel.status.content.asRawText)) {
|
||||
Image(systemName: action.iconName(viewModel: viewModel))
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
|
|
|
@ -57,8 +57,11 @@ struct StatusRowContextMenu: View {
|
|||
|
||||
Divider()
|
||||
|
||||
if let url = viewModel.status.reblog?.url ?? viewModel.status.url {
|
||||
ShareLink(item: url) {
|
||||
if let urlString = viewModel.status.reblog?.url ?? viewModel.status.url,
|
||||
let url = URL(string: urlString) {
|
||||
ShareLink(item: url,
|
||||
subject: Text(viewModel.status.reblog?.account.safeDisplayName ?? viewModel.status.account.safeDisplayName),
|
||||
message: Text(viewModel.status.reblog?.content.asRawText ?? viewModel.status.content.asRawText)) {
|
||||
Label("status.action.share", systemImage: "square.and.arrow.up")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue