Skip to content

Commit cc88684

Browse files
author
Daiki Matsudate
authored
Add venue tab (#43)
* Add guidance Signed-off-by: Daiki Matsudate <[email protected]> Remove Signed-off-by: Daiki Matsudate <[email protected]> * Add venue tab Signed-off-by: Daiki Matsudate <[email protected]> * Adjust Signed-off-by: Daiki Matsudate <[email protected]> --------- Signed-off-by: Daiki Matsudate <[email protected]>
1 parent 544ea7a commit cc88684

File tree

36 files changed

+1177
-130
lines changed

36 files changed

+1177
-130
lines changed

Diff for: MyLibrary/Package.swift

+21-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ let package = Package(
99
products: [
1010
.library(
1111
name: "AppFeature",
12-
targets: ["AppFeature"])
12+
targets: ["AppFeature"]),
13+
.library(
14+
name: "GuidanceFeature",
15+
targets: ["GuidanceFeature"]
16+
)
1317
],
1418
dependencies: [
1519
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.9.1"),
@@ -19,6 +23,7 @@ let package = Package(
1923
.target(
2024
name: "AppFeature",
2125
dependencies: [
26+
"GuidanceFeature",
2227
"ScheduleFeature",
2328
"SponsorFeature",
2429
"trySwiftFeature",
@@ -34,6 +39,21 @@ let package = Package(
3439
.process("Resources")
3540
]
3641
),
42+
.target(
43+
name: "GuidanceFeature",
44+
dependencies: [
45+
"MapKitClient",
46+
"Safari",
47+
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
48+
]
49+
),
50+
.target(
51+
name: "MapKitClient",
52+
dependencies: [
53+
"SharedModels",
54+
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
55+
]
56+
),
3757
.target(
3858
name: "Safari",
3959
dependencies: [

Diff for: MyLibrary/Sources/AppFeature/AppView.swift

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
import ComposableArchitecture
22
import Foundation
3+
import GuidanceFeature
34
import ScheduleFeature
45
import SponsorFeature
56
import SwiftUI
7+
import TipKit
68
import trySwiftFeature
79

810
@Reducer
911
public struct AppReducer {
1012
@ObservableState
1113
public struct State: Equatable {
1214
var schedule = Schedule.State()
15+
var guidance = Guidance.State()
1316
var sponsors = SponsorsList.State()
1417
var trySwift = TrySwift.State()
1518

16-
public init() {}
19+
let mapTip: MapTip = .init()
20+
21+
public init() {
22+
try? Tips.configure([.displayFrequency(.immediate)])
23+
}
1724
}
1825

1926
public enum Action {
2027
case schedule(Schedule.Action)
28+
case guidance(Guidance.Action)
2129
case sponsors(SponsorsList.Action)
2230
case trySwift(TrySwift.Action)
2331
}
@@ -28,6 +36,9 @@ public struct AppReducer {
2836
Scope(state: \.schedule, action: \.schedule) {
2937
Schedule()
3038
}
39+
Scope(state: \.guidance, action: \.guidance) {
40+
Guidance()
41+
}
3142
Scope(state: \.sponsors, action: \.sponsors) {
3243
SponsorsList()
3344
}
@@ -50,6 +61,11 @@ public struct AppView: View {
5061
.tabItem {
5162
Label(String(localized: "Schedule", bundle: .module), systemImage: "calendar")
5263
}
64+
GuidanceView(store: store.scope(state: \.guidance, action: \.guidance))
65+
.tabItem {
66+
Label(String(localized: "Venue", bundle: .module), systemImage: "map")
67+
}
68+
.popoverTip(store.mapTip)
5369
SponsorsListView(store: store.scope(state: \.sponsors, action: \.sponsors))
5470
.tabItem {
5571
Label(String(localized: "Sponsors", bundle: .module), systemImage: "building.2")
@@ -63,6 +79,14 @@ public struct AppView: View {
6379
}
6480
}
6581

82+
struct MapTip: Tip, Equatable {
83+
var title: Text = Text("Go Shibuya First, NOT Garden", bundle: .module)
84+
var message: Text? = Text(
85+
"There are two kinds of Bellesalle in Shibuya. Learn how to get from Shibuya Station to \"Bellesalle Shibuya FIRST\". ",
86+
bundle: .module)
87+
var image: Image? = .init(systemName: "map.circle.fill")
88+
}
89+
6690
#Preview {
6791
AppView(
6892
store: .init(

Diff for: MyLibrary/Sources/AppFeature/Localizable.xcstrings

+30
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
}
1212
}
1313
},
14+
"Go Shibuya First, NOT Garden" : {
15+
"localizations" : {
16+
"ja" : {
17+
"stringUnit" : {
18+
"state" : "translated",
19+
"value" : "渋谷ファーストです!ガーデンではありません!"
20+
}
21+
}
22+
}
23+
},
1424
"Schedule" : {
1525
"localizations" : {
1626
"ja" : {
@@ -30,6 +40,26 @@
3040
}
3141
}
3242
}
43+
},
44+
"There are two kinds of Bellesalle in Shibuya. Learn how to get from Shibuya Station to \"Bellesalle Shibuya FIRST\". " : {
45+
"localizations" : {
46+
"ja" : {
47+
"stringUnit" : {
48+
"state" : "translated",
49+
"value" : "渋谷にはベルサールが2つあります。渋谷駅からベルサール渋谷ファーストへの行き方を確認しましょう。"
50+
}
51+
}
52+
}
53+
},
54+
"Venue" : {
55+
"localizations" : {
56+
"ja" : {
57+
"stringUnit" : {
58+
"state" : "translated",
59+
"value" : "会場"
60+
}
61+
}
62+
}
3363
}
3464
},
3565
"version" : "1.0"

0 commit comments

Comments
 (0)