Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MyLibrary/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion MyLibrary/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public struct AppReducer {
@ObservableState
public struct State: Equatable {
var schedule = Schedule.State()
var liveTranslation = LiveTranslation.State(
roomNumber: ProcessInfo.processInfo.environment["LIVE_TRANSLATION_KEY"]
?? (Bundle.main.infoDictionary?["Live translation room number"] as? String) ?? ""
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract to BulidConfig, which defined as Dependency Client.
See how it works at isowords:

https://github.com/pointfreeco/isowords/tree/main/Sources/Build

Build is preserved in .gitignore so use BuildConfig instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@d-date I tried to write it on cf9000e.

var guidance = Guidance.State()
var sponsors = SponsorsList.State()
var trySwift = TrySwift.State()
Expand All @@ -24,6 +28,7 @@ public struct AppReducer {

public enum Action {
case schedule(Schedule.Action)
case liveTranslation(LiveTranslation.Action)
case guidance(Guidance.Action)
case sponsors(SponsorsList.Action)
case trySwift(TrySwift.Action)
Expand All @@ -35,6 +40,9 @@ public struct AppReducer {
Scope(state: \.schedule, action: \.schedule) {
Schedule()
}
Scope(state: \.liveTranslation, action: \.liveTranslation) {
LiveTranslation()
}
Scope(state: \.guidance, action: \.guidance) {
Guidance()
}
Expand All @@ -60,7 +68,7 @@ public struct AppView: View {
.tabItem {
Label(String(localized: "Schedule", bundle: .module), systemImage: "calendar")
}
LiveTranslationView()
LiveTranslationView(store: store.scope(state: \.liveTranslation, action: \.liveTranslation))
.tabItem {
Label(String(localized: "Translation", bundle: .module), systemImage: "text.bubble")
}
Expand Down
Loading