Address comments, show unencrypted rooms,

retain viewModel and services in ScreenSates so you can interact with Previews after the first state.
This commit is contained in:
David Langley
2021-09-23 23:57:54 +01:00
parent bd4d9974a8
commit d560e513d4
16 changed files with 185 additions and 114 deletions
@@ -19,12 +19,12 @@ import SwiftUI
@available(iOS 14.0, *)
struct ScreenList: View {
private var allStates: [MockScreenState]
private var allKeys: [String]
private var allStates: [ScreenStateInfo]
init(screens: [MockScreenState.Type]) {
self.allStates = screens.flatMap{ $0.screenStates }
self.allKeys = screens.flatMap{ $0.screenStateKeys }
allStates = screens
.map({ $0.stateRenderer })
.flatMap{( $0.states )}
}
var body: some View {
@@ -32,9 +32,9 @@ struct ScreenList: View {
List {
ForEach(0..<allStates.count) { i in
let state = allStates[i]
NavigationLink(destination: state.screenView) {
NavigationLink(destination: state.view) {
Text(state.fullScreenTitle)
.accessibilityIdentifier(allKeys[i])
.accessibilityIdentifier(state.stateKey)
}
}
}