Skip to content

Commit

Permalink
Merge branch 'main' into yamada-ika/use-fake-data
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamada-Ika committed Aug 1, 2024
2 parents a3d0c2a + ff42fff commit b5d4133
Show file tree
Hide file tree
Showing 42 changed files with 735 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ import io.github.droidkaigi.confsched.model.AboutItem
import io.github.droidkaigi.confsched.model.Lang.JAPANESE
import io.github.droidkaigi.confsched.model.TimetableItem
import io.github.droidkaigi.confsched.model.defaultLang
import io.github.droidkaigi.confsched.profilecard.navigateProfileCardScreen
import io.github.droidkaigi.confsched.profilecard.profileCardScreen
import io.github.droidkaigi.confsched.profilecard.profileCardScreenRoute
import io.github.droidkaigi.confsched.sessions.navigateTimetableScreen
import io.github.droidkaigi.confsched.sessions.navigateToTimetableItemDetailScreen
import io.github.droidkaigi.confsched.sessions.nestedSessionScreens
Expand All @@ -56,9 +59,6 @@ import io.github.droidkaigi.confsched.share.ShareNavigator
import io.github.droidkaigi.confsched.staff.staffScreenRoute
import io.github.droidkaigi.confsched.staff.staffScreens
import io.github.droidkaigi.confsched.ui.NavHostWithSharedAxisX
import io.github.droidkaigi.confshed.profilecard.navigateProfileCardScreen
import io.github.droidkaigi.confshed.profilecard.profileCardScreen
import io.github.droidkaigi.confshed.profilecard.profileCardScreenRoute
import kotlinx.collections.immutable.PersistentList

@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "65e8a333b2fc3bb01c35d55d51ff325d4b6f5bcabdf6053eaff0b18ce8ef5f61",
"originHash" : "4786eb15a4682bb009bf94654a70cab98b4a0f3e1f738d8d76c54a4906b0b569",
"pins" : [
{
"identity" : "abseil-cpp-binary",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x61",
"green" : "0xE7",
"red" : "0x45"
}
},
"idiom" : "universal"
}
],
Expand Down
7 changes: 5 additions & 2 deletions app-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ let package = Package(
.target(
name: "FavoriteFeature",
dependencies: [
.commonComponents,
.tca,
.theme,
.kmpClient,
.kmpModule,
]
),
.testTarget(
Expand Down Expand Up @@ -210,8 +213,8 @@ let package = Package(
.tca
]
),
.target(name: "CommonComponents", dependencies: [.theme, .kmpModule]),
.target(name: "Model"),
.target(name: "CommonComponents", dependencies: [.theme, .kmpModule, .model]),
.target(name: "Model", dependencies: [.kmpModule, .theme]),
// Please run ./gradlew app-ios-shared:assembleSharedXCFramework first
.binaryTarget(name: "KmpModule", path: "../app-ios-shared/build/XCFrameworks/debug/shared.xcframework"),
]
Expand Down
22 changes: 22 additions & 0 deletions app-ios/Sources/App/RootReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public struct RootReducer {
case timetableDetail(TimetableDetailReducer)
}

@Reducer(state: .equatable)
public enum Favorite {
case timetableDetail(TimetableDetailReducer)
}

@Reducer(state: .equatable)
public enum About {
case staff(StaffReducer)
Expand All @@ -37,6 +42,7 @@ public struct RootReducer {

public struct Paths: Equatable {
public var timetable = StackState<Path.Timetable.State>()
public var favorite = StackState<Path.Favorite.State>()
public var about = StackState<Path.About.State>()
}

Expand All @@ -63,6 +69,7 @@ public struct RootReducer {
@CasePathable
public enum Paths {
case timetable(StackActionOf<RootReducer.Path.Timetable>)
case favorite(StackActionOf<RootReducer.Path.Favorite>)
case about(StackActionOf<RootReducer.Path.About>)
}
}
Expand Down Expand Up @@ -110,11 +117,26 @@ public struct RootReducer {
))
return .none

case let .favorite(.destination(destination)):
switch destination {
case let .timetableDetail(timetableItemWithFavorite):
state.paths.favorite.append(
.timetableDetail(
.init(
timetableItem: timetableItemWithFavorite.timetableItem,
isBookmarked: timetableItemWithFavorite.isFavorited
)
)
)
return .none
}

default:
return .none
}
}
.forEach(\.paths.about, action: \.paths.about)
.forEach(\.paths.favorite, action: \.paths.favorite)
.forEach(\.paths.timetable, action: \.paths.timetable)
}
}
44 changes: 30 additions & 14 deletions app-ios/Sources/App/RootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,14 @@ public struct RootView: View {
)
}

FavoriteScreen(
store: store.scope(
state: \.favorite,
action: \.favorite
)
)
.tag(Tab.favorite)
.tabItem {
Label(
title: { Text("Favorite") },
icon: { Image(.icFav).renderingMode(.template) }
)
}
favoriteTab
.tag(Tab.favorite)
.tabItem {
Label(
title: { Text("Favorite") },
icon: { Image(.icFav).renderingMode(.template) }
)
}

aboutTab
.tag(Tab.about)
Expand All @@ -78,7 +73,6 @@ public struct RootView: View {
)
}
}
.tint(AssetColors.Custom.flamingo.swiftUIColor)
.navigationBarTitleStyle(
color: AssetColors.Surface.onSurface.swiftUIColor,
titleTextStyle: .titleMedium,
Expand Down Expand Up @@ -138,6 +132,28 @@ public struct RootView: View {
}
}
}

@MainActor
private var favoriteTab: some View {
NavigationStack(
path: $store.scope(
state: \.paths.favorite,
action: \.paths.favorite
)
) {
FavoriteView(
store: store.scope(
state: \.favorite,
action: \.favorite
)
)
} destination: { store in
switch store.case {
case let .timetableDetail(store):
TimetableDetailView(store: store)
}
}
}
}

#Preview {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "check.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Circle.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "ic_diamond.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "ic_sharp_diamond.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Square.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "ic_triangle.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b5d4133

Please sign in to comment.