diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayerViewer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayerViewer.swift index 11451ee2e..75f41b36a 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayerViewer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayerViewer.swift @@ -55,7 +55,8 @@ .aspectRatio(contentMode: .fit) .font(Font.title.weight(.light)) } - )) + ).buttonStyle(.plain) + ) } } @@ -78,6 +79,7 @@ } } ) + .buttonStyle(.plain) .background(Color.clear) .buttonStyle(PlainButtonStyle()) } diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift index 4eff7787d..b0015fd07 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift @@ -125,7 +125,7 @@ struct ApplyLabelsView: View { label: { HStack { let trimmedLabelName = viewModel.labelSearchFilter.trimmingCharacters(in: .whitespacesAndNewlines) - Image(systemName: "tag").foregroundColor(.blue) + Image.addLink.foregroundColor(.blue).foregroundColor(.blue) Text( viewModel.labelSearchFilter.count > 0 ? "Create: \"\(trimmedLabelName)\" label" : diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift index f18fd6335..e7474c1ad 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift @@ -34,8 +34,6 @@ struct LabelsView: View { } Section("Label settings") { Toggle("Hide system labels", isOn: $hideSystemLabels) - }.onChange(of: hideSystemLabels) { newValue in - PublicValet.hideLabels = newValue } } .navigationTitle(LocalText.labelsGeneric) @@ -54,11 +52,13 @@ struct LabelsView: View { } Button(LocalText.cancelGeneric, role: .cancel) { self.labelToRemove = nil } } -// .onChange(of: hideSystemLabels) { _ in -// Task { -// await viewModel.loadLabels(dataService: dataService, item: nil) -// } -// } + .onChange(of: hideSystemLabels) { newValue in + PublicValet.hideLabels = newValue + + Task { + await viewModel.loadLabels(dataService: dataService, item: nil) + } + } .onReceive(NotificationCenter.default.publisher(for: Notification.Name("ScrollToTop"))) { _ in dismiss() } @@ -72,25 +72,19 @@ struct LabelsView: View { Button( action: { viewModel.showCreateLabelModal = true }, label: { - HStack { + Label(title: { let trimmedLabelName = viewModel.labelSearchFilter.trimmingCharacters(in: .whitespacesAndNewlines) - Image(systemName: "tag").foregroundColor(.blue) Text( viewModel.labelSearchFilter.count > 0 && viewModel.labelSearchFilter != ZWSP ? "Create: \"\(trimmedLabelName)\" label" : LocalText.createLabelMessage - ).foregroundColor(.blue) - .font(Font.system(size: 14)) - Spacer() - } + ) + }, icon: { + Image.addLink + }) } ) - .buttonStyle(PlainButtonStyle()) .disabled(viewModel.isLoading) - #if os(iOS) - .listRowSeparator(.hidden, edges: .bottom) - #endif - .padding(.vertical, 10) } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/ClubsView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/ClubsView.swift index a36567585..d41fbfa66 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/ClubsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/ClubsView.swift @@ -149,11 +149,11 @@ Button( action: { viewModel.showCreateSheet = true }, label: { - HStack { - Image(systemName: "plus.circle.fill").foregroundColor(.green) + Label(title: { Text(LocalText.clubsCreate) - Spacer() - } + }, icon: { + Image.addLink + }) } ) } diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationDevicesView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationDevicesView.swift index 0d2a1d485..25dccecf6 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationDevicesView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationDevicesView.swift @@ -63,6 +63,14 @@ struct PushNotificationDevicesView: View { } private var innerBody: some View { + if viewModel.devices.isEmpty { + AnyView(Text("No devices registered")) + } else { + AnyView(deviceList) + } + } + + private var deviceList: some View { List { Section(header: Text(LocalText.devicesTokensTitle)) { ForEach(viewModel.devices) { device in diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/SubscriptionsView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/SubscriptionsView.swift index eccbc6806..a0e1ccb2f 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/SubscriptionsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/SubscriptionsView.swift @@ -460,6 +460,54 @@ struct SubscriptionSettingsView: View { } } + var feedRow: some View { + VStack { + Text("Feed URL") + .frame(maxWidth: .infinity, alignment: .leading) + Text(subscription.url ?? "") + .foregroundColor(Color.appGrayText) + .frame(maxWidth: .infinity, alignment: .leading) + .lineLimit(1) + } + .contextMenu(ContextMenu(menuItems: { + Button(action: { + #if os(iOS) + UIPasteboard.general.string = subscription.url + #endif + + #if os(macOS) + let pasteBoard = NSPasteboard.general + pasteBoard.clearContents() + pasteBoard.writeObjects([subscription.url as NSString]) + #endif + }, label: { Text("Copy URL") }) + })) + } + + var emailRow: some View { + VStack { + Text("Received by") + .frame(maxWidth: .infinity, alignment: .leading) + Text(subscription.newsletterEmailAddress ?? "") + .foregroundColor(Color.appGrayText) + .frame(maxWidth: .infinity, alignment: .leading) + .lineLimit(1) + } + .contextMenu(ContextMenu(menuItems: { + Button(action: { + #if os(iOS) + UIPasteboard.general.string = subscription.newsletterEmailAddress + #endif + + #if os(macOS) + let pasteBoard = NSPasteboard.general + pasteBoard.clearContents() + pasteBoard.writeObjects([subscription.newsletterEmailAddress as NSString]) + #endif + }, label: { Text("Copy Address") }) + })) + } + var labelRuleRow: some View { HStack { Text("Add Labels") @@ -472,7 +520,7 @@ struct SubscriptionSettingsView: View { } else { Text("Create Rule") } - }) + }).tint(Color.blue) } else { ProgressView() } @@ -511,6 +559,13 @@ struct SubscriptionSettingsView: View { // } folderRow labelRuleRow + + if subscription.type == .feed { + feedRow + } + if subscription.type == .newsletter { + emailRow + } }.listStyle(.insetGrouped) Spacer() diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index fd490e810..a7535d14e 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -455,9 +455,11 @@ struct WebReaderContainerView: View { .fullScreenCover(isPresented: $showExpandedAudioPlayer) { ExpandedAudioPlayer(delete: { _ in showExpandedAudioPlayer = false + audioController.stop() delete() }, archive: { _ in showExpandedAudioPlayer = false + audioController.stop() archive() }, viewArticle: { _ in showExpandedAudioPlayer = false