Configured and applied SwiftFormat

This commit is contained in:
Stefan Ceriu
2022-09-27 10:17:22 +03:00
committed by Stefan Ceriu
parent ff2e6ddfa7
commit 43c28d23b7
663 changed files with 2329 additions and 2840 deletions
@@ -1,4 +1,4 @@
//
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,6 @@
import SwiftUI
struct LocationSharingOptionButton<Content: View>: View {
// MARK: - Properties
// MARK: Private
@@ -25,7 +24,7 @@ struct LocationSharingOptionButton<Content: View>: View {
@Environment(\.theme) private var theme: ThemeSwiftUI
let text: String
let action: () -> (Void)
let action: () -> Void
@ViewBuilder var buttonIcon: Content
var body: some View {
@@ -44,21 +43,15 @@ struct LocationSharingOptionButton<Content: View>: View {
struct LocationSharingOptionButton_Previews: PreviewProvider {
static var previews: some View {
VStack(alignment: .leading) {
LocationSharingOptionButton(text: VectorL10n.locationSharingStaticShareTitle) {
} buttonIcon: {
LocationSharingOptionButton(text: VectorL10n.locationSharingStaticShareTitle) { } buttonIcon: {
AvatarImage(avatarData: AvatarInput(mxContentUri: nil, matrixItemId: "Alice", displayName: "Alice"), size: .medium)
.border()
}
LocationSharingOptionButton(text: VectorL10n.locationSharingLiveShareTitle) {
} buttonIcon: {
LocationSharingOptionButton(text: VectorL10n.locationSharingLiveShareTitle) { } buttonIcon: {
Image(uiImage: Asset.Images.locationLiveIcon.image)
.resizable()
}
LocationSharingOptionButton(text: VectorL10n.locationSharingPinDropShareTitle) {
} buttonIcon: {
LocationSharingOptionButton(text: VectorL10n.locationSharingPinDropShareTitle) { } buttonIcon: {
Image(uiImage: Asset.Images.locationPinIcon.image)
.resizable()
}
@@ -14,11 +14,10 @@
// limitations under the License.
//
import SwiftUI
import CoreLocation
import SwiftUI
struct LocationSharingView: View {
// MARK: - Properties
// MARK: Private
@@ -39,7 +38,6 @@ struct LocationSharingView: View {
}
VStack(spacing: 0) {
if context.viewState.showMapLoadingError {
MapLoadingErrorView()
} else {
@@ -50,7 +48,7 @@ struct LocationSharingView: View {
})
.padding(.bottom, 10.0)
.actionSheet(isPresented: $context.showMapCreditsSheet) {
return MapCreditsActionSheet(openURL: { url in
MapCreditsActionSheet(openURL: { url in
openURL(url)
}).sheet
}
@@ -99,8 +97,8 @@ struct LocationSharingView: View {
mapCenterCoordinate: $context.pinLocation,
errorSubject: context.viewState.errorSubject,
userDidPan: {
context.send(viewAction: .userDidPan)
})
context.send(viewAction: .userDidPan)
})
if context.viewState.isPinDropSharing {
LocationSharingMarkerView(backgroundColor: theme.colors.accent) {
Image(uiImage: Asset.Images.locationPinIcon.image)