From 6dc640ad072ef4c4023ce28a23e0635f9f24fa26 Mon Sep 17 00:00:00 2001 From: lumaa-dev Date: Fri, 4 Oct 2024 00:27:27 +0200 Subject: [PATCH] Moved features --- Bubble/Components/PlusNecessaryView.swift | 4 +-- Bubble/Data/AppInfo.swift | 31 +++++++++++++++++++++++ Bubble/Data/Navigator.swift | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Bubble/Components/PlusNecessaryView.swift b/Bubble/Components/PlusNecessaryView.swift index 2a96c71..3dc1bd6 100644 --- a/Bubble/Components/PlusNecessaryView.swift +++ b/Bubble/Components/PlusNecessaryView.swift @@ -3,9 +3,9 @@ import SwiftUI struct PlusNecessaryView: View { - var lockedFeature: ShopView.Feature? = nil + var lockedFeature: AppInfo.Feature? = nil - init(_ lockedFeature: ShopView.Feature? = nil) { + init(_ lockedFeature: AppInfo.Feature? = nil) { self.lockedFeature = lockedFeature } diff --git a/Bubble/Data/AppInfo.swift b/Bubble/Data/AppInfo.swift index af8f9e4..85fd9b9 100644 --- a/Bubble/Data/AppInfo.swift +++ b/Bubble/Data/AppInfo.swift @@ -12,4 +12,35 @@ public enum AppInfo { extension AppInfo { static var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" + + /// App's features + public enum Feature { + case drafts + case analytics + case contentFilter + case downloadAttachment + case moreAccounts + case experimentalSettings + case vip + + //TODO: Upgrade this + public var details: ShopView.PremiumFeature { + switch self { + case .drafts: + return .init("shop.features.drafts", description: "shop.features.drafts.description", systemImage: "pencil.and.outline") + case .analytics: + return .init("shop.features.analytics", description: "shop.features.analytics.description", systemImage: "chart.line.uptrend.xyaxis.circle") + case .contentFilter: + return .init("shop.features.content-filter", description: "shop.features.content-filter.description", systemImage: "wand.and.stars") + case .downloadAttachment: + return .init("shop.features.download-atchmnt", description: "shop.features.download-atchmnt.description", systemImage: "photo.badge.arrow.down") + case .moreAccounts: + return .init("shop.features.more-accounts", description: "shop.features.more-accounts.description", systemImage: "person.fill.badge.plus") + case .experimentalSettings: + return .init("shop.features.experimental", description: "shop.features.experimental.description", systemImage: "gearshape.fill") + case .vip: + return .init("shop.features.vip", description: "shop.features.vip.description", systemImage: "crown") + } + } + } } diff --git a/Bubble/Data/Navigator.swift b/Bubble/Data/Navigator.swift index 6d34272..49ebcc3 100644 --- a/Bubble/Data/Navigator.swift +++ b/Bubble/Data/Navigator.swift @@ -104,7 +104,7 @@ public enum TabDestination: Identifiable { public enum SheetDestination: Identifiable { case welcome case shop - case lockedFeature(_ feature: ShopView.Feature? = nil) + case lockedFeature(_ feature: AppInfo.Feature? = nil) case media(attachments: [MediaAttachment], selected: MediaAttachment) case aboutSubclub