Skip to content

Commit

Permalink
move guides feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mltbnz committed Oct 5, 2024
1 parent 0a33e9e commit 167d53b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 36 deletions.
35 changes: 0 additions & 35 deletions CriticalMapsKit/Sources/AppFeature/AppNavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public struct AppNavigationView: View {
.accessibility(label: Text("App navigation \(L10n.Chat.title)"))
menuSeperator

// Rules
rulesFeature
.accessibility(label: Text("App navigation \(L10n.Rules.title)"))
menuSeperator

// Settings
settingsFeature
.accessibility(label: Text("App navigation \(L10n.Settings.title)"))
Expand Down Expand Up @@ -122,36 +117,6 @@ public struct AppNavigationView: View {
)
}

var rulesFeature: some View {
Button(
action: {
viewStore.send(.setNavigation(tag: .rules))
},
label: {
Image(systemName: "exclamationmark.square")
.iconModifier()
}
)
.frame(maxWidth: .infinity, minHeight: minHeight)
.contentShape(Rectangle())
.accessibilityShowsLargeContentViewer {
Label(L10n.Rules.title, systemImage: "exclamationmark.square")
}
.sheet(
isPresented: viewStore.binding(
get: \.isRulesViewPresented,
send: AppFeature.Action.dismissSheetView
),
onDismiss: { viewStore.send(.dismissSheetView) },
content: {
CMNavigationView {
GuideView()
.accessibilityAddTraits([.isModal])
}
}
)
}

var settingsFeature: some View {
Button(
action: {
Expand Down
1 change: 1 addition & 0 deletions CriticalMapsKit/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public struct AppView: View {
.frame(maxWidth: 400)
}
.frame(maxWidth: .infinity, alignment: .center)
.padding(.horizontal, .grid(8))
}
.bottomSheet(
bottomSheetPosition: viewStore.$bottomSheetPosition,
Expand Down
1 change: 0 additions & 1 deletion CriticalMapsKit/Sources/GuideFeature/GuideView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public struct GuideView: View {
}
.listStyle(PlainListStyle())
.navigationTitle(L10n.Rules.title)
.dismissable()
}
}

Expand Down
6 changes: 6 additions & 0 deletions CriticalMapsKit/Sources/SettingsFeature/SettingsView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AcknowList
import ComposableArchitecture
import GuideFeature
import Helpers
import L10n
import Styleguide
Expand Down Expand Up @@ -215,6 +216,11 @@ public struct SettingsView: View {
.accessibilityAddTraits(.isLink)
}

SettingsNavigationLink(
destination: GuideView(),
title: L10n.Rules.title
)

if let acknowledgementsPlistPath = viewStore.acknowledgementsPlistPath {
SettingsNavigationLink(
destination: AcknowListSwiftUIView(plistPath: acknowledgementsPlistPath),
Expand Down

0 comments on commit 167d53b

Please sign in to comment.