environment objects are implicit arguments that cannot be checked by the compiler. They are a common source of crashes. Use a main NavigationCoordinator in DamusState for the core app, and pass in other coordinators in the account setup view for the parts of the app that don't have a DamusState.
31 lines
815 B
Swift
31 lines
815 B
Swift
//
|
|
// ProfilePicturesView.swift
|
|
// damus
|
|
//
|
|
// Created by William Casarin on 2023-02-22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ProfilePicturesView: View {
|
|
let state: DamusState
|
|
let pubkeys: [String]
|
|
|
|
var body: some View {
|
|
HStack {
|
|
ForEach(pubkeys.prefix(8), id: \.self) { pubkey in
|
|
ProfilePicView(pubkey: pubkey, size: 32.0, highlight: .none, profiles: state.profiles, disable_animation: state.settings.disable_animation)
|
|
.onTapGesture {
|
|
state.nav.push(route: Route.ProfileByKey(pubkey: pubkey))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ProfilePicturesView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ProfilePicturesView(state: test_damus_state(), pubkeys: ["a", "b"])
|
|
}
|
|
}
|