Skip to content

Commit

Permalink
Add venue tab (#43)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
d-date committed Mar 19, 2024
1 parent 544ea7a commit cc88684
Show file tree
Hide file tree
Showing 36 changed files with 1,177 additions and 130 deletions.
22 changes: 21 additions & 1 deletion MyLibrary/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ let package = Package(
products: [
.library(
name: "AppFeature",
targets: ["AppFeature"])
targets: ["AppFeature"]),
.library(
name: "GuidanceFeature",
targets: ["GuidanceFeature"]
)
],
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.9.1"),
Expand All @@ -19,6 +23,7 @@ let package = Package(
.target(
name: "AppFeature",
dependencies: [
"GuidanceFeature",
"ScheduleFeature",
"SponsorFeature",
"trySwiftFeature",
Expand All @@ -34,6 +39,21 @@ let package = Package(
.process("Resources")
]
),
.target(
name: "GuidanceFeature",
dependencies: [
"MapKitClient",
"Safari",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
]
),
.target(
name: "MapKitClient",
dependencies: [
"SharedModels",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
]
),
.target(
name: "Safari",
dependencies: [
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 cc88684

Please sign in to comment.