From c43a6802da380984ee3d3040dc77305381fa49d6 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 22 Aug 2022 00:37:52 +0200 Subject: [PATCH] Channel layout improvements --- Shared/Views/ChannelVideosView.swift | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Shared/Views/ChannelVideosView.swift b/Shared/Views/ChannelVideosView.swift index b80a35e0..90392e21 100644 --- a/Shared/Views/ChannelVideosView.swift +++ b/Shared/Views/ChannelVideosView.swift @@ -96,10 +96,19 @@ struct ChannelVideosView: View { HStack(spacing: 3) { Text("\(store.item?.subscriptionsString ?? "")") .fontWeight(.bold) - Text(" subscribers") + + let subscribers = Text(" subscribers") .allowsTightening(true) .foregroundColor(.secondary) .opacity(store.item?.subscriptionsString != nil ? 1 : 0) + + #if os(iOS) + if navigationStyle == .sidebar { + subscribers + } + #else + subscribers + #endif } ShareButton(contentItem: contentItem) @@ -157,21 +166,35 @@ struct ChannelVideosView: View { Group { if accounts.app.supportsSubscriptions && accounts.signedIn { if subscriptions.isSubscribing(channel.id) { - Button("Unsubscribe") { + Button { subscriptionToggleButtonDisabled = true subscriptions.unsubscribe(channel.id) { subscriptionToggleButtonDisabled = false } + } label: { + Label("Unsubscribe", systemImage: "circle") + #if os(iOS) + .labelStyle(.automatic) + #else + .labelStyle(.titleOnly) + #endif } } else { - Button("Subscribe") { + Button { subscriptionToggleButtonDisabled = true subscriptions.subscribe(channel.id) { subscriptionToggleButtonDisabled = false navigation.sidebarSectionChanged.toggle() } + } label: { + Label("Subscribe", systemImage: "star.circle") + #if os(iOS) + .labelStyle(.automatic) + #else + .labelStyle(.titleOnly) + #endif } } }