mirror of
https://github.com/1SecondEveryday/MemoryTree.git
synced 2026-03-25 08:55:47 +00:00
Make it work
This commit is contained in:
parent
848561c177
commit
435c8a40c5
4 changed files with 22 additions and 6 deletions
|
|
@ -1,6 +1,15 @@
|
|||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "1.000",
|
||||
"green" : "1.000",
|
||||
"red" : "1.000"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -10,11 +10,7 @@ import SwiftUI
|
|||
|
||||
struct CloudView: View {
|
||||
// @Stored(in: .entriesStore) var entries
|
||||
@Binding var entries: [Entry] {
|
||||
didSet {
|
||||
countedWords = countWords()
|
||||
}
|
||||
}
|
||||
@Binding var entries: [Entry]
|
||||
|
||||
@State var countedWords: [String: Int] = [:]
|
||||
|
||||
|
|
@ -24,6 +20,15 @@ struct CloudView: View {
|
|||
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
init(entries: Binding<[Entry]>, countedWords: [String: Int]? = nil) {
|
||||
_entries = entries
|
||||
if let countedWords {
|
||||
_countedWords = State(wrappedValue: countedWords)
|
||||
} else {
|
||||
_countedWords = State(wrappedValue: countWords())
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
var isFirst = true
|
||||
words.reduce(Text("")) { cloud, word in
|
||||
|
|
@ -35,6 +40,7 @@ struct CloudView: View {
|
|||
.bold(count > 2)
|
||||
}
|
||||
.multilineTextAlignment(.center)
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
.background(Color.blue)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ struct ContentView: View {
|
|||
formView
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.edgesIgnoringSafeArea(isEditing ? .top : .bottom)
|
||||
.edgesIgnoringSafeArea(isEditing ? [] : .bottom)
|
||||
.background(Color.blue)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ struct MemoryTreeApp: App {
|
|||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
.tint(.white)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue