Skip to content

Commit

Permalink
Review upgrade icons (#1141)
Browse files Browse the repository at this point in the history
- Add to "General" module on macOS
- Restore in profiles list/grid, removed in #1139
  • Loading branch information
keeshux authored Feb 5, 2025
1 parent 6ba8b32 commit 91823f1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Packages/App/Sources/AppUIMain/Views/App/ProfileRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ private struct MarkerView: View {
ZStack {
ThemeImage(profileId == nextProfileId ? .pending : tunnel.statusImageName)
.opaque(requiredFeatures == nil && (profileId == nextProfileId || profileId == tunnel.currentProfile?.id))

if let requiredFeatures {
PurchaseRequiredView(features: requiredFeatures)
}
}
.frame(width: 24)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ struct ModuleListView: View, Routable {
var body: some View {
List(selection: $selectedModuleId) {
Section {
NavigationLink(Strings.Global.Nouns.general, value: ProfileSplitView.Detail.general)
.tag(Self.generalModuleId)
NavigationLink(value: ProfileSplitView.Detail.general) {
HStack {
Text(Strings.Global.Nouns.general)
PurchaseRequiredView(features: requiredGeneralFeatures)
}
}
.tag(Self.generalModuleId)
}
Group {
ForEach(profileEditor.modules, id: \.id) { module in
Expand Down Expand Up @@ -116,6 +121,17 @@ private extension ModuleListView {
}

private extension ModuleListView {
var requiredGeneralFeatures: Set<AppFeature> {
var features: Set<AppFeature> = []
if profileEditor.isShared {
features.insert(.sharing)
}
if profileEditor.isAvailableForTV {
features.insert(.appleTV)
}
return features
}

func moveModules(from offsets: IndexSet, to newOffset: Int) {
profileEditor.moveModules(from: offsets, to: newOffset)
// XXX: selection is lost after move, reset as a workaround
Expand Down

0 comments on commit 91823f1

Please sign in to comment.