Skip to content

Commit

Permalink
fix contextmenu title
Browse files Browse the repository at this point in the history
  • Loading branch information
mltbnz committed Jun 3, 2023
1 parent d6b0fd7 commit 15588a6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions CriticalMapsKit/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public struct AppView: View {
viewStore = ViewStore(store)
}

private var contextMenuTitle: String {
if viewStore.bottomSheetPosition == .hidden {
return L10n.Map.NextRideEvents.showAll
} else {
return L10n.Map.NextRideEvents.hideAll
}
}

public var body: some View {
ZStack(alignment: .topLeading) {
MapFeatureView(
Expand All @@ -39,10 +47,7 @@ public struct AppView: View {
.contextMenu {
Button(
action: { viewStore.send(.set(\.$bottomSheetPosition, .relative(0.4))) },
label: {
let title = viewStore.bottomSheetPosition == .hidden ? L10n.Map.NextRideEvents.hideAll : L10n.Map.NextRideEvents.showAll
Label(title, systemImage: "list.bullet")
}
label: { Label(contextMenuTitle, systemImage: "list.bullet") }
)
}
}
Expand Down Expand Up @@ -147,7 +152,7 @@ public struct AppView: View {
? Color.white
: Color(.attention)
)
.accessibilityLabel(Text("internet not available"))
.accessibilityLabel(Text("Internet not available"))
.padding()
.background(
Group {
Expand Down

0 comments on commit 15588a6

Please sign in to comment.