settings page + re-view tutorial
This commit is contained in:
1 parent
5e8b061d10
commit
3d2cd8d522
2 files changed
+54
-10
No files matched your search
@@ -36,15 +36,6 @@ struct ContentView: View {
|
||||
}
|
||||
.font(.caption)
|
||||
.padding(.bottom, 10)
|
||||
Section {
|
||||
HStack {
|
||||
Text("App Hash:")
|
||||
.bold()
|
||||
Spacer()
|
||||
}
|
||||
TextField("App Hash", text: $pbHash)
|
||||
}
|
||||
.padding(.bottom, 5)
|
||||
|
||||
Section {
|
||||
Button(action: {
|
||||
@@ -70,7 +61,10 @@ struct ContentView: View {
|
||||
}
|
||||
|
||||
Section {
|
||||
if selectedTendies != nil && pbHash != "" {
|
||||
if selectedTendies != nil {
|
||||
if pbHash == "" {
|
||||
Text("Enter your PosterBoard app hash in Settings.")
|
||||
} else {
|
||||
Button(action: {
|
||||
do {
|
||||
try PosterBoardManager.applyTendies(selectedTendies!, appHash: pbHash)
|
||||
@@ -88,8 +82,18 @@ struct ContentView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.navigationTitle("Pocket Poster")
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .topBarTrailing, content: {
|
||||
NavigationLink(destination: {
|
||||
SettingsView()
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
.fileImporter(isPresented: $showTendiesImporter, allowedContentTypes: [UTType(filenameExtension: "tendies", conformingTo: .data)!], allowsMultipleSelection: true, onCompletion: { result in
|
||||
switch result {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// SettingsView.swift
|
||||
// Pocket Poster
|
||||
//
|
||||
// Created by lemin on 6/1/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
// Prefs
|
||||
@AppStorage("pbHash") var pbHash: String = ""
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Section {
|
||||
HStack {
|
||||
Text("App Hash:")
|
||||
.font(.headline)
|
||||
.foregroundColor(.primary)
|
||||
Spacer()
|
||||
}
|
||||
TextField("App Hash", text: $pbHash)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
.font(.system(.body, design: .monospaced))
|
||||
}
|
||||
.padding(.bottom, 5)
|
||||
|
||||
Section {
|
||||
Button(action: {
|
||||
UserDefaults.standard.set(false, forKey: "finishedTutorial")
|
||||
}) {
|
||||
Text("Replay Tutorial")
|
||||
}
|
||||
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user