Skip to content

Commit

Permalink
Add venue tab
Browse files Browse the repository at this point in the history
Signed-off-by: Daiki Matsudate <[email protected]>
  • Loading branch information
d-date committed Mar 19, 2024
1 parent 64cef93 commit 97f1a50
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 81 deletions.
2 changes: 1 addition & 1 deletion MyLibrary/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ let package = Package(
.target(
name: "AppFeature",
dependencies: [
"GuidanceFeature",
"ScheduleFeature",
"SponsorFeature",
"trySwiftFeature",
Expand Down Expand Up @@ -63,7 +64,6 @@ let package = Package(
name: "ScheduleFeature",
dependencies: [
"DataClient",
"GuidanceFeature",
"Safari",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
Expand Down
26 changes: 25 additions & 1 deletion MyLibrary/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
import ComposableArchitecture
import Foundation
import GuidanceFeature
import ScheduleFeature
import SponsorFeature
import SwiftUI
import TipKit
import trySwiftFeature

@Reducer
public struct AppReducer {
@ObservableState
public struct State: Equatable {
var schedule = Schedule.State()
var guidance = Guidance.State()
var sponsors = SponsorsList.State()
var trySwift = TrySwift.State()

public init() {}
let mapTip: MapTip = .init()

public init() {
try? Tips.configure([.displayFrequency(.immediate)])
}
}

public enum Action {
case schedule(Schedule.Action)
case guidance(Guidance.Action)
case sponsors(SponsorsList.Action)
case trySwift(TrySwift.Action)
}
Expand All @@ -28,6 +36,9 @@ public struct AppReducer {
Scope(state: \.schedule, action: \.schedule) {
Schedule()
}
Scope(state: \.guidance, action: \.guidance) {
Guidance()
}
Scope(state: \.sponsors, action: \.sponsors) {
SponsorsList()
}
Expand All @@ -50,6 +61,11 @@ public struct AppView: View {
.tabItem {
Label(String(localized: "Schedule", bundle: .module), systemImage: "calendar")
}
GuidanceView(store: store.scope(state: \.guidance, action: \.guidance))
.tabItem {
Label(String(localized: "Venue", bundle: .module), systemImage: "map")
}
.popoverTip(store.mapTip)
SponsorsListView(store: store.scope(state: \.sponsors, action: \.sponsors))
.tabItem {
Label(String(localized: "Sponsors", bundle: .module), systemImage: "building.2")
Expand All @@ -63,6 +79,14 @@ public struct AppView: View {
}
}

struct MapTip: Tip, Equatable {
var title: Text = Text("Go Shibuya First, NOT Garden", bundle: .module)
var message: Text? = Text(
"There are two kinds of Bellesalle in Shibuya. Learn how to get from Shibuya Station to \"Bellesalle Shibuya FIRST\". ",
bundle: .module)
var image: Image? = .init(systemName: "map.circle.fill")
}

#Preview {
AppView(
store: .init(
Expand Down
30 changes: 30 additions & 0 deletions MyLibrary/Sources/AppFeature/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
}
}
},
"Go Shibuya First, NOT Garden" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "渋谷ファーストです!ガーデンではありません!"
}
}
}
},
"Schedule" : {
"localizations" : {
"ja" : {
Expand All @@ -30,6 +40,26 @@
}
}
}
},
"There are two kinds of Bellesalle in Shibuya. Learn how to get from Shibuya Station to \"Bellesalle Shibuya FIRST\". " : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "渋谷にはベルサールが2つあります。渋谷駅からベルサール渋谷ファーストへの行き方を確認しましょう。"
}
}
}
},
"Venue" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "会場"
}
}
}
}
},
"version" : "1.0"
Expand Down
Loading

0 comments on commit 97f1a50

Please sign in to comment.