From c2d16774f751e6c208464fbba28e89f8f89f95a1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 11 Dec 2022 23:40:08 +0100 Subject: [PATCH] Menus improvements --- Shared/Subscriptions/SubscriptionsView.swift | 11 +++++++---- Shared/Views/SettingsButtons.swift | 10 ++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Shared/Subscriptions/SubscriptionsView.swift b/Shared/Subscriptions/SubscriptionsView.swift index 2a76e265..a678f033 100644 --- a/Shared/Subscriptions/SubscriptionsView.swift +++ b/Shared/Subscriptions/SubscriptionsView.swift @@ -45,8 +45,7 @@ struct SubscriptionsView: View { } } label: { HStack(spacing: 12) { - Text(menuLabel) - .font(.headline) + menuLabel .foregroundColor(.primary) Image(systemName: "chevron.down.circle.fill") @@ -57,8 +56,12 @@ struct SubscriptionsView: View { } } - var menuLabel: String { - subscriptionsViewPage == .channels ? "Channels" : "Feed" + var menuLabel: some View { + HStack { + Image(systemName: subscriptionsViewPage == .channels ? "person.3.fill" : "film") + Text(subscriptionsViewPage.rawValue.capitalized.localized()) + .font(.headline) + } } #endif } diff --git a/Shared/Views/SettingsButtons.swift b/Shared/Views/SettingsButtons.swift index 340257e0..e132046f 100644 --- a/Shared/Views/SettingsButtons.swift +++ b/Shared/Views/SettingsButtons.swift @@ -6,7 +6,11 @@ struct SettingsButtons: View { var body: some View { Button(action: { navigation.presentingAccounts = true }) { - Label(accounts.current?.description ?? "", image: accounts.app.rawValue.capitalized) + if let account = accounts.current { + Label(account.description, image: account.app?.rawValue.capitalized ?? "") + } else { + Label("Signed Out", systemImage: "xmark") + } } Button(action: { navigation.presentingSettings = true }) { Label("Settings", systemImage: "gearshape.2") @@ -16,6 +20,8 @@ struct SettingsButtons: View { struct SettingsButtons_Previews: PreviewProvider { static var previews: some View { - SettingsButtons() + VStack(spacing: 10) { + SettingsButtons() + } } }