Moved features

This commit is contained in:
lumaa-dev 2024-10-04 00:27:27 +02:00
parent 738d90f27f
commit 6dc640ad07
3 changed files with 34 additions and 3 deletions

View File

@ -3,9 +3,9 @@
import SwiftUI import SwiftUI
struct PlusNecessaryView: View { 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 self.lockedFeature = lockedFeature
} }

View File

@ -12,4 +12,35 @@ public enum AppInfo {
extension AppInfo { extension AppInfo {
static var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" 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")
}
}
}
} }

View File

@ -104,7 +104,7 @@ public enum TabDestination: Identifiable {
public enum SheetDestination: Identifiable { public enum SheetDestination: Identifiable {
case welcome case welcome
case shop case shop
case lockedFeature(_ feature: ShopView.Feature? = nil) case lockedFeature(_ feature: AppInfo.Feature? = nil)
case media(attachments: [MediaAttachment], selected: MediaAttachment) case media(attachments: [MediaAttachment], selected: MediaAttachment)
case aboutSubclub case aboutSubclub