Add context menu action to remove pinned timeline

Closes #334
This commit is contained in:
Shadowfacts 2023-01-24 10:19:04 -05:00
parent f88bf552af
commit 6eee97759e
1 changed files with 7 additions and 0 deletions

View File

@ -45,6 +45,13 @@ struct PinnedTimelinesView: View {
.foregroundColor(Color(.lightGray)) .foregroundColor(Color(.lightGray))
.accessibilityHidden(true) .accessibilityHidden(true)
} }
.contextMenu {
Button(role: .destructive) {
pinnedTimelines.removeAll(where: { $0.id == timeline.id })
} label: {
Label("Remove Pinned Timeline", systemImage: "trash")
}
}
} }
.onMove { indices, newOffset in .onMove { indices, newOffset in
pinnedTimelines.move(fromOffsets: indices, toOffset: newOffset) pinnedTimelines.move(fromOffsets: indices, toOffset: newOffset)