5982: Clean code and add tests

This commit is contained in:
MaximeE
2022-04-11 10:55:23 +02:00
parent 29bb3a4a68
commit a3758731b9
10 changed files with 93 additions and 134 deletions
@@ -36,11 +36,9 @@ struct LocationSharingView: View {
mapView
VStack(spacing: 0) {
MapCreditsView()
if context.viewState.shareButtonVisible {
buttonsView
.background(theme.colors.background)
.clipShape(RoundedCornerShape(radius: 8, corners: [.topLeft, .topRight]))
}
buttonsView
.background(theme.colors.background)
.clipShape(RoundedCornerShape(radius: 8, corners: [.topLeft, .topRight]))
}
}
.toolbar {
@@ -54,17 +52,6 @@ struct LocationSharingView: View {
.font(.headline)
.foregroundColor(theme.colors.primaryContent)
}
ToolbarItem(placement: .navigationBarTrailing) {
if context.viewState.displayExistingLocation {
Button {
context.send(viewAction: .share)
} label: {
Image(uiImage: Asset.Images.locationShareIcon.image)
.accessibilityIdentifier("LocationSharingView.shareButton")
}
.disabled(!context.viewState.shareButtonEnabled)
}
}
}
.navigationBarTitleDisplayMode(.inline)
.introspectNavigationController { navigationController in