Skip to content

Commit

Permalink
Enable Template Settings in Croptop
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Jul 4, 2023
1 parent 25993c9 commit 522447f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Planet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
6AB6E513291527B800F17328 /* WalletConnectNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 6AB6E512291527B800F17328 /* WalletConnectNetworking */; };
6AB6E515291527B800F17328 /* WalletConnectPairing in Frameworks */ = {isa = PBXBuildFile; productRef = 6AB6E514291527B800F17328 /* WalletConnectPairing */; };
6AB6E517291527B800F17328 /* WalletConnectPush in Frameworks */ = {isa = PBXBuildFile; productRef = 6AB6E516291527B800F17328 /* WalletConnectPush */; };
6AB75A8E2A5496F20050AD58 /* MyPlanetTemplateSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A5935EB2A14E98C00151CBD /* MyPlanetTemplateSettingsView.swift */; };
6ABAB91828215FF30014F209 /* TemplatePreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ABAB91728215FF30014F209 /* TemplatePreviewView.swift */; };
6AC01AEE291D258900EB6B5F /* AccountBadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC01AED291D258900EB6B5F /* AccountBadgeView.swift */; };
6AC01AF0291ECC7E00EB6B5F /* WalletAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC01AEF291ECC7E00EB6B5F /* WalletAccountView.swift */; };
Expand Down Expand Up @@ -1382,6 +1383,7 @@
2A95E6E72A19A64F001288B8 /* SharingServicePicker.swift in Sources */,
2A95E68C2A19A3CA001288B8 /* WriterTextView.swift in Sources */,
2A95E64D2A19A398001288B8 /* PFDashboardContentView.swift in Sources */,
6AB75A8E2A5496F20050AD58 /* MyPlanetTemplateSettingsView.swift in Sources */,
2A996ADA2A1DA6D100BEF898 /* PlanetDownloadsWebView.swift in Sources */,
2A91AEC72A473D3C003FF003 /* AppContentItemMenuView.swift in Sources */,
2A95E6582A19A3A2001288B8 /* WalletConnectV1.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Planet/versioning.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 1472
CURRENT_PROJECT_VERSION = 1473
22 changes: 19 additions & 3 deletions PlanetLite/AppSidebarItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SwiftUI
struct AppSidebarItemView: View {
@EnvironmentObject var planetStore: PlanetStore
@ObservedObject var planet: MyPlanetModel

@State private var isShowingDeleteConfirmation = false

var body: some View {
Expand All @@ -33,6 +33,17 @@ struct AppSidebarItemView: View {
Text("Edit Planet")
}

if let template = planet.template, template.hasSettings {
Button {
Task {
PlanetStore.shared.selectedView = .myPlanet(planet)
PlanetStore.shared.isConfiguringPlanetTemplate = true
}
} label: {
Text("Template Settings")
}
}

Button {
Task {
try await planet.publish()
Expand Down Expand Up @@ -88,7 +99,7 @@ struct AppSidebarItemView: View {

Divider()
}

Group {
Button {
let panel = NSOpenPanel()
Expand Down Expand Up @@ -118,7 +129,7 @@ struct AppSidebarItemView: View {
} label: {
Text("Export Planet")
}

Divider()

Button {
Expand All @@ -128,6 +139,11 @@ struct AppSidebarItemView: View {
}
}
}
.sheet(isPresented: $planetStore.isConfiguringPlanetTemplate) {
if case .myPlanet(let planet) = planetStore.selectedView {
MyPlanetTemplateSettingsView(planet: planet)
}
}
.confirmationDialog(
Text("Are you sure you want to delete \(planet.name)? This action cannot be undone."),
isPresented: $isShowingDeleteConfirmation
Expand Down

0 comments on commit 522447f

Please sign in to comment.