End-Of-Session: Added config/data storage with default phrases

This commit is contained in:
2025-01-12 00:20:32 -05:00
parent 729cb76180
commit 6c1eb5446f
10 changed files with 369 additions and 14 deletions

View File

@@ -5,15 +5,31 @@
// Created by Elizabeth Cray on 1/10/25.
// Copyright © 2025 Cray. All rights reserved.
//
// TODO:
// - if touch up outside view, close Kbd
import SwiftUI
struct KeyboardView: View {
@State var db = Database()
@State var cfg = Config()
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
ScrollView {
VStack {
ForEach(db.groups) { group in
Text(group.name)
.foregroundColor(cfg.highlightColor)
HStack {
ForEach(group.phrases) { phrase in
Text(phrase.string)
}
}
}
Button("Clear") { db.groups[1].name = NSUUID().uuidString}
}
}
}
}
#Preview {
#Preview(traits:.fixedLayout(width: 645, height: 431)) {
KeyboardView()
}