Skip to content

Commit

Permalink
Enable Custom Code in Croptop
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Nov 22, 2023
1 parent 7769b40 commit 731ee5d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Planet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@
6ACF166529246BD800AE318B /* TipSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ACF166429246BD800AE318B /* TipSelectView.swift */; };
6ACF1667292570AF00AE318B /* PlanetUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ACF1666292570AF00AE318B /* PlanetUI.swift */; };
6ACF16692927267800AE318B /* WalletTransactionProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ACF16682927267800AE318B /* WalletTransactionProgressView.swift */; };
6AD447712B0DCAF0007E92A2 /* MyPlanetCustomCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A373A3B28E8178500750256 /* MyPlanetCustomCodeView.swift */; };
6ADD7D882A51B616003D2E54 /* MyArticleModel+Save.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ADD7D872A51B616003D2E54 /* MyArticleModel+Save.swift */; };
6ADD7D892A51B616003D2E54 /* MyArticleModel+Save.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ADD7D872A51B616003D2E54 /* MyArticleModel+Save.swift */; };
6ADF40B92914D88C007A24E8 /* MyPlanetIPNSView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ADF40B82914D88C007A24E8 /* MyPlanetIPNSView.swift */; };
Expand Down Expand Up @@ -1787,6 +1788,7 @@
2A95E6772A19A3C4001288B8 /* URLUtils.swift in Sources */,
2A6E16DA2A186B0100704A08 /* AppWindow.swift in Sources */,
2ABD1CC42A1616DA0082D7EA /* AppDelegate.swift in Sources */,
6AD447712B0DCAF0007E92A2 /* MyPlanetCustomCodeView.swift in Sources */,
2A95E69E2A19A446001288B8 /* FollowingPlanetModel.swift in Sources */,
2A95E68D2A19A3CA001288B8 /* WriterWebView.swift in Sources */,
2AC063A72A4DC49F004F0A29 /* AppContentGridCell.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"location" : "https://github.com/Planetable/PlanetSiteTemplates.git",
"state" : {
"branch" : "main",
"revision" : "c35f485fe2b46b39f2751de9bcdc67325ac8e388"
"revision" : "7cc1744d68ee898988926f66ac3e7b2a84a3fb73"
}
},
{
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 = 1794
CURRENT_PROJECT_VERSION = 1795
9 changes: 9 additions & 0 deletions PlanetLite/AppSidebarItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ struct AppSidebarItemView: View {
}
}

Button {
Task {
PlanetStore.shared.selectedView = .myPlanet(planet)
PlanetStore.shared.isEditingPlanetCustomCode = true
}
} label: {
Text("Custom Code")
}

Button {
Task {
PlanetStore.shared.selectedView = .myPlanet(planet)
Expand Down
5 changes: 5 additions & 0 deletions PlanetLite/AppSidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ struct AppSidebarView: View {
MyArticleSettingsView(article: article)
}
}
.sheet(isPresented: $planetStore.isEditingPlanetCustomCode) {
if case .myPlanet(let planet) = planetStore.selectedView {
MyPlanetCustomCodeView(planet: planet)
}
}
.onReceive(NotificationCenter.default.publisher(for: .publishMyPlanet)) {
aNotification in
if let userObject = aNotification.object, let planet = userObject as? MyPlanetModel {
Expand Down

0 comments on commit 731ee5d

Please sign in to comment.