End-Of-Session: Added config/data storage with default phrases
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user