Add all keys view

This commit is contained in:
Shadowfacts 2021-08-25 11:38:37 -04:00
parent ffd9b8434e
commit 85f60c7261
2 changed files with 44 additions and 0 deletions

View File

@ -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()
}
}

View File

@ -24,6 +24,12 @@ struct AppView: View {
List { List {
KeysSection(codeHolder: entryHolder) KeysSection(codeHolder: entryHolder)
Section {
NavigationLink("All Keys") {
AllKeysView()
}
}
FoldersSection() FoldersSection()
} }
.listStyle(.insetGrouped) .listStyle(.insetGrouped)