diff --git a/OTP/Views/AllKeysView.swift b/OTP/Views/AllKeysView.swift new file mode 100644 index 0000000..6de9c2d --- /dev/null +++ b/OTP/Views/AllKeysView.swift @@ -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() + } +} diff --git a/OTP/Views/AppView.swift b/OTP/Views/AppView.swift index 00d5b60..56c3f4e 100644 --- a/OTP/Views/AppView.swift +++ b/OTP/Views/AppView.swift @@ -24,6 +24,12 @@ struct AppView: View { List { KeysSection(codeHolder: entryHolder) + Section { + NavigationLink("All Keys") { + AllKeysView() + } + } + FoldersSection() } .listStyle(.insetGrouped)