Add all keys view
This commit is contained in:
parent
ffd9b8434e
commit
85f60c7261
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// AllKeysView.swift
|
||||
// OTP
|
||||
//
|
||||
// Created by Shadowfacts on 8/25/21.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct AllKeysView: View {
|
||||
@ObservedObject private var store: KeyStore
|
||||
@ObservedObject private var codeHolder: AppView.CodeHolder
|
||||
|
||||
init() {
|
||||
let store = KeyStore.shared
|
||||
self.store = store
|
||||
self.codeHolder = AppView.CodeHolder(store: store, entryFilter: nil)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
KeysSection(codeHolder: codeHolder)
|
||||
}
|
||||
.listStyle(.insetGrouped)
|
||||
.navigationTitle("All Keys")
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
AddKeyButton(folderID: nil, canAddFolder: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AllKeysView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AllKeysView()
|
||||
}
|
||||
}
|
|
@ -24,6 +24,12 @@ struct AppView: View {
|
|||
List {
|
||||
KeysSection(codeHolder: entryHolder)
|
||||
|
||||
Section {
|
||||
NavigationLink("All Keys") {
|
||||
AllKeysView()
|
||||
}
|
||||
}
|
||||
|
||||
FoldersSection()
|
||||
}
|
||||
.listStyle(.insetGrouped)
|
||||
|
|
Loading…
Reference in New Issue