Fix ordering, add pragmas, fix visibility on a few functions, remove default param on state.

This commit is contained in:
David Langley
2021-09-08 11:43:57 +01:00
parent c6996cf62d
commit 13a9d82486
6 changed files with 52 additions and 31 deletions
@@ -19,20 +19,12 @@ import SwiftUI
@available(iOS 14.0, *)
struct TemplateUserProfile: View {
// MARK: - Properties
// MARK: Public
@Environment(\.theme) var theme: ThemeSwiftUI
@ObservedObject var viewModel: TemplateUserProfileViewModel
var leftButton: some View {
Button(VectorL10n.cancel) {
viewModel.proccess(viewAction: .cancel)
}
}
var rightButton: some View {
Button(VectorL10n.done) {
viewModel.proccess(viewAction: .cancel)
}
}
var body: some View {
VStack {
@@ -57,8 +49,24 @@ struct TemplateUserProfile: View {
.navigationTitle(viewModel.viewState.displayName ?? "")
.navigationBarItems(leading: leftButton, trailing: rightButton)
}
// MARK: Private
private var leftButton: some View {
Button(VectorL10n.cancel) {
viewModel.proccess(viewAction: .cancel)
}
}
private var rightButton: some View {
Button(VectorL10n.done) {
viewModel.proccess(viewAction: .cancel)
}
}
}
// MARK: - Previews
@available(iOS 14.0, *)
struct TemplateUserProfile_Previews: PreviewProvider {
static var previews: some View {